coders-tm/laravel-core / .agents/skills/testbench-docs
testbench-package-testing
VerifiedDevelops and tests Laravel packages using Orchestra Testbench. Activates when writing package tests, configuring testbench.yaml, managing migrations, defining routes/environment for tests, using Testbench Dusk for browser tests, or working with Workbench for package preview.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.2 KB |
| api-examples.md | markdown | 907 B |
| getting-started.md | markdown | 3.2 KB |
| getting-started/configuration.md | markdown | 5.2 KB |
| markdown-examples.md | markdown | 1.0 KB |
| testbench-dusk.md | markdown | 3.3 KB |
| testbench-dusk/the-basic.md | markdown | 3.3 KB |
| testbench-dusk/troubleshooting.md | markdown | 1.7 KB |
| testbench.md | markdown | 2.7 KB |
| testbench/cli.md | markdown | 1.9 KB |
| testbench/integrations.md | markdown | 2.0 KB |
| testbench/the-basic.md | markdown | 6.4 KB |
| testbench/the-basic/databases.md | markdown | 5.0 KB |
| testbench/the-basic/environment.md | markdown | 4.9 KB |
| testbench/the-basic/routes.md | markdown | 2.3 KB |
| testbench/troubleshooting.md | markdown | 3.5 KB |
| workbench.md | markdown | 1.2 KB |
testbench/integrations.md
View on GitHub# 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.
```php
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]
}
```

### Configuration
You can configure Ray using `phpunit.xml`:
```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:
```bash
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:
```bash
vendor/bin/testbench package:test
```

::: tip Support for Parallel Testing
With `package:test` you are able to use `--parallel` options to use Parallel Testing. However, do review [Laravel documentation](https://laravel.com/docs/8.x/testing#running-tests-in-parallel) regarding the subject.
:::

Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |