laravel-tdd

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

Updated Mar 20, 2026
One-click install
npx skills add https://github.com/KanakMalpani/General-Private-Skills --skill laravel-tdd-kanakmalpani
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/KanakMalpani/General-Private-Skills/tree/main/skills/laravel-tdd
Command: npx skills add https://github.com/KanakMalpani/General-Private-Skills --skill laravel-tdd-kanakmalpani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamlines test-driven development for Laravel projects by outlining a clear workflow, layering tests, and guiding database strategies to improve test reliability and speed.

Core Features & Use Cases

  • Unit tests validate pure logic and services.
  • Feature tests cover HTTP endpoints, authentication, and response shapes.
  • Integration tests validate database, queues, and external services.
  • Database strategies include RefreshDatabase, DatabaseTransactions, and DatabaseMigrations for fast, reliable test runs.
  • Pest vs PHPUnit guidance for project alignment.

Quick Start

Install the testing framework and start writing tests with Pest or PHPUnit to begin the Red-Green-Refactor cycle in your Laravel project.

Frequently Asked Questions about laravel-tdd

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

FAQPage Schema
How do I automate test-driven development workflows for Laravel applications?

Automate Laravel test-driven development by enforcing a Red-Green-Refactor cycle across unit, feature, and integration tests for models, controllers, jobs, and policies using PHPUnit or Pest.

What is the best database testing strategy for fast and reliable Laravel tests?

The best database testing strategy uses RefreshDatabase, DatabaseTransactions, or DatabaseMigrations to ensure fast, reliable test runs by managing state resets efficiently across integration tests.

Should I use Pest or PHPUnit for my Laravel project?

Choosing Pest vs PHPUnit depends on project alignment; both are fully supported for writing tests, and the workflow provides guidance to help you select the appropriate framework conventions for your application.

How do I test HTTP endpoints, authentication, and response shapes in Laravel?

Test HTTP endpoints, authentication, and response shapes using feature tests, which validate HTTP interactions and ensure your application's endpoints return the correct authenticated responses.

When do I need integration tests for queues and external services in Laravel?

You need integration tests when validating database interactions, queues, and external services, ensuring these components work together reliably within your Laravel application architecture.

Can I validate pure logic and services using Laravel unit tests?

Yes, you can validate pure logic and services using unit tests, which isolate specific components to verify business rules and service behaviors without triggering broader application dependencies.