testing-laravel

Generate Laravel feature and unit tests using PHPUnit.

Updated May 2, 2026
One-click install
npx skills add https://github.com/iliaal/compound-engineering-plugin --skill testing-laravel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-laravel
Source: https://github.com/iliaal/compound-engineering-plugin/tree/main/distillery/generated-skills/testing-laravel
Command: npx skills add https://github.com/iliaal/compound-engineering-plugin --skill testing-laravel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of writing comprehensive tests for Laravel applications, ensuring code quality and stability through effective use of PHPUnit.

Core Features & Use Cases

  • Feature & Unit Testing: Differentiates and guides the creation of both full-stack feature tests and isolated unit tests.
  • Database & API Testing: Provides patterns for asserting database state, validating API responses, and handling authentication.
  • Use Case: When developing a new API endpoint in Laravel, use this Skill to generate feature tests that cover successful creation, validation errors, and authorization checks.

Quick Start

Use the testing-laravel skill to write a feature test for a new user registration API endpoint.

Frequently Asked Questions about testing-laravel

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

FAQPage Schema
How do I write PHPUnit feature tests for a Laravel API endpoint?

Laravel API testing with PHPUnit involves generating feature tests that cover successful creation, validation errors, and authorization checks. This approach validates API responses and handles authentication within your Laravel application.

What is the difference between feature testing and unit testing in Laravel?

Feature testing in Laravel involves full-stack tests exercising controllers and databases, while unit testing focuses on isolated logic. This distinction guides the creation of robust tests for models, services, and actions.

Can I test Laravel artisan commands and background jobs using PHPUnit?

Yes, you can test Laravel artisan commands and background jobs using PHPUnit. The testing methodology supports generating tests for jobs, artisan commands, services, and actions to ensure code quality and stability.

How do I assert database state and use model factories in Laravel tests?

Asserting database state in Laravel tests involves using specific assertion patterns and model factories. This ensures critical rules for database interactions are followed, validating that data is correctly persisted during feature testing.

Do I need to configure database interactions separately for Laravel unit tests?

Laravel unit tests focus on isolated logic, reducing the need for full database interactions compared to feature tests. When database state validation is required, specific assertion types and model factories are utilized to maintain efficiency.