skills/php-testing/SKILL.md
PHP testing patterns: PHPUnit, test doubles, database testing.
npx skillsauth add notque/claude-code-toolkit php-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Apply PHPUnit testing patterns for PHP projects: unit tests with data providers, test doubles (stubs, mocks, Prophecy), database testing (Laravel/Symfony), HTTP testing, and coverage configuration.
See
references/patterns.mdfor full code examples, the anti-patterns table, and the commands reference.
| Signal | Load These Files | Why |
|---|---|---|
| implementation patterns | patterns.md | Loads detailed guidance from patterns.md. |
Determine what needs testing:
TestCase with test prefix or @test annotation@dataProvider static methodsDatabaseTransactions (Laravel) or KernelTestCase (Symfony)WebTestCaseWrite tests following these rules:
parent::setUp() first in every setUp() methodassertSame() instead of assertTrue($a === $b) for meaningful failure messages@depends chains@dataProvider rather than duplicating test methodsFor test doubles: use createStub() when you only need return values, createMock() when asserting method calls, and Prophecy (phpspec/prophecy-phpunit) for more expressive interaction assertions.
For database tests: use DatabaseTransactions (Laravel) or DoctrineTestBundle (Symfony) to roll back state after each test.
Run the test suite and confirm all tests pass:
./vendor/bin/phpunit
For coverage enforcement:
XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text --coverage-min=80
GATE: All tests pass. Coverage threshold met if configured. No anti-patterns from references/patterns.md introduced.
documentation
Document translation: quick/normal/refined modes with chunked parallel subagents and glossary support.
development
AI image generation: Gemini and Nano Banana backends; single/series/batch workflows with prompt-to-disk.
testing
Unified voice content generation pipeline with mandatory validation and joy-check. 13-phase pipeline: LOAD, GROUND, STATS-CHECKPOINT, GENERATE, HOOK-GATE, VALIDATE, REFINE, VARIETY-GATE, JOY-CHECK, ANTI-AI, CLOSE-GATE, OUTPUT, CLEANUP. Use when writing articles, blog posts, or any content that uses a voice profile. Use for "write article", "blog post", "write in voice", "generate content", "draft article", "write about".
documentation
Critique-and-rewrite loop for voice fidelity validation.