0088-laravel-tdd-with-pest

Implement Laravel TDD workflows with Pest or PHPUnit failing tests.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0088-laravel-tdd-with-pest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 0088-laravel-tdd-with-pest
Source: https://github.com/MrJmpl3/codex_____data_____configuration/tree/main/skills/0088-laravel-tdd-with-pest
Command: npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0088-laravel-tdd-with-pest

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you write Laravel code with confidence by making you start from a failing test, then implement the smallest change that satisfies the expected behavior.

Core Features & Use Cases

  • RED-GREEN-REFACTOR workflow: Drive development by confirming the test fails first, implementing minimal code to pass, and then improving clarity and structure.
  • Practical Laravel testing patterns: Use model factories, prefer feature tests for HTTP/controller behavior, and keep tests deterministic and fast (including parallel test runners).
  • Debugging and design guidance: Treat difficult tests as a signal of overly coupled code and refactor toward small services and better dependency injection.

Quick Start

Run Pest or PHPUnit tests in parallel with your Laravel app, starting by adding a feature test that demonstrates the behavior you want, confirming it fails, and then writing only the minimal code needed to make it pass.

Frequently Asked Questions about 0088-laravel-tdd-with-pest

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

FAQPage Schema
How do I practice TDD in Laravel using Pest?

To practice TDD in Laravel using Pest, write a failing feature test first, implement the minimal code to pass it, and refactor for clarity. This workflow enforces deterministic tests and validates expected failure reasons before behavior implementation.

What is the RED-GREEN-REFACTOR workflow for Laravel feature testing?

The RED-GREEN-REFACTOR workflow drives Laravel feature testing by confirming a test fails first, writing minimal production code to pass it, then improving structure. It treats difficult tests as a signal of coupled code to guide refactoring.

Does this TDD workflow support PHPUnit alongside Pest?

Yes, this TDD workflow supports both Pest and PHPUnit for Laravel feature testing. It applies the same discipline of writing failing tests before production changes and validating expected failure reasons across both testing frameworks.

How do I make Laravel tests faster with parallel testing?

You make Laravel tests faster by running Pest or PHPUnit with parallel test execution. This provides faster feedback cycles while maintaining deterministic tests that avoid sleeps and rely on realistic data setup with model factories.

Why do my Laravel feature tests keep failing unpredictably?

Unpredictable Laravel feature tests often lack determinism, using sleeps or coupled code. This TDD workflow requires deterministic tests without sleeps, using model factories for realistic data setup and treating difficult tests as a signal to refactor toward small services.

When should I refactor during Laravel TDD?

You should refactor during Laravel TDD after your failing test passes, treating difficult tests as a signal of overly coupled code. Refactor toward small services and better dependency injection to improve clarity and maintain test determinism.