laravel-tdd

Guide test-driven development for Laravel applications with PHPUnit or Pest.

Updated May 22, 2026
One-click install
npx skills add https://github.com/Nweremizu/ekklesia --skill laravel-tdd-nweremizu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/Nweremizu/ekklesia/tree/main/.junie/skills/laravel-tdd
Command: npx skills add https://github.com/Nweremizu/ekklesia --skill laravel-tdd-nweremizu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build and change Laravel applications safely by turning ideas, bugs, and refactors into clear test-first workflows that reduce regressions and improve confidence.

Core Features & Use Cases

  • Red-Green-Refactor Guidance: Plan work around a failing test first, then implement the smallest fix, then clean up without breaking behavior.
  • Laravel Test Strategy: Choose the right layer for the job, including unit tests for business logic, feature tests for HTTP and auth flows, and integration tests for database or queue boundaries.
  • Database and Side-Effect Testing: Use RefreshDatabase, factories, fakes, and assertions for mail, notifications, events, queues, and external HTTP calls.
  • Inertia and Coverage Support: Verify Inertia pages, props, and component names while keeping coverage targets high for production-ready Laravel code.
  • Use Case: When adding a new dashboard endpoint or fixing a membership workflow bug, this Skill guides you to write the right test, assert the correct behavior, and protect the change against regressions.

Quick Start

Use the laravel-tdd skill to define the desired Laravel behavior as a failing test first, then implement the minimal code change needed to make that test pass.

Frequently Asked Questions about laravel-tdd

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

FAQPage Schema
How do I write a failing test before implementing a new Laravel feature?

Test-driven development in Laravel involves planning work around a failing test first, implementing the smallest fix to make it pass, then refactoring without breaking behavior to reduce regressions.

How do I test Inertia pages and props in a Laravel application?

Testing Inertia pages in Laravel involves using feature tests to verify component names, assert shared props, and validate page data before implementation to ensure reliable frontend workflows.

What's the best way to isolate database tests in Laravel using factories?

The best way to isolate database tests is using RefreshDatabase alongside model factories to reset state, generate test data, and validate database boundaries without affecting production data.

Does this test-driven development approach work with both Pest and PHPUnit?

Yes, this test-driven development approach works with both Pest and PHPUnit, requiring either framework to plan, write, and validate tests for HTTP endpoints, models, jobs, and notifications.

How do I test side effects like mail, notifications, and queues in Laravel?

To test side effects in Laravel, use fakes and assertions for mail, notifications, events, queues, and external HTTP calls to verify interactions without triggering actual deliveries or external requests.

When should I use feature tests versus unit tests for Laravel HTTP and auth flows?

Use feature tests for Laravel HTTP and auth flows to validate endpoint integration, and use unit tests for isolated business logic to ensure accurate test strategy and high coverage.