phpunit

phpunit is a skill for Claude Code, Codex from hmj1026/dhpk. It costs 86 tokens per session (855 once invoked), scanned A, original, MIT.

A guide for PHPUnit, a PHP testing framework, covering versions 9, 10, and 11. It selects the correct guidance by checking the project's installed or declared PHPUnit version instead of guessing.

In plain words
What is it for?
Use it when writing, reviewing, or migrating PHPUnit tests, or when choosing assertions, test metadata, mocks, hooks, runners, and coverage APIs.
Why use it?
PHPUnit APIs differ between major versions, so choosing the wrong guidance can lead to invalid tests or migration errors.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the dhpk plugin — 39 skills, 1 command, 1 agent, 3 hooks shipped together

Good fit Use it when writing, reviewing, or migrating PHPUnit tests, or when choosing assertions, test metadata, mocks, hooks, runners, and coverage APIs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hmj1026/dhpk/phpunit
View source ↗ hmj1026/dhpk
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 hmj1026/dhpk --skill phpunit
Clone the repo
git clone --depth 1 https://github.com/hmj1026/dhpk

Made for: Claude Code, Codex.

Or install dhpk, the plugin that ships this one along with the rest of its 39 skills, 1 command, 1 agent, 3 hooks.

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 phpunit

README.md
[![agentmods](https://agentmods.dev/badge/skills/hmj1026/dhpk/phpunit/github.svg)](https://agentmods.dev/skills/hmj1026/dhpk/phpunit)
Your own site
<a href="https://agentmods.dev/skills/hmj1026/dhpk/phpunit"><img src="https://agentmods.dev/badge/skills/hmj1026/dhpk/phpunit/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 phpunit

Your own site · 80×15
<a href="https://agentmods.dev/skills/hmj1026/dhpk/phpunit"><img src="https://agentmods.dev/badge/skills/hmj1026/dhpk/phpunit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 855 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.
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.00086 $0.00855
Opus 5.5 $0.00034 $0.00342
Sonnet 5.5 $0.00017 $0.00171
Haiku 4.5 $0.00009 $0.00085

Measured yesterday against content hash d7ae1450b520, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

phpunit 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 yesterday.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/resolve-version.js, scripts/version-resolver.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

generated/claude-marketplace/package/modules/phpunit-10/skills/phpunit/SKILL.md · 83 lines

How it starts

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

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

  1. If the caller supplies 9, 10, or 11, use that selector without reading project files or dhpk manifests.
  2. 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.
  3. 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 php for 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.

Read the full file on GitHub · 83 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday Changed · +2 lines d7ae1450b520
  2. 1mo ago First seen · 81 lines · 86 tokens per session scan A 6f60b9a48ce1

Subscribe to this mod's changes

phpunit is a skill published in the GitHub repository hmj1026/dhpk (2 stars, last pushed today), licensed MIT. It adds 86 tokens to every session and 855 once invoked, about $0.0003 per session on Opus 5.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-09-05.