orchestra/testbench-core
Orchestra Testbench Core is the foundation for testing Laravel packages. It boots a lightweight Laravel app inside your package so you can run artisan commands, migrations, routing, and more, with compatibility across Laravel 6–12.
WithConfig attributes) and edge cases (e.g., Str/Validator state flushing).Adopt if:
Look elsewhere if:
For Executives: "Testbench Core lets us ship Laravel packages faster and with fewer bugs by automating the tedious setup of test environments. It’s like having a ‘test lab’ for our code—developers can spin up Laravel instances in seconds, not hours. This reduces debugging time, improves CI/CD reliability, and future-proofs our tech stack against Laravel updates. For example, [Package X]’s test suite went from 45 minutes to 5 minutes with parallel testing, and we’ve cut package compatibility issues by 30%."
For Engineering: *"Testbench solves three key pain points:
Str, Validator, JsonResource between tests).Artisan command, we now write:$response = $this->artisan('package:command', ['--option' => 'value'])
->assertExitCode(0);
No need to manually bootstrap Laravel—Testbench handles it."*
For Developers:
*"This replaces:
❌ ‘I spent 2 hours setting up a test database…’
✅ ‘php artisan testbench:test—done in 10 seconds.’
Key perks:
#[WithConfig]).WithFixtures trait.flushState() to avoid test pollution from Str::macro() or Validator rules."*How can I help you explore Laravel packages today?