laravel-testing

laravel-testing is a skill for Claude Code, Codex from AsyrafHussin/agent-skills. It costs 62 tokens per session (1,881 once invoked), scanned A, original, MIT.

A testing guide for Laravel 13 applications using Pest PHP 4 or PHPUnit 12. It covers both unit tests, which check small pieces of code, and feature tests, which check complete application behavior such as HTTP requests and database operations.

In plain words
What is it for?
Use it when writing or reviewing Laravel tests involving requests, models, databases, authentication, mocking, or test organization. It detects whether the project uses Pest or PHPUnit before recommending syntax.
Why use it?
It helps developers choose the correct testing style for the framework already installed. It also provides patterns for readable, reliable, and fast Laravel tests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

not rated 75repo +2 14d ago A scan Socket: passSnyk: passSkillSpector: pass 62 tokens original MIT

Good fit Use it when writing or reviewing Laravel tests involving requests, models, databases, authentication, mocking, or test organization. It detects whether the project uses Pest or PHPUnit before recommending syntax.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/asyrafhussin/agent-skills/laravel-testing
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AsyrafHussin/agent-skills --skill laravel-testing
Clone the repo
git clone --depth 1 https://github.com/AsyrafHussin/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for laravel-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/laravel-testing/github.svg)](https://agentmods.dev/skills/asyrafhussin/agent-skills/laravel-testing)
Your own site
<a href="https://agentmods.dev/skills/asyrafhussin/agent-skills/laravel-testing"><img src="https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/laravel-testing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for laravel-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/asyrafhussin/agent-skills/laravel-testing"><img src="https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/laravel-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,881 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 17 Mar 2026
  • Snyk pass 17 Mar 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.01881
Opus 5 $0.00031 $0.00941
Sonnet 5 $0.00012 $0.00376
Haiku 4.5 $0.00006 $0.00188

Measured 11d ago against content hash 9be0e9cd0546, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

laravel-testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/laravel-testing/SKILL.md · 202 lines

How it starts

The opening of the file, as written. The whole thing — 202 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

# Look for these in require-dev:
# "pestphp/pest" → Pest
# "phpunit/phpunit" (without pest) → PHPUnit
  • If pestphp/pest is present → use Pest syntax
  • If only phpunit/phpunit is present → use PHPUnit syntax
  • If both are present → Pest takes priority (Pest runs on top of PHPUnit)

Step 2 — Check for tests/Pest.php

  • If tests/Pest.php exists → Pest is configured, use Pest syntax

Step 3 — If still unclear, ask the user

"I couldn't detect the testing framework. Does this project use Pest PHP or PHPUnit?"


Syntax Reference

Test Declaration

Pest PHPUnit
Test function test('...', fn() => ...) public function test_...(): void
Readable name it('...', fn() => ...) #[Test] public function it_...()
Grouping describe('...', fn() => ...) Test class name / nested classes
Trait application uses(RefreshDatabase::class) use RefreshDatabase; inside class
Before each beforeEach(fn() => ...) protected function setUp(): void
After each afterEach(fn() => ...) protected function tearDown(): void
Parameterised ->with([...]) #[DataProvider] attribute
Global setup uses(...)->in('Feature') in Pest.php Base TestCase class

Core assertions (identical in both frameworks)

Read the full file on GitHub · 202 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 202 lines · 62 tokens per session scan A 9be0e9cd0546

Subscribe to this mod's changes

laravel-testing is a skill published in the GitHub repository AsyrafHussin/agent-skills (75 stars, last pushed 14d ago), licensed MIT. It adds 62 tokens to every session and 1,881 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

working-effectively-with-legacy-code

Apply Michael Feathers-inspired legacy-code rules when changing hard-to-test code safely with characterization tests, seams, sprout methods, or wrap methods.

ciembor/agent-rules-books · 37 tokens

refactoring-guru

Apply Refactoring.Guru-inspired rules when diagnosing code smells, choosing refactoring techniques, and stopping cleanup before uncontrolled redesign.

ciembor/agent-rules-books · 29 tokens

refactoring

Apply Martin Fowler-inspired refactoring rules when improving existing code structure while preserving observable behavior.

ciembor/agent-rules-books · 20 tokens

craft-pest

Testing Craft CMS 5 plugins and modules with Pest — test isolation, database safety, and the markhuot/craft-pest-core harness. ALWAYS load when writing, running, fixing, or reviewing tests for a Craft plugin or module, and whenever a suite touches a real Craft install. Covers why rollback is opt-in, tests/Pest.php +…

michtio/craftcms-claude-skills · 353 tokens

phpunit-unit-test-reviewing

Internal sub-skill. Do not auto-activate. Use only when explicitly invoked by name by another skill or agent.

shopwareLabs/ai-coding-tools · 31 tokens

phpunit-unit-test-writing

Use this skill when the user asks to write, generate, create, or add PHPUnit unit tests for a Shopware 6 source class — phrases like "write unit tests for X", "generate tests for ClassName", "create PHPUnit tests", "add test coverage", "test this class", "cover this with tests", "I need tests for", "unit test this"…

shopwareLabs/ai-coding-tools · 187 tokens