testing-laravel
Installation
SKILL.md
Testing Laravel
Use PHPUnit with Laravel's testing helpers. Every test file starts with declare(strict_types=1).
Test Classification
- Feature tests (
tests/Feature/): HTTP requests through the full stack — routes, controllers, middleware, validation, database. Use$this->getJson(),$this->postJson(), etc. - Unit tests (
tests/Unit/): Isolated logic — services, actions, value objects, helpers. No HTTP, minimal database.
Default to feature tests for anything touching routes, controllers, or models. Use unit tests for pure logic and action classes.