Skip to content

Latest commit

 

History

History
69 lines (47 loc) · 2.04 KB

integrations.md

File metadata and controls

69 lines (47 loc) · 2.04 KB

Integrations

Testbench hopes to provide a complete solution for package developments, in the latest version we now support direct integrations with the following 3rd party packages:

Spatie Ray

Starting from Testbench 6.10 you may now use Ray debugging tool directly when running tests.

use PHPUnit\Framework\Attributes\Test;

#[Test]
public function it_can_resolve_domain_route()
{
    /** @var \Illuminate\Testing\TestResponse $response */
    $response = $this->get('http://api.localhost/hello');

    ray($response); # [!code ++] # [!code focus]
}

Ray Example

Configuration

You can configure Ray using phpunit.xml:

<phpunit>

    // ...

    <php>
        <env name="RAY_ENABLED" value="(true)"/> # [!code ++:9] # [!code focus:9]
        <env name="SEND_CACHE_TO_RAY" value="(false)"/>
        <env name="SEND_DUMPS_TO_RAY" value="(true)"/>
        <env name="SEND_JOBS_TO_RAY" value="(false)"/>
        <env name="SEND_LOG_CALLS_TO_RAY" value="(true)"/>
        <env name="SEND_QUERIES_TO_RAY" value="(false)"/>
        <env name="SEND_REQUESTS_TO_RAY" value="(false)"/>
        <env name="SEND_VIEWS_TO_RAY" value="(false)"/>
        <env name="SEND_EXCEPTIONS_TO_RAY" value="(true)"/>
    </php>

</phpunit>

Collision

You can also utilize Collision with Testbench to use Laravel-flavored artisan test commands, including parallel testing. First of all, include nunomaduro/collision in your package:

composer require --dev "nunomaduro/collision"

After installation is complete and package:discover is executed you should be able to use package:test command directly from testbench CLI:

vendor/bin/testbench package:test

Collision Example

::: tip Support for Parallel Testing

With package:test you are able to use --parallel options to use Parallel Testing. However, do review Laravel documentation regarding the subject. :::

Parallel Example