laravel-tdd

Author unit, feature, and integration tests for Laravel with PHPUnit and Pest.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Maelwalser/claude-config --skill laravel-tdd-maelwalser
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/Maelwalser/claude-config/tree/main/skills/laravel-tdd
Command: npx skills add https://github.com/Maelwalser/claude-config --skill laravel-tdd-maelwalser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a practical test-driven development workflow for Laravel projects so developers can write reliable, maintainable tests that drive implementation and prevent regressions.

Core Features & Use Cases

  • Red-Green-Refactor Cycle: Encourages writing a failing test first, implementing the minimal change, and refactoring with tests green.
  • Layered Testing Guidance: Distinguishes unit, feature, and integration tests and when to use each for models, services, HTTP endpoints, jobs, and policies.
  • Database and Fixture Strategies: Recommends RefreshDatabase, DatabaseTransactions, factory-driven fixtures, and fakes for queues, mail, notifications, and external HTTP calls.
  • Framework Choices and CI: Prefers Pest for new tests with compatibility notes for PHPUnit and guidance on coverage targets and test configuration for CI.
  • Use Case: Quickly scaffold deterministic feature tests for a new API endpoint with authentication, validation, and database assertions.

Quick Start

Use the laravel-tdd skill to write a failing feature test for your new endpoint, implement the minimal code to pass, and run tests with RefreshDatabase enabled.

Frequently Asked Questions about laravel-tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write feature tests for Laravel API endpoints using Pest?▼

Writing feature tests for Laravel API endpoints using Pest involves authoring a failing test first, implementing minimal code to pass, and running assertions with RefreshDatabase enabled. This workflow validates HTTP endpoints, authentication, and database interactions deterministically.

What's the best way to structure unit and feature tests in a Laravel project?▼

The best way to structure unit and feature tests in Laravel is to distinguish between layers: use unit tests for models and services, and feature tests for HTTP endpoints, jobs, and policies. This layered approach ensures appropriate coverage for each component.

Does the Laravel TDD workflow support PHPUnit alongside Pest?▼

The Laravel TDD workflow supports PHPUnit alongside Pest by providing compatibility notes for existing suites. It prefers Pest for new tests while allowing you to maintain PHPUnit-based test coverage for models, endpoints, and jobs.

How do I manage database state and fixtures when running Laravel tests?▼

Manage database state and fixtures when running Laravel tests by applying RefreshDatabase or DatabaseTransactions strategies. Combine these with factory-driven fixtures to ensure a clean, deterministic state for validating database interactions during your test-driven workflow.

When should I use fakes for queues and external services in Laravel testing?▼

Use fakes for queues and external services in Laravel testing when feature tests require isolation from external side effects. Faking queues, mail, notifications, and HTTP calls ensures your test-driven development cycle remains deterministic and focused on internal application logic.