Agent skill

Test Doubles Mocking

by dev-toolings in dev-toolings/superpowers-symfony

Create test doubles with PHPUnit mocks for isolated unit testing in Symfony

MITAuto-check passedTesting & QA

Install Test Doubles Mocking

skills CLI
$ npx skills add dev-toolings/superpowers-symfony --skill test-doubles-mocking -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dev-toolings/superpowers-symfony test-doubles-mocking --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dev-toolings/superpowers-symfony.git skills-src && mkdir -p .claude/skills && cp -r skills-src/content/skills/test-doubles-mocking .claude/skills/test-doubles-mocking && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-doubles-mocking
GitHub stars
222
Token cost
~501 tokens
SKILL.md length
234 words
Files
2
Skills in repo
44
Repo updated
First seen
Licence
MIT

At a glance

Create test doubles with PHPUnit mocks for isolated unit testing in Symfony

  • Works in 6 steps: Pick the double by need: stub to feed… → Create it with… → Verify only when the interaction… → …
  • Tasks that involve Unit testing
  • SKILL.md covers Use when, Default workflow, Guardrails and Progressive disclosure, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Test Doubles Mocking is an agent skill from dev-toolings/superpowers-symfony. Create test doubles with PHPUnit mocks for isolated unit testing in Symfony

Its SKILL.md is about 500 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `reference.md`).

It sits in Testing & QA, covering Unit testing. It works with Symfony. The repository describes itself as: Claude Code plugin for Symfony 7.4 LTS & 8.x — 44 skills, 7 AI subagents & 13 commands for API Platform v4, Doctrine ORM 3, TDD (Pest/PHPUnit), Messenger, security & DDD. The licence is MIT.

When your agent uses it

  • Tasks that involve Unit testing

Example prompts

  • “/test-doubles-mocking”

Requirements

  • Pre-approved tools (allowed-tools): Read, Glob, Grep

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Pick the double by need: stub to feed values, mock to verify a call, fake for a working simplified implementation.
  2. Create it with $this->createMock(Interface::class) and stub with ->method('charge')->willReturn(...).
  3. Verify only when the interaction matters: expects($this->once())->with(...), or $this->callback() to inspect a dispatched message.
  4. Script behavior with willReturnOnConsecutiveCalls(), willThrowException() or willReturnCallback().
  5. For repositories, write an InMemory fake implementing the interface.
  6. Use ProphecyTrait with prophesize() and reveal() only if the project already relies on Prophecy.

What it can do on your machine

Read from SKILL.md and the folder at commit 459bcd0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Doubles Mocking loads about 501 tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 234 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~24
When it runs · the whole SKILL.md, loaded when a task matches
~501

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dev-toolings/superpowers-symfony at commit 459bcd0, republished under its MIT licence (© dev-toolings). 234 words, ~501 tokens.

Download SKILL.mdSave it as .claude/skills/test-doubles-mocking/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
test-doubles-mocking
description
Create test doubles with PHPUnit mocks for isolated unit testing in Symfony
allowed-tools
Read, Glob, Grep
capabilities
read, search
tags
testing

Test Doubles Mocking (Symfony)

Use when

  • A class under test depends on a collaborator that is slow, external or non-deterministic, such as a payment gateway or a message bus.
  • An interaction must be verified, such as persist() and flush() or a dispatched message.
  • A repository needs an in-memory fake implementing its interface.
  • Choosing between a dummy, stub, mock, spy or fake.

Default workflow

  1. Pick the double by need: stub to feed values, mock to verify a call, fake for a working simplified implementation.
  2. Create it with $this->createMock(Interface::class) and stub with ->method('charge')->willReturn(...).
  3. Verify only when the interaction matters: expects($this->once())->with(...), or $this->callback() to inspect a dispatched message.
  4. Script behavior with willReturnOnConsecutiveCalls(), willThrowException() or willReturnCallback().
  5. For repositories, write an InMemory fake implementing the interface.
  6. Use ProphecyTrait with prophesize() and reveal() only if the project already relies on Prophecy.

Guardrails

  • Do not mock the class under test; a partial mock (onlyMethods()) is a last resort.
  • Mock interfaces, not concrete classes.
  • Prefer stubs over mocks, with one mock assertion per test.
  • Do not over-mock: behavior that touches the database belongs in a functional test with the real repository.

Progressive disclosure

  • Use this file for execution posture and risk controls.
  • Open references when deep implementation details are needed.

Output contract

  • The double type chosen for each collaborator, and why.
  • Interactions verified, limited to those that matter.
  • Fakes added under tests/Fake, if any.

References

  • reference.md

© dev-toolings, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in content/skills/test-doubles-mocking of dev-toolings/superpowers-symfony.

  • SKILL.md
  • reference.md

Open the folder on GitHubat commit 459bcd0

Compare with similar skills

