Agent skill
Laravel Testing
Automated testing standards with Pest and PHPUnit.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/testing-hoangnguyen0403-agent-skills-standar-10
Metadata
Additional technical details for this skill
- labels
-
laravel testing pest phpunit tdd
- triggers
-
{ "files": [ "tests/**/*.php", "phpunit.xml" ], "keywords": [ "feature", "unit", "mock", "factory", "sqlite" ] }
SKILL.md
Laravel Testing
Priority: P1 (HIGH)
Structure
tests/
├── Feature/ # Integration/HTTP tests
├── Unit/ # Isolated logic tests
└── TestCase.php
Implementation Guidelines
- Framework: Use Pest for modern DX or PHPUnit for legacy parity.
- Fresh Context: Use
RefreshDatabasetrait for data isolation. - Factories: Create test data via Eloquent Factories.
- Mockery: Use
$this->mock()for external service substitution. - In-Memory: Use SQLite
:memory:for high-speed unit tests. - HTTP Assertions: Use
$response->assertStatus()andassertJson().
Anti-Patterns
- Real APIs: No real network calls: Always mock or stub.
- Global State: No state leakage: Refresh DB between tests.
- Manual Insert: No DB::table()->insert(): Use Factories.
- Slow Logic: No heavy unit tests: Move to Feature tests.
References
- Testing & Mocking Guide
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?