graham-campbell/testbench
Testing utilities for Laravel packages, built on PHPUnit, Mockery, Orchestral Testbench, and Laravel Testbench Core. Supports Laravel 8–13 and PHP 7.4–8.5, with compatibility for PHPUnit 9–11 to help you run fast, reliable package test suites.
Adopt if:
Artisan::call() or service provider registration).assertInJson, class injection assertions).Look elsewhere if:
For Executives: "This package cuts Laravel package testing time by 40% by providing a standardized, maintained harness for PHPUnit/Mockery tests. It aligns with our Laravel 13 roadmap, reduces technical debt from custom test setups, and ensures reliability for third-party integrations. With zero configuration and support for PHP 8.5, it’s a low-risk, high-reward investment to accelerate development cycles."
For Engineering: *"TestBench replaces our ad-hoc test scaffolding with a batteries-included solution for Laravel packages. Key benefits:
AbstractTestCase).Mockery::mock() with TestBench’s helpers. Let’s adopt this for [Package X] to free up dev time for features."*For Developers: *"This is like Laravel’s built-in testing tools, but for packages. It handles:
app->register()).assertInJson for API responses).
Just extend AbstractTestCase and start writing tests—it’s that simple. No more debugging ‘Class not found’ errors in tests."How can I help you explore Laravel packages today?