Test Doubles Mocking next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Doubles Mocking compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Doubles Mocking this skilldev-toolings/superpowers-symfony222—~501Automated safety check: PassMIT
PHP ProJeffallan/claude-skills12k—~1.6kAutomated safety check: NotesMIT
Jest Testing PatternsChrisWiles/claude-code-showcase6.1k7 repos~1.5kAutomated safety check: PassNone
Rust TDD Workflowrtk-ai/rtk83k—~753Automated safety check: NotesApache-2.0
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
Adk Verify Snippetsgoogle/adk-python22k—~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • PHP Pro

    Jeffallan/claude-skills

    Writes strictly typed modern PHP 8.3+ for Laravel, Symfony and plain projects, with PHPStan level 9, PHPUnit or Pest tests, typed DTOs and secure defaults.

    12k GitHub stars~1.6k tokensUpdated 4 days ago
    Backend & APIsAuto-check: notes
  • Jest Testing Patterns

    ChrisWiles/claude-code-showcase

    Jest patterns for React Native style tests: TDD discipline, mock factory functions, module and GraphQL hook mocking, custom render helpers and anti-patterns to avoid.

    6.1k GitHub starsUsed in 7 repos~1.5k tokens
    Testing & QAAuto-check passed
  • Enforces red-green-refactor for Rust work, with idiomatic test patterns, a naming convention and a pre-commit gate of cargo fmt, clippy and test.

    83k GitHub stars~753 tokensUpdated today
    Testing & QAAuto-check: notes
  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Adk Verify Snippets

    google/adk-python

    Official

    Checks that every Python code block in a Markdown file actually compiles and runs, by extracting each block to a temporary file, executing it in an isolated subprocess, and writing a pass/fail…

    22k GitHub stars~1.4k tokensUpdated today
    Testing & QAAuto-check passed
  • Enforces red-green-refactor for new RTK output filters in Rust, using real captured fixtures, snapshot tests with insta and token-savings assertions.

    83k GitHub stars~1.9k tokensUpdated today
    Testing & QAAuto-check: notes

More from dev-toolings/superpowers-symfony

All 44 skills in this repo
  • Symfony Scheduler

    dev-toolings/superpowers-symfony

    Schedule recurring tasks with the Symfony Scheduler component (native since 7.x); define schedules, triggers, and integrate with Messenger

    222 GitHub stars~526 tokensUpdated 2 days ago
    Auto-check: notes
  • API Platform Dto Resources

    dev-toolings/superpowers-symfony

    Map entities to API DTOs in API Platform (v5, 4.4, 4.3) with the Symfony Object Mapper ([Map], stateOptions) for decoupled input/output contracts

    222 GitHub stars~593 tokensUpdated 2 days ago
    Auto-check: notes
  • API Platform Filters

    dev-toolings/superpowers-symfony

    Implement API Platform filters - Parameters API (QueryParameter, v5/4.4/4.3) and the [ApiFilter] attribute deprecated since 4.4 - for search, date, range, boolean, and custom filtering

    222 GitHub stars~610 tokensUpdated 2 days ago
    Auto-check: notes
  • API Platform Resources

    dev-toolings/superpowers-symfony

    Configure API Platform resources (v5, 4.4, 4.3) with explicit operations, pagination, and typed OpenAPI for clean, versioned REST/GraphQL APIs

    222 GitHub stars~560 tokensUpdated 2 days ago
    Auto-check: notes
  • API Platform Security

    dev-toolings/superpowers-symfony

    Secure API Platform resources with security expressions, voters, securityPostValidation, and operation-level access control

    222 GitHub stars~551 tokensUpdated 2 days ago
    Auto-check: notes
  • API Platform Serialization

    dev-toolings/superpowers-symfony

    Control API Platform serialization with groups, [Context], IRI links (readableLink/writableLink), and custom context builders

    222 GitHub stars~519 tokensUpdated 2 days ago
    Auto-check: notes

Works with

Categories

Questions about Test Doubles Mocking

What does Test Doubles Mocking do?

Create test doubles with PHPUnit mocks for isolated unit testing in Symfony. Test Doubles Mocking is an agent skill from dev-toolings/superpowers-symfony.

When should I use Test Doubles Mocking?

Test Doubles Mocking fits situations like: tasks that involve Unit testing.

How do I install Test Doubles Mocking in Claude Code?

Run `npx skills add dev-toolings/superpowers-symfony --skill test-doubles-mocking -a claude-code`. Or copy the skill folder (content/skills/test-doubles-mocking in dev-toolings/superpowers-symfony) into .claude/skills/test-doubles-mocking in your project. Claude Code loads it when a task matches its description.

How do I install Test Doubles Mocking in Codex?

Run `npx skills add dev-toolings/superpowers-symfony --skill test-doubles-mocking -a codex`. Or copy the skill folder (content/skills/test-doubles-mocking in dev-toolings/superpowers-symfony) into .agents/skills/test-doubles-mocking in your project. Codex loads it when a task matches its description.

Can I use Test Doubles Mocking in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dev-toolings/superpowers-symfony --skill test-doubles-mocking -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-doubles-mocking, .gemini/skills/test-doubles-mocking, .github/skills/test-doubles-mocking and .opencode/skills/test-doubles-mocking in your project.

What does Test Doubles Mocking need to run?

SKILL.md names no scripts, command-line tools or credentials: Test Doubles Mocking is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Glob, Grep.

Does Test Doubles Mocking access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Test Doubles Mocking safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Test Doubles Mocking use?

Test Doubles Mocking is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Doubles Mocking use?

About 501 tokens (SKILL.md is roughly 2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Doubles Mocking?

Skills that share tags, products or a category with Test Doubles Mocking: PHP Pro (Jeffallan/claude-skills, 12k stars), Jest Testing Patterns (ChrisWiles/claude-code-showcase, 6.1k stars), Rust TDD Workflow (rtk-ai/rtk, 83k stars) and Test Writing Workflow (iOfficeAI/AionUi, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Doubles Mocking?

dev-toolings (a GitHub organization) maintains it in dev-toolings/superpowers-symfony, which has 222 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on October 5, 2026.

Source: dev-toolings/superpowers-symfony on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.