This book is for Laravel developers who already work on real applications and want testing to become a method, not something done now and then. It focuses on the backend: application logic, data, business rules, side effects, queued jobs, regressions, suite speed and continuous integration.
All the examples come from one SaaS application built around workspaces, users, roles, projects and tasks. The point is to write tests that protect what the system does rather than how it is implemented, and to know what to test, how to test it and when to stop.
Along the way it covers:
- feature tests you can trust
- realistic scenarios with factories and states
- actions, use cases and business logic
- fakes for mail, notifications, queues and events
- queued jobs, failures and retries
- turning real bugs into regression tests
- a faster, more maintainable suite, and a checklist for CI
- mutation testing, to check how good the tests really are
The code uses Laravel 13 and Pest 4.