$npx skillfedfor your agent

laravel-testing

This skill guides you through testing Laravel 13 applications with either Pest PHP 4 or PHPUnit 12, covering 24 rules across HTTP endpoints, model factories, database state verification, service mocking, and authentication patterns. It detects your project's testing framework automatically and provides syntax examples for both frameworks side-by-side, so you can write fast, readable tests regardless of which one you use.

laravel-testing helps you write feature and unit tests for Laravel 13 using Pest PHP 4 or PHPUnit 12.

AI-generated summary based on this skill's SKILL.md

58 9 MITupdated by AsyrafHussin

Decision gist · record as of 2026-05-16

laravel-testing helps you write feature and unit tests for Laravel 13 using Pest PHP 4 or PHPUnit 12. This skill guides you through testing Laravel 13 applications with either Pest PHP 4 or PHPUnit 12, covering 24 rules across HTTP endpoints, model factories, database state verification, service mocking, and authentication patterns. It detects your project's testing framework automatically and provides syntax examples for both frameworks side-by-side, so you can write fast, readable tests regardless of which one you use.

manual: git clone https://github.com/AsyrafHussin/agent-skills → cp -r agent-skills/skills/laravel-testing ~/.claude/skills/laravel-testing
skills/laravel-testing/SKILL.md · version f4d048c3

Use it when

  • laravel-testing helps you evaluate both frameworks so you can make an informed choice.
  • laravel-testing covers creating model factories and test data with relationships.

Verify before relying

Read SKILL.md below before installing (28 files). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

AsyrafHussin/agent-skills/laravel-testing

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is laravel-testing and which frameworks does it support?

laravel-testing is a skill for writing feature and unit tests in Laravel 13 applications. It supports both Pest PHP 4 and PHPUnit 12, automatically detecting your project's testing framework and providing syntax examples for both side-by-side. The skill covers 24 rules spanning HTTP endpoints, model factories, database assertions, service mocking, and authentication patterns to help you write fast, readable tests.

How do I choose between Pest PHP 4 and PHPUnit 12 for testing?

laravel-testing helps you evaluate both frameworks so you can make an informed choice. Pest PHP 4 offers expressive, readable syntax with describe/it blocks, while PHPUnit 12 provides traditional assertion methods. The skill provides side-by-side examples for both, letting you see how the same test looks in each framework and decide which aligns better with your team's preferences and project needs.

How to write tests in laravel with model factories and relationships?

laravel-testing covers creating model factories and test data with relationships. You define factories for your models, then use them in tests to generate realistic data with associated relationships. The skill shows you how to chain factory calls, set specific attributes, and create related records—enabling you to build complex test scenarios quickly without manual database setup.

How do I assert database state and HTTP responses in Laravel tests?

laravel-testing teaches you to verify both database state and HTTP responses. For database assertions, you use methods to check that records exist, were created, or were soft-deleted. For HTTP responses, you assert status codes, JSON structure, and response content. The skill covers both Pest and PHPUnit syntax, so you can confidently verify your application's behavior at the database and API levels.

Can laravel-testing help me mock Mail, Queue, and Events?

Yes. laravel-testing covers mocking and faking Laravel services including Mail, Queue, and Events. You learn how to prevent actual emails from sending during tests, assert that jobs were queued, and verify events were dispatched. The skill provides examples for both Pest PHP 4 and PHPUnit 12, letting you fake these services and focus on testing your application logic in isolation.

What testing patterns and organization does laravel-testing recommend?

laravel-testing guides you through test organization patterns, including how to structure feature and unit tests, use database transactions for isolation, and organize test datasets. It covers authentication testing for APIs (including Sanctum tokens), soft delete scenarios, and parameterized tests. The skill helps you build a maintainable test suite that scales with your Laravel 13 application.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

Laravel 13 Testing — Pest PHP 4 & PHPUnit 12

> Supports both Pest PHP 4 and PHPUnit 12. See Framework Detection below. > > PHPUnit version note: Laravel 13 ships with phpunit/phpunit: ^12.5.12 in its default composer.json. All patterns in this skill are compatible with PHPUnit 11, 12, and 13.

