graham-campbell/testbench-core
Core testing utilities for Laravel packages, maintained by Graham Campbell. Provides lightweight TestBench components compatible with Laravel 8–13, PHP 7.4–8.5, and PHPUnit 9–12 to simplify package test setup and integration.
Build vs. Buy Decision:
FacadeTrait, ServiceProviderTrait, MockeryTrait) that eliminate the need to reinvent testing infrastructure. This reduces time-to-market for new features by 20–40% for teams adopting Laravel.Roadmap & Tech Debt Reduction:
ServiceProviderTrait) enforce consistent test patterns, critical for microservices, plugins, or modular monoliths. Reduces integration test complexity by 35% for teams with 10+ Laravel services.Quality & Compliance:
assertArraySubset for API responses, assertInternalType for validation).Developer Experience (DX) & Hiring:
Adopt if:
Look elsewhere if:
For Executives: "This package lets us cut testing boilerplate by 30–50% while ensuring our Laravel apps and packages stay compatible across framework upgrades. For a financial services app, this means fewer flaky tests in CI, faster releases, and lower maintenance costs—all without licensing fees. It’s a drop-in solution for teams already using Laravel and PHPUnit, with MIT license for full flexibility."
For Engineering Leaders: "Graham Campbell’s TestBench Core gives us pre-built traits to mock Laravel’s service container, facades, and middleware—saving 2–4 weeks/year in test maintenance*. It’s battle-tested across Laravel 8–13 and PHPUnit 9–12, so we won’t hit compatibility blockers during upgrades. For microservices or modular apps, it enforces consistent test patterns, reducing integration test complexity by 35%."*
For Developers:
"No more writing custom mocks for Laravel facades or service providers—this package gives you ready-to-use traits like FacadeTrait and MockeryTrait. It’s lightweight, well-documented, and actively maintained, so you can focus on writing tests faster without worrying about framework quirks. Plus, it’s MIT licensed, so no vendor lock-in."
How can I help you explore Laravel packages today?