laravel-testing

Generate Pest and PHPUnit tests for Laravel models, controllers, actions, and services.

Updated Feb 12, 2026
One-click install
npx skills add https://github.com/Guanez/TindaPOS --skill laravel-testing-guanez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-testing
Source: https://github.com/Guanez/TindaPOS/tree/main/.agents/skills/laravel-testing
Command: npx skills add https://github.com/Guanez/TindaPOS --skill laravel-testing-guanez

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a guide and templates for writing clean, maintainable, and efficient tests for Laravel applications using Pest and PHPUnit.

Core Features & Use Cases

  • Testing Patterns: Utilize the Arrange-Act-Assert pattern for testing with Pest.
  • Mocking Guidelines: Learn to effectively mock dependencies for isolation.
  • Testing Strategies: Includes feature tests, unit tests, and testing email/notifications.
  • Declarative Factories: Enhance readability with named methods on factories.
  • Integration Tests: Best practices for testing with external APIs and persistent resources.
  • Quick Start: Write your first test following the triple-A pattern.

Quick Start

Generate a new test case for the Laravel action 'CreateOrderAction' by creating a new test file named 'create_order_test.php' following the triple-A pattern: Arrange the World, Act on the World, Assert on the Results.

Frequently Asked Questions about laravel-testing

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

FAQPage Schema
How do I write tests for Laravel controllers and services using Pest?

You can test Laravel controllers and services using Pest by applying the Arrange-Act-Assert pattern. This approach structures tests into three clear phases: arranging the world, acting on it, and asserting the results.

What is the best way to mock dependencies in Laravel unit tests?

Mocking dependencies in Laravel unit tests follows specific guidelines to isolate components. This Skill provides patterns for effectively mocking external APIs and system dependencies to isolate controller and service logic.

How do I use declarative factories in Laravel for feature testing?

Declarative factories in Laravel enhance test readability by using named methods on factories. This approach structures test data creation clearly, improving maintainability for both feature and unit tests.

Can I test Laravel notifications and emails with PHPUnit?

Yes, you can test Laravel notifications and emails using PHPUnit. This Skill includes testing strategies for email and notifications, alongside patterns for integration tests with external APIs and persistent resources.

Does this Laravel testing approach support testing external APIs?

Testing external APIs in Laravel is supported through dedicated integration test patterns. These guidelines help manage and test persistent resources and external system dependencies within your application code.