What problem does it solve?
Writing robust Laravel tests can be tedious and brittle without proven patterns. This skill consolidates Pest-based testing practices to promote isolation, readability, and maintainability across unit and feature tests.
Core Features & Use Cases
- Triple-A pattern: Arrange-Act-Assert for clear tests that separate setup, action, and verification.
- Declarative factories: Readable test data creation using factory methods instead of inline arrays.
- Mocking & isolation: Guidance on when and what to mock, how to use null drivers, and how to resolve actions from the container.
- Use Case: E.g., testing a Laravel service or controller by composing actions, factories, and mocks for deterministic results.
Quick Start
Install Pest in your Laravel project and follow the Triple-A approach:
- Create a simple unit test using factories and the resolve() helper for actions.
- Structure tests to be isolated, readable, and fast; avoid brittle assertions and heavy mocks.
- Use the provided factory patterns to express business intent in tests.