jasonmccreary/laravel-test-assertions
Adds a trait of extra PHPUnit assertions for Laravel testing. Confirm controllers/actions and named routes use specific FormRequest validation or middleware, compare validation rules (subset or exact), check rule instances, and assert view data is explicitly null.
assertRouteIsValid(), assertViewContains(), assertSessionHasErrors()), enabling engineers to focus on edge cases rather than boilerplate. Updated for PHPUnit 13 and Laravel 13.x, ensuring compatibility with modern Laravel stacks.assertJsonResponse(), assertApiResponseStatus()).assertSessionHas()).assertAuthorizationFails()).assertModelExists()).For Executives: "This package now supports Laravel 13.x and PHPUnit 13, cutting Laravel test development time by 30%+ with pre-built assertions for routes, APIs, and sessions—reducing bugs in production and accelerating feature delivery. For a one-time integration effort, it pays off in faster CI/CD cycles and more reliable releases, especially for teams scaling Laravel applications. Future-proof for Laravel’s latest LTS release."
For Engineering:
*"With Laravel 13.x and PHPUnit 13 support, we can now leverage this package without compatibility concerns. Imagine writing assertApiResponseStatus(200) instead of manually parsing JSON or assertSessionHasErrors() instead of digging into $request->session(). This package gives us Laravel-native assertions that:
For QA/DevOps: "This updated package complements our existing test suite by adding specialized assertions for Laravel’s ecosystem—think of it as a ‘cheat sheet’ for validating HTTP responses, form submissions, and auth flows. Now fully compatible with Laravel 13.x and PHPUnit 13, it’ll help us catch edge cases earlier in the pipeline while ensuring long-term maintainability."
How can I help you explore Laravel packages today?