Laravel testing

From HoangNguyen0403/agent-skills-standard · View interactive version

Laravel testing is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Write Pest feature tests with RefreshDatabase, mock external services, and create test data with Eloquent Factories in Laravel. Use when adding HTTP tests, configuring SQLite in-memory test database, or mocking payment services.

How to use this skill

Skill file

Laravel Testing

**Priority: P1 (HIGH)**

Universal anti-slop rules (identity fixtures, tautologies, skip/focus, mock echoing, bug-first lock, sleeps, shallow

assertions, coverage): anti-slop-rules.md. Only Laravel deltas

follow.

Stack Deltas

it('creates a post', fn() => $this->postJson('/api/posts', [...])); the database rolled back after each test.

shouldReceive('charge')->once()->with(100); use $this->spy() for loose verification; never make real network calls.

phpunit.xml, set <env name='DB_CONNECTION' value='sqlite'/> and <env name='DB_DATABASE' value=':memory:'/>.

and assertHeader; never assert status alone.

Anti-Patterns

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.