laravel-tdd

Automate Laravel test-driven development workflows with PHPUnit and Pest.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/caovinhphuc/React-OAS-Integration-v4.0 --skill laravel-tdd-caovinhphuc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/caovinhphuc/React-OAS-Integration-v4.0/tree/main/.claude/skills/laravel-tdd
Command: npx skills add https://github.com/caovinhphuc/React-OAS-Integration-v4.0 --skill laravel-tdd-caovinhphuc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamline Laravel development by applying test-driven development using PHPUnit or Pest to deliver reliable, well-tested code with high coverage.

Core Features & Use Cases

  • Red-Green-Refactor workflow for Laravel applications, ensuring features are implemented to pass tests before production.
  • Support for Unit, Feature, and Integration tests, including database strategies and factories.
  • Guidance on choosing Pest by default, or PHPUnit when project standards require it, with practical examples.

Quick Start

Follow the Red-Green-Refactor cycle in a new Laravel project by writing a Pest test that asserts a basic model behavior, then implement the feature to pass the test.

Frequently Asked Questions about laravel-tdd

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

FAQPage Schema
How do I practice test-driven development in Laravel using Pest?▼

Test-driven development in Laravel using Pest follows the Red-Green-Refactor workflow: write a failing Pest test asserting a specific behavior, implement the minimal code to pass it, then refactor. This ensures features are built reliably with consistent coverage before production.

What's the best way to set up database testing and factories in Laravel?▼

Database testing in Laravel uses model factories to generate deterministic test data. By combining factories with PHPUnit or Pest, you can isolate database state for feature and integration tests, ensuring reliable and consistent test coverage across different testing layers.

Should I use Pest or PHPUnit for my Laravel testing workflow?▼

Pest is the recommended default for Laravel testing due to its streamlined syntax, but PHPUnit should be used when existing project standards require it. Both frameworks support the Red-Green-Refactor cycle for unit, feature, and integration tests effectively.

How do I write a basic feature test for a Laravel application?▼

Writing a feature test in Laravel involves using Pest or PHPUnit to assert a specific model behavior or HTTP response. You write the test first to define the expected outcome, then implement the application logic to make the test pass.

Does test-driven development work for refactoring and bug fixes in Laravel?▼

Test-driven development works effectively for refactoring and bug fixes in Laravel by ensuring existing behavior remains stable. You write tests that capture the current logic or reproduce the bug, then refactor the code or apply the fix to make all tests pass.