laravel-testing

Guide Laravel testing with Pest using factories, mocks, and feature tests.

Updated Mar 20, 2026
One-click install
npx skills add https://github.com/PickleSoda/history-mapped --skill laravel-testing-picklesoda
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-testing
Source: https://github.com/PickleSoda/history-mapped/tree/main/.agents/skills/laravel-testing
Command: npx skills add https://github.com/PickleSoda/history-mapped --skill laravel-testing-picklesoda

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires laravel, pest, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill unit provides comprehensive guidelines and patterns for testing Laravel applications using Pest, ensuring reliable and maintainable test cases.

Core Features & Use Cases

  • Comprehensive Testing Guide: Offers a complete guide to testing conventions, patterns, and best practices.
  • Pest Testing Patterns: Explains the Arrange-Act-Assert pattern and demonstrates its application.
  • Action Testing: Details unit testing of Laravel actions and their guard methods.
  • Mocking Guidelines: Provides guidelines on when and how to use mocks effectively.
  • Factories: Offers a guide to creating test data with factories.
  • Feature Tests: Demonstrates how to write feature tests for HTTP endpoints.

Quick Start

Run the skill by navigating to the 'laravel-testing' directory and executing the 'pest' command.

Frequently Asked Questions about laravel-testing

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

FAQPage Schema
How do I write maintainable Laravel tests using Pest?

Testing Laravel actions with Pest involves unit testing action classes and their guard methods. This Skill provides detailed instructions for isolating and verifying the execution logic of your application's action classes.

When should I use mocking in Laravel Pest tests?

Use mocking in Laravel Pest tests when you need to isolate specific components without triggering real dependencies. This Skill provides explicit guidelines on when and how to effectively apply mocks to maintain test reliability without over-mocking.

How do I create test data with factories in Laravel?

Creating test data with factories in Laravel involves defining model states and attributes. This Skill offers a comprehensive guide to structuring factories correctly so your feature and action tests have reliable, maintainable data setups.

Does this Laravel testing guide support feature tests for HTTP endpoints?

Yes, this Laravel testing guide supports feature tests for HTTP endpoints. It demonstrates how to write feature tests using Pest, ensuring your application's HTTP routes and responses function correctly under various conditions.

Do I need Pest installed to use these Laravel testing best practices?

Yes, you need both Laravel and Pest installed to use these testing best practices. The Skill is a collection of guides and patterns specifically designed for the Pest testing framework, requiring it to execute the provided instructions.