phpunit-skill

phpunit-skill is a skill for Claude Code, Codex from XCode-NLP/KodaSkills. It costs 73 tokens per session (1,068 once invoked), scanned A, original, MIT.

A guide to writing PHPUnit tests for PHP code. PHPUnit is a testing tool for PHP that provides test cases, checks, test data providers, mocks, and error assertions.

In plain words
What is it for?
Use it to write unit tests, supply multiple test inputs, check exceptions and results, and use test doubles in PHP projects.
Why use it?
It gives standard patterns for checking code and handling expected errors, reducing guesswork when setting up or fixing PHP tests. It also covers common test lifecycle and configuration issues.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to write unit tests, supply multiple test inputs, check exceptions and results, and use test doubles in PHP projects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xcode-nlp/kodaskills/phpunit-skill
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 XCode-NLP/KodaSkills --skill phpunit-skill
Clone the repo
git clone --depth 1 https://github.com/XCode-NLP/KodaSkills

Made for: Claude Code, Codex.

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-skill

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/xcode-nlp/kodaskills/phpunit-skill"><img src="https://agentmods.dev/badge/skills/xcode-nlp/kodaskills/phpunit-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,068 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.00073 $0.01068
Opus 5.5 $0.00029 $0.00427
Sonnet 5.5 $0.00015 $0.00214
Haiku 4.5 $0.00007 $0.00107

Measured 11d ago against content hash 05e68c931600, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

phpunit-skill 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 11d ago.

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.

skills/phpunit-skill/SKILL.md · 138 lines

How it starts

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

Тестирование на PHPUnit

Основные шаблоны

Базовый тест

<?php
use PHPUnit\Framework\TestCase;

class CalculatorTest extends TestCase
{
    private Calculator $calculator;

    protected function setUp(): void
    {
        $this->calculator = new Calculator();
    }

    public function testAddition(): void
    {
        $this->assertEquals(5, $this->calculator->add(2, 3));
    }

    public function testDivideByZero(): void
    {
        $this->expectException(\DivisionByZeroError::class);
        $this->calculator->divide(10, 0);
    }

    public function testMultipleAssertions(): void
    {
        $this->assertSame(4, $this->calculator->add(2, 2));
        $this->assertSame(0, $this->calculator->subtract(2, 2));
        $this->assertSame(6, $this->calculator->multiply(2, 3));
    }
}

Поставщики данных

/**
 * @dataProvider additionProvider
 */
public function testAdd(int $a, int $b, int $expected): void
{
    $this->assertEquals($expected, $this->calculator->add($a, $b));
}

public static function additionProvider(): array
{
    return [
        'положительные числа' => [2, 3, 5],
        'отрицательные числа' => [-1, -1, -2],
        'нули'                => [0, 0, 0],
        'смешанные'           => [10, -5, 5],
    ];
}

Утверждения

$this->assertEquals($expected, $actual);
$this->assertSame($expected, $actual);          // строгое сравнение типов
$this->assertNotEquals($unexpected, $actual);
$this->assertTrue($condition);
$this->assertFalse($condition);
$this->assertNull($value);
$this->assertNotNull($value);
$this->assertCount(3, $array);
$this->assertContains('item', $array);
$this->assertArrayHasKey('key', $array);
$this->assertInstanceOf(MyClass::class, $obj);
$this->assertStringContainsString('sub', $string);
$this->assertMatchesRegularExpression('/\d+/', $string);
$this->assertEmpty($collection);
$this->assertGreaterThan(5, $value);
$this->assertJsonStringEqualsJsonString($expected, $actual);

Моки

Read the full file on GitHub · 138 lines

Files

What ships with it

1 file 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. 11d ago First seen · 138 lines · 73 tokens per session scan A 05e68c931600

Subscribe to this mod's changes

phpunit-skill is a skill published in the GitHub repository XCode-NLP/KodaSkills (27 stars, last pushed 5d ago), licensed MIT. It adds 73 tokens to every session and 1,068 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-11-19.

Related

phpunit-skill compared with skills from other repositories

phpunit-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
phpunit-skillXCode-NLP/KodaSkillsSkill275d agoMITA73Claude Code, Codex
laravel-testingFoysal50x/skillsSkill121mo agoMITA83Claude Code
migrate-xunit-to-xunit-v3managedcode/dotnet-skillsSkill52716d agoMITA149Claude Code, Codex
test-harnessMathews-Tom/armorySkill3455d agoMITA65Claude Code
mvc-expertroedyrustam/vibes-plugSkill1293d agoMITA30Cursor
laravel-testingAsyrafHussin/agent-skillsSkill111todayMITA62Claude Code, Codex
Codeception TestingPramodDutta/qaskillsSkill25227d agoMITA42Claude Code, Codex