laravel-tdd

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

1|Updated Jan 30, 2021
One-click install
npx skills add https://github.com/fideguch/my_dotfiles --skill laravel-tdd-fideguch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/fideguch/my_dotfiles/tree/main/claude/skills/laravel-tdd
Command: npx skills add https://github.com/fideguch/my_dotfiles --skill laravel-tdd-fideguch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamlines the process of introducing test-driven development in Laravel projects by providing a clear workflow and guidance to achieve reliable test coverage.

Core Features & Use Cases

  • Red-Green-Refactor workflow with PHPUnit and Pest for reliable test cycles.
  • Guidance across Unit, Feature, and Integration tests, including database strategies and the use of factories.
  • Real-world scenarios for validating models, controllers, jobs, and policies with deterministic test data generation.

Quick Start

Install dependencies and run php artisan test to start driving development with tests.

Frequently Asked Questions about laravel-tdd

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

FAQPage Schema
How do I start test-driven development in Laravel with Pest and PHPUnit?

To start test-driven development in Laravel, install dependencies and run php artisan test to drive development with tests. The workflow applies the Red-Green-Refactor cycle using Pest and PHPUnit for reliable test execution across models and controllers.

What database strategy should I use for Laravel feature tests?

Laravel feature tests support database strategies like RefreshDatabase, DatabaseTransactions, and DatabaseMigrations. The chosen strategy ensures deterministic test execution by managing test data generation and database state across unit, feature, and integration testing cycles.

Can I use factories for deterministic test data in Laravel TDD workflows?

Yes, factories are supported for deterministic test data generation in Laravel TDD workflows. They provide real-world scenarios for validating models, controllers, jobs, and policies by generating consistent test data during unit and feature testing with PHPUnit and Pest.

Does TDD with Pest work for testing Laravel jobs and policies?

TDD with Pest works for testing Laravel jobs and policies by applying the Red-Green-Refactor workflow across unit, feature, and integration tests. It provides guidance on validating these components with deterministic test data and specific database strategies.

What is the best way to achieve reliable test coverage in Laravel applications?

The best way to achieve reliable test coverage in Laravel applications is following the Red-Green-Refactor workflow with PHPUnit and Pest. This approach streamlines test-driven development by providing clear guidance across unit, feature, and integration testing with specific coverage targets.