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.
AbstractPackageTestCase, ensuring compatibility across Laravel versions.AbstractAppTestCase, including HTTP, unit, and feature tests.Adopt if:
Look elsewhere if:
*"Laravel TestBench is a plug-and-play solution to eliminate the pain of writing and maintaining tests for Laravel applications and packages. By adopting this, we can:
*"TestBench gives us:
AbstractPackageTestCase lets us test packages in isolation (e.g., for [PackageName]) without spinning up a full Laravel app. Saves hours per release.assertInJson() for API tests.AbstractTestCase and go.
Trade-offs: Slightly more verbose than Pest, but more flexible for complex package tests. If we’re all-in on Pest, we can evaluate alternatives—but TestBench is the industry standard for Laravel packages.*
Proposal: Pilot with our next package release or a high-risk feature. Measure test setup time and flakiness reduction."*How can I help you explore Laravel packages today?