laravel-tdd

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

2|Updated May 11, 2026
One-click install
npx skills add https://github.com/himanshu231204/AI_Research_agent --skill laravel-tdd-himanshu231204
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/himanshu231204/AI_Research_agent/tree/main/.opencode/skills/laravel-tdd
Command: npx skills add https://github.com/himanshu231204/AI_Research_agent --skill laravel-tdd-himanshu231204

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing tests for Laravel applications is often inconsistent, time-consuming, and fails to catch regressions, leading to fragile code that breaks unexpectedly during feature updates or refactors when teams lack standardized testing practices.

Core Features & Use Cases

  • Dual framework support: Works with both PHPUnit and Pest, defaulting to Pest for new Laravel projects to reduce boilerplate.
  • Comprehensive test coverage guidance: Includes best practices for unit, feature, and integration tests covering Eloquent models, HTTP endpoints, authentication, queues, jobs, and notifications.
  • Built-in testing utilities: Pre-configured database testing strategies (RefreshDatabase, DatabaseTransactions), fakes for queues, mail, and external APIs, and 80%+ coverage targets to ensure reliable, maintainable code.
  • Real-world use case: For a Laravel SaaS app, use this skill to write feature tests for new user onboarding endpoints, fake payment gateway calls to avoid hitting real services, and validate that welcome emails are dispatched correctly without sending actual messages.

Quick Start

Use the laravel-tdd skill to write a passing Pest feature test for a new Laravel API endpoint that creates a project, including database assertions and authenticated user checks.

Frequently Asked Questions about laravel-tdd

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

FAQPage Schema
How do I structure test-driven development in Laravel to achieve 80%+ test coverage?

Test-driven development in Laravel achieves 80%+ coverage by applying standardized workflows for feature development, refactors, and validation across Eloquent models, HTTP endpoints, authentication, queues, and notifications.

Does Laravel TDD support both PHPUnit and Pest testing frameworks?

Yes, Laravel TDD supports both PHPUnit and Pest testing frameworks, defaulting to Pest for new projects to reduce boilerplate while maintaining comprehensive unit and feature test coverage.

What is the best way to isolate database and external service testing in Laravel?

Isolate database and external service testing in Laravel by using built-in utilities like RefreshDatabase, DatabaseTransactions, and fakes for queues, mail, and external APIs to prevent hitting real services.

How do I fake payment gateway calls and validate email dispatch in Laravel feature tests?

Fake payment gateway calls and validate email dispatch in Laravel feature tests by utilizing built-in fakes for external APIs and notifications, ensuring welcome emails are correctly dispatched without sending actual messages.

Can I use this Laravel TDD workflow for testing API endpoints and Eloquent models?

Yes, you can use this Laravel TDD workflow for testing API endpoints and Eloquent models, providing standardized test-driven development workflows for HTTP endpoints, authentication, queues, jobs, and notifications.

Why does my Laravel application have inconsistent test coverage and fail to catch regressions?

Inconsistent test coverage and regression failures in Laravel applications occur when teams lack standardized testing practices, resulting in fragile code that breaks unexpectedly during feature updates or refactors.