laravel-tdd

Guide test-driven development in Laravel projects using PHPUnit and Pest.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/derekhu0002/ai4pb-orchestrator --skill laravel-tdd-derekhu0002
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/derekhu0002/ai4pb-orchestrator/tree/main/skills/laravel-tdd
Command: npx skills add https://github.com/derekhu0002/ai4pb-orchestrator --skill laravel-tdd-derekhu0002

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel projects often struggle to implement reliable tests quickly. This skill guides teams to adopt Test-Driven Development using PHPUnit and Pest, with factories and database testing to ensure robust, maintainable code.

Core Features & Use Cases

  • Unit tests for pure logic and services
  • Feature tests for HTTP endpoints, authentication, and validation
  • Database testing with factories and in-memory strategies to keep tests fast and deterministic
  • Guidance on Pest vs PHPUnit and structuring test suites across modules and projects

Quick Start

Create a Pest or PHPUnit test suite in a Laravel project and run the tests to validate functionality.

Frequently Asked Questions about laravel-tdd

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

FAQPage Schema
How do I start test-driven development in Laravel using PHPUnit and Pest?

Start Laravel TDD by creating a Pest or PHPUnit test suite to validate functionality. This skill guides test-driven development for unit, feature, and integration testing scenarios including models, controllers, jobs, and notifications.

What's the best way to organize Laravel test suites for models and controllers?

The best way to organize Laravel test suites is by applying structured test organization patterns across modules and projects. This ensures high coverage and fast feedback in CI while testing models, controllers, jobs, and notifications.

Should I use Pest or PHPUnit for Laravel testing?

Choosing between Pest and PHPUnit for Laravel testing depends on your team's preference. This skill provides guidance on Pest vs PHPUnit to structure reliable test suites using factories and database testing strategies for maintainable code.

How do I keep database testing fast and deterministic in Laravel?

Keep database testing fast and deterministic in Laravel by using factories and in-memory database strategies. This skill specifies recommended database strategies to maintain high coverage and reliable test feedback during TDD workflows.

Can I use Laravel factories for feature and integration testing?

Yes, you can use Laravel factories for feature and integration testing. This skill covers database testing with factories to ensure robust HTTP endpoint, authentication, and validation tests remain fast and deterministic.