orchestra/pest-plugin-testbench
Pest Plugin for Testbench adds PestPHP support for Laravel package development using Orchestra Testbench. Run your package tests with Pest in a Testbench-powered environment, with simple setup and CI-friendly defaults.
orchestra/pest-plugin-testbench package bridges Pest (PHP testing framework) with Laravel Testbench, enabling seamless Laravel-specific testing within Pest’s ecosystem. This is a highly relevant fit for Laravel projects already using Pest, as it eliminates the need to switch between testing frameworks while retaining Testbench’s Laravel-specific utilities (e.g., mocking services, database transactions, HTTP testing).createApplication(), refreshDatabase(), assertDatabaseHas()) while surfacing them via Pest’s syntax (e.g., uses(TestbenchServiceProvider::class)). This reduces cognitive load for teams familiar with Pest.composer.json and configuring Pest to use it. No breaking changes to Laravel’s core or Testbench’s architecture.it() vs. Testbench’s test()) may require refactoring.createApplication()).@test).composer require orchestra/pest-plugin-testbench --dev
Configure Pest to use the plugin in pest.php:
uses(Orchestra\PestPluginTestbench\TestbenchServiceProvider::class)->in('*');
test() → it()).assertDatabaseHas()).createApplication() signatures).composer.json and CI.test() → it()).refreshDatabase() or withoutRefreshDatabase().pest.php:
parallel()->with(4);
| Risk | Impact | Mitigation |
|---|---|---|
| Plugin Abandonment | Unmaintained code | Fork the plugin if critical. |
| Pest/Testbench Breaking | Tests fail after updates | Pin versions in composer.json. |
| Syntax Conflicts | Mixed Testbench/Pest test failures | Use feature flags to toggle test execution. |
| CI Pipeline Failures | Pest output format not supported | Update CI to parse Pest’s JUnit XML output. |
| Database Test Flakiness | Non-deterministic failures | Use refreshDatabase() sparingly; isolate tests. |
it(), expect(), beforeEach).createApplication() usage).How can I help you explore Laravel packages today?