phpunit
Skill2 starsChanged 6 days agoMITView on GitHub
Use when writing, reviewing, or migrating PHPUnit 9, 10, or 11 tests, resolving a project version, or choosing assertion, metadata, provider, mock, hook, runner, or coverage APIs. Not for PHPUnit 5/6/7-only suites, everyday assertion writing without a version decision, or Laravel routing. Output: selected version boundary, applicable reference, migration guidance, and verification evidence.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- turkeryildirim/ai-skillstheir own version, first seen Nov 1, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- G1Joshi/Agent-Skills★ 15same name
- turkeryildirim/ai-skills★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- change-verdictSkill
- code-simplifySkill
- code-traceSkill
- create-prSkill
- deploy-listSkill
- doc-maintainSkill
- feature-verifySkill
- flow-driveSkill
- flow-guideSkill
- git-smart-commitSkill
- git-worktreeSkill
- harness-setupSkill
- issue-analyzeSkill
- js-static-checksSkill
- laravelSkill
- legacy-characterization-testsSkill
- library-authorSkill
- merge-prepSkill
- module-designSkill
- nextjsSkill
- openspec-artifact-guardSkill
- opsx-apply-resumeSkill
- phpSkill
- precommitSkill
- project-auditSkill
- project-briefSkill
- proposal-analyzeSkill
- pr-summarySkill
- pythonSkill
- reactSkill
- release-creatorSkill
- repo-intakeSkill
- repo-verifySkill
- swiftSkill
- tdd-workflowSkill
- ui-ux-verifySkill
- vue-2-notesSkill
- yii1Skill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this family for PHPUnit 9, 10, and 11 work.
- Very specific: line 18
If the caller supplies 9, 10, or 11, use that selector without reading project files or dhpk manifests.
- Distinctive: line 23
If no supported major is detected, ask which version applies.
- Very specific: line 54
Use php for Laravel routing and general PHP runtime family selection.
- Distinctive: line 63
Keep setUp(), tearDown(), and static lifecycle methods compatible with the selected framework signature.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PHPUnit family — version router
Use this family for PHPUnit 9, 10, and 11 work. Resolve one version first, then read exactly that selector reference; conditional references keep unrelated version guidance out of context.
Resolution contract
- If the caller supplies 9, 10, or 11, use that selector without reading project files or dhpk manifests.
- Otherwise inspect the current project's composer.lock (installed phpunit/phpunit version) and then composer.json (require and require-dev). Select a single resolvable major.
- If no supported major is detected, ask which version applies. Do not guess, default to the newest reference, or use distribution/install manifests.
The family-local resolver and portable CLI implement this contract:
node scripts/resolve-version.js --json [--version 9|10|11]The JSON result reports status, family, selector, source, reference, loadedReferences, and the selected guidance. An unresolved result reports status "ask", no reference loaded, and an actionable question.
Version branches
- 9 — PHPUnit 8.5/9.x lifecycle signatures, assertions, providers, mocks, hooks, risky-test checks, and the complete API migration catalog: references/9.md.
- 10 — PHP 8.1 floor, attributes preferred while doc-comment metadata still works, runner/configuration changes, hooks, and the 9 → 10 checklist: references/10.md.
- 11 — PHP 8.2 floor, attribute-first migration, deprecated doc-comment metadata, typed overrides, discovery, and the 10 → 11 checklist: references/11.md.
The lifecycle authority is explicit: PHPUnit 10 supports attributes and still reads doc-comment metadata (attributes take precedence); PHPUnit 11 deprecates doc-comment metadata; PHPUnit 12 removes test annotations, while @codeCoverageIgnore, @codeCoverageIgnoreStart, and @codeCoverageIgnoreEnd remain supported.
When NOT to Use
- Use
phpfor Laravel routing and general PHP runtime family selection. - For PHPUnit 5, 6, or 7-only suites, use PHP 5.6-compatible test guidance instead of this modern family.
- For everyday assertion writing without a version decision, use focused test-design guidance rather than loading a version reference.
Shared test discipline
Keep setUp(), tearDown(), and static lifecycle methods compatible with the selected framework signature. Register expectException*() immediately before the throwing call, prefer strict assertIs*() assertions, use static named data providers, and default to createMock(). Treat every non-empty migration scan as an explicit TODO; enable strict risky-test checks without deleting meaningful assertions.
Output and verification
Return the selected version boundary, applicable reference, a focused migration or implementation recommendation, and evidence from the focused test and relevant suite. For migration work, list every remaining scan match as a TODO and state the PHP/PHPUnit floor. For a copied family directory, run the family-local CLI with NODE_PATH empty and an explicit selector.
The family-local scripts/resolve-version.js is the JSON CLI entrypoint. It
accepts an optional explicit selector and exits non-zero when resolution asks
for input or encounters an error. scripts/version-resolver.js is the
programmatic resolver used by the CLI and returns the selected reference,
loaded contents, or an ask result with no loaded references.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

