What problem does it solve?
Provides a practical workflow and conventions to adopt test-driven development in Laravel projects, reducing regressions and improving confidence by guiding developers to write unit, feature, and integration tests and meet a coverage target.
Core Features & Use Cases
- Red-Green-Refactor workflow: clear cycle for writing a failing test, implementing the minimal fix, and refactoring safely.
- Layered testing guidance: when to use unit, feature, or integration tests for services, controllers, policies, jobs, and notifications.
- Database and isolation strategies: recommendations for RefreshDatabase, DatabaseTransactions, and DatabaseMigrations to keep tests deterministic.
- Fakes and mocks: examples and patterns for Queue::fake, Notification::fake, Http::fake, and Event::fake to isolate external effects.
- CI coverage enforcement: guidance to target combined unit and feature coverage of 80%+ using pcov or Xdebug in CI.
Quick Start
Write a failing Pest or PHPUnit test for the feature you want, implement the smallest change to make it pass, and run the test suite until coverage reaches the 80% target.