phpunit-skill

phpunit-skill is a skill for Claude Code, Codex from LambdaTest/agent-skills. It costs 67 tokens per session (1,212 once invoked), scanned A, original, MIT.

A PHP testing helper for PHPUnit, the framework used to check PHP code automatically.

In plain words
What is it for?
Use it to generate PHPUnit tests with assertions, test data providers, mocks, and test doubles.
Why use it?
It gives developers established patterns for checking results and handling common test setup, instead of creating each test structure from scratch.

Skill for Claude CodeCodex

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

Good fit Use it to generate PHPUnit tests with assertions, test data providers, mocks, and test doubles.

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

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/lambdatest/agent-skills/phpunit-skill/github.svg)](https://agentmods.dev/skills/lambdatest/agent-skills/phpunit-skill)
Your own site
<a href="https://agentmods.dev/skills/lambdatest/agent-skills/phpunit-skill"><img src="https://agentmods.dev/badge/skills/lambdatest/agent-skills/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/lambdatest/agent-skills/phpunit-skill"><img src="https://agentmods.dev/badge/skills/lambdatest/agent-skills/phpunit-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,212 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00067 $0.01212
Opus 5.5 $0.00027 $0.00485
Sonnet 5.5 $0.00013 $0.00242
Haiku 4.5 $0.00007 $0.00121

Measured 3mo ago against content hash 8baa6d93c0d9, 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 3mo 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.

phpunit-skill/SKILL.md · 161 lines

How it starts

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

PHPUnit Testing Skill

Core Patterns

Basic Test

<?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));
    }
}

Data Providers

/**
 * @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 [
        'positive numbers' => [2, 3, 5],
        'negative numbers' => [-1, -1, -2],
        'zeros'            => [0, 0, 0],
        'mixed'            => [10, -5, 5],
    ];
}

Assertions

$this->assertEquals($expected, $actual);
$this->assertSame($expected, $actual);          // Strict type
$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);

Mocking

public function testCreateUser(): void
{
    $mockRepo = $this->createMock(UserRepository::class);
    $mockRepo->expects($this->once())
        ->method('save')
        ->with($this->isInstanceOf(User::class))
        ->willReturn(new User(1, 'Alice'));

    $mockEmail = $this->createMock(EmailService::class);
    $mockEmail->expects($this->once())
        ->method('sendWelcome')
        ->with('[email protected]');

    $service = new UserService($mockRepo, $mockEmail);
    $result = $service->createUser('[email protected]', 'Alice');

    $this->assertEquals(1, $result->getId());
}

Read the full file on GitHub · 161 lines

Files

What ships with it

2 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. 3mo ago First seen · 161 lines · 67 tokens per session scan A 8baa6d93c0d9

Subscribe to this mod's changes

phpunit-skill is a skill published in the GitHub repository LambdaTest/agent-skills (401 stars, last pushed 16d ago), licensed MIT. It adds 67 tokens to every session and 1,212 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-08-30.

Related

phpunit-skill compared with skills from other repositories

phpunit-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
phpunit-skillLambdaTest/agent-skillsSkill40116d agoMITA67Claude Code, Codex
rust-testingaffaan-m/ECCSkill316k2d agoMITA31Claude Code, Kiro
golang-testingaffaan-m/ECCSkill316k2d agoMITA37Claude Code, Kiro
java-affected-testsopen-metadata/OpenMetadataSkill16ktodayApache-2.0A120Claude Code
migrate-xunit-to-xunit-v3dotnet/skillsSkill6.4ktodayMITA149Claude Code
golang-testingsamber/cc-skills-golangSkill4.1k2d agoMITA115Claude Code
adk-setupgoogle/adk-pythonSkill23ktodayApache-2.0C146Claude Code, Codex