graham-campbell/testbench
Laravel TestBench by Graham Campbell provides testing functionality for Laravel packages, built on PHPUnit, Mockery, Orchestral Testbench, and Laravel Testbench Core. Supports PHP 7.4-8.5, PHPUnit 9-11, and Laravel 8-13.
Architecture fit
composer require --dev graham-campbell/testbench:^6.3 and nothing else.orchestral/testbench (Laravel app bootstrapping for packages), and graham-campbell/testbench-core (shared abstractions). TestBench itself is thin — abstract test case classes (AbstractTestCase, AbstractAppTestCase, AbstractPackageTestCase) plus service-provider assertion helpers.Foundation\Testing\TestCase." For an application codebase, the answer is generally no. For a portfolio of first-party Laravel packages, the value is real: one consistent base case across repos, less duplicated bootstrap, and service-provider test helpers out of the box.Integration feasibility
Technical risk
getBasePath() and getRequiredServiceProviders() static and added return types, a breaking signature change for any team that overrode them. Budget a recurring upgrade task, not a one-off.composer.json, not prose.Key questions
composer.json say versus the README?orchestral/testbench directly and writing ~50 lines of base case ourselves?Stack fit
require-dev; it must never appear in production dependencies and should be excluded from production autoload/CI deploy artefacts.Migration path
AbstractTestCase / AbstractPackageTestCase; delete duplicated framework bootstrap.getBasePath(): string static; getRequiredServiceProviders(): array static, no app parameter). This is the only mechanical code change and is greppable.kylekatarnls/update-helper (explicitly conflicted) or divergent orchestral/testbench constraints from other packages in the workspace.Compatibility
composer.json and mirror it in the CI matrix. A green local run against a different PHPUnit minor than CI is the most likely source of phantom failures.orchestral/testbench version across all packages before rollout — this is the usual collision point.Sequencing
Maintenance
Support
[email protected]), changelog and release notes maintained consistently. Commercial support is available through the Tidelift subscription — a credible mitigation for the single-maintainer risk if the package becomes load-bearing across many repos.Scaling
Failure modes
orchestral/testbench or PHPUnit major; resolution fails and blocks the whole upgrade.Ramp-up
How can I help you explore Laravel packages today?