Comprehensive testing guide for Laravel 13 applications. Contains 24 rules across 6 categories for writing fast, readable, and reliable tests. Supports both Pest PHP 4 and PHPUnit 12 (Laravel 13 default).

Framework Detection

Before writing or reviewing any test code, detect which testing framework the project uses:

Step 1 — Check composer.json

```bash

Look for these in

(truncated - see the full file via the links below)

File tree — 15 files
skills/laravel-testing/AGENTS.md
skills/laravel-testing/README.md
skills/laravel-testing/SKILL.md
skills/laravel-testing/metadata.json
skills/laravel-testing/rules/auth-acting-as.md
skills/laravel-testing/rules/auth-sanctum.md
skills/laravel-testing/rules/db-assert-has.md
skills/laravel-testing/rules/db-assert-missing.md
skills/laravel-testing/rules/db-assert-soft-deletes.md
skills/laravel-testing/rules/factory-define.md
skills/laravel-testing/rules/factory-relationships.md
skills/laravel-testing/rules/factory-sequences.md
skills/laravel-testing/rules/factory-states.md
skills/laravel-testing/rules/fake-ai-agent.md
skills/laravel-testing/rules/fake-ai-data.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Write feature and unit tests for Laravel 13 applications”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

laravel-tdd
by affaan-m · affaan-m/ECC

Laravel-TDD guides you through test-driven development for Laravel applications, covering PHPUnit and Pest frameworks alongside model factories, HTTP controller testing, and Sanctum authentication verification. Learn the red-green-refactor cycle with practical examples for unit tests, feature tests, and JSON API testing, plus techniques for mocking external services and validating authorization.

MITupdated Jul 2026
★ 234,207repo stars
pest
by xobotyi · xobotyi/cc-foundry

Pest is a testing framework built on PHPUnit that replaces test classes with closures and assertion methods with a fluent expect() API. This skill covers test structure using test()/it()/describe(), the full expect() chain including modifiers and custom expectations, hooks for setup and teardown, datasets for parameterized testing, and advanced features like architecture rules and mutation testing.

MITupdated Jul 2026
★ 18repo stars
Pest Testing
by bagisto · bagisto/agent-skills

This skill teaches you to write and run Pest 3 tests across Bagisto's modular package structure. Learn to create unit and feature tests, use assertions and mocking, organize tests by package, and run specific test suites via command line.

no license declared → metadata onlyupdated Jul 2026
★ 11repo stars
laravel-tdd
by iSerter · iSerter/laravel-claude-agents

This skill guides you through TDD methodology tailored for Laravel development, using Pest PHP and Laravel's testing tools. Learn the red-green-refactor cycle with Laravel-specific patterns for controllers, models, authorization, APIs, and database operations. Apply TDD consistently across features and bugfixes to build reliable Laravel applications.

MITupdated Apr 2026
★ 41repo stars
laravel-database-optimization
by AsyrafHussin · AsyrafHussin/agent-skills

This skill provides 33 optimization rules across 9 categories for Laravel 13 applications, covering eager loading, indexing strategies, Redis caching, pagination, and transaction handling. Use it when writing Eloquent queries, diagnosing N+1 issues, configuring indexes, or debugging slow queries with Laravel Debugbar.

MITupdated May 2026
★ 58repo stars
php-expert
by personamanagmentlayer · personamanagmentlayer/pcl

PHP Expert provides in-depth instruction on PHP 8+ language features including union types, named arguments, match expressions, attributes, and enums. Learn Laravel framework patterns, Composer dependency management, and object-oriented design principles for building robust applications.

Apache-2.0updated Mar 2026
★ 38repo stars

More skills laravel-specialist (MIT) · pest-testing (MIT) · phpunit-skill (MIT) · Laravel Idioms (MIT) · laravel-specialist (MIT) · php-rules (Apache-2.0) · Hunt Laravel (NOASSERTION)

Tags
test-framework-selectionhttp-endpoint-testingfactory-data-generationassertion-patternsservice-mockingtest-structure-organizationapi-authentication-testingdatabase-state-verification