laravel-tdd

Teach test-driven development for Laravel applications using PHPUnit and Pest.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill laravel-tdd-sakamoto-family-smile
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/sakamoto-family-smile/agent_monorepo/tree/main/.claude/skills/ecc/laravel-tdd
Command: npx skills add https://github.com/sakamoto-family-smile/agent_monorepo --skill laravel-tdd-sakamoto-family-smile

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive guide to implementing test-driven development for Laravel applications, outlining a repeatable workflow with PHPUnit and Pest, factories, and robust database testing to improve reliability and maintainability.

Core Features & Use Cases

  • Structured Red-Green-Refactor workflow for Laravel projects using PHPUnit or Pest.
  • Clear guidance on test layers (unit, feature, integration), database strategies, and factory usage to create deterministic tests.
  • Real-world examples and best practices to accelerate safe refactoring and regression prevention in Laravel apps.

Quick Start

Run the test suite following the Laravel TDD workflow to validate new code changes immediately.

Frequently Asked Questions about laravel-tdd

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

FAQPage Schema
How do I structure Laravel TDD tests using PHPUnit and Pest?

Laravel TDD structures tests using a Red-Green-Refactor workflow across unit, feature, and integration layers. It defaults to Pest syntax while supporting PHPUnit, guiding test organization and coverage targets.

What's the best way to write deterministic database tests in Laravel?

Deterministic database testing in Laravel uses factories and robust database strategies to isolate test data. The TDD workflow provides clear guidance on factory usage to create reliable and maintainable test suites.

Can I use Pest instead of PHPUnit for Laravel feature tests?

Yes, Pest is the default testing framework for this Laravel TDD workflow. PHPUnit is supported when needed, allowing you to choose the syntax that best fits your feature and integration testing preferences.

How do factories and mocks work in Laravel integration testing?

Factories generate consistent test data while mocks isolate external dependencies during Laravel integration testing. This combination ensures tests remain deterministic and reliable across complex application workflows.

When do I need test-driven development for Laravel projects?

TDD is needed when improving Laravel application reliability and maintainability through safe refactoring. It provides a repeatable workflow to accelerate development while preventing regressions in typical Laravel projects.