laravel-tdd

Implement test-driven development for Laravel with PHPUnit and Pest.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/ThejanaJayalath/Niolla-PM-system --skill laravel-tdd-thejanajayalath
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/ThejanaJayalath/Niolla-PM-system/tree/main/.cursor/skills/laravel-tdd
Command: npx skills add https://github.com/ThejanaJayalath/Niolla-PM-system --skill laravel-tdd-thejanajayalath

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the challenge of maintaining high code quality and reliability in Laravel applications by providing a structured, repeatable approach to Test-Driven Development.

Core Features & Use Cases

  • Testing Infrastructure: Provides standardized configurations for PHPUnit and Pest, including database, mail, and queue fakes.
  • Workflow Automation: Guides the Red-Green-Refactor cycle for controllers, models, and API endpoints.
  • Use Case: When building a new feature, use this skill to generate factories, write feature tests for HTTP requests, and ensure authorization logic is correctly enforced before writing the implementation code.

Quick Start

Use the laravel-tdd skill to generate a new feature test for the User registration endpoint using Pest.

Frequently Asked Questions about laravel-tdd

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

FAQPage Schema
How do I write feature tests for Laravel Sanctum-authenticated APIs?

To write feature tests for Laravel Sanctum-authenticated APIs, you can use structured test-driven development workflows that generate HTTP requests and assert responses. This approach validates authorization logic and ensures robust code coverage before writing implementation code.

Can I use Pest with PHPUnit for Laravel test-driven development?

Yes, you can use Pest with PHPUnit for Laravel test-driven development. The workflow provides standardized configurations for both frameworks, enabling you to write unit and feature tests while guiding the Red-Green-Refactor cycle for controllers and models.

What's the best way to mock external services in Laravel tests?

The best way to mock external services in Laravel tests is by utilizing database, mail, and queue fakes alongside model factories. This ensures consistent test data and isolates Eloquent models and HTTP controllers from external dependencies during test execution.

How do I generate model factories for Laravel testing workflows?

To generate model factories for Laravel testing workflows, follow an automated test-driven development approach that creates consistent test data. This allows you to build standardized configurations and write unit tests for Eloquent models before implementing the actual application logic.

Does test-driven development work for existing Laravel HTTP controllers?

Yes, test-driven development works for existing Laravel HTTP controllers by guiding the Red-Green-Refactor cycle. You can write feature tests for HTTP requests to ensure your existing controllers and authorization logic are correctly enforced without breaking current functionality.