MCPInstall

tdd-with-phpunit

Apply RED-GREEN-REFACTOR with PHPUnit 10/11 for Symfony; KernelTestCase/WebTestCase, attributes ([Test]/[DataProvider]), Foundry

Installs
99
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/dev-toolings/superpowers-symfony --skill tdd-with-phpunit
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads tdd-with-phpunit automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Tdd With Phpunit (Symfony)

Use when

  • Driving a feature with RED-GREEN-REFACTOR using PHPUnit 10/11 class-based tests.
  • Choosing between TestCase, KernelTestCase and WebTestCase for a new behavior.
  • Testing a console command, or an invalid form that must answer 422.
  • Swapping an external service for a double through the test container.

Default workflow

  1. RED: pick the base class, write the test with #[Test], #[DataProvider] and #[CoversClass], run it and check it fails for the right reason.
  2. GREEN: write the minimum code that passes.
  3. REFACTOR with the suite green, re-running it after each change.
  4. Replace an external boundary with static::getContainer()->set(Service::class, $mock).
  5. Test commands with CommandTester, or with runCommand() and assertCommandIsSuccessful() on Symfony 8.1+.
  6. Assert invalid form submissions with assertResponseIsUnprocessable().

Guardrails

  • Use PHPUnit 10+ attributes, not @test or @dataProvider annotations.
  • Fetch services with static::getContainer(), not the legacy self::$container.
  • Mock only true external boundaries (HTTP clients, third-party SDKs); keep real services and a real database elsewhere.
  • runCommand() and closures in getContainer()->set() need Symfony 8.1+.

Progressive disclosure

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

Output contract

  • The failing PHPUnit output (RED), then the passing run.
  • Test files changed, with the base class and attributes used.
  • Commands executed.

References

  • reference.md

FAQ

What does the tdd-with-phpunit skill do?

Apply RED-GREEN-REFACTOR with PHPUnit 10/11 for Symfony; KernelTestCase/WebTestCase, attributes ([Test]/[DataProvider]), Foundry

How do I install tdd-with-phpunit?

Run npx skills add https://github.com/dev-toolings/superpowers-symfony --skill tdd-with-phpunit in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/tdd-with-phpunit/ (personal) or .claude/skills/tdd-with-phpunit/ (project).

Which AI agents can use tdd-with-phpunit?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is tdd-with-phpunit safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains tdd-with-phpunit?

It is published by dev-toolings in dev-toolings/superpowers-symfony. It has 99 recorded installs.

More from dev-toolings/superpowers-symfony

View all →

symfony:interfaces-and-autowiring

dev-toolings/superpowers-symfony

Master Symfony Dependency Injection with autowiring,

Security708 installs

symfony:controller-cleanup

dev-toolings/superpowers-symfony

Refactor fat controllers into lean ones by extracting business logic to services, handlers, and invokable commands

symfony:doctrine-migrations

dev-toolings/superpowers-symfony

Create and manage Doctrine migrations (lib 4.x) for schema versioning; handle dependencies, rollbacks, and production deployment

DevOps & Cloud641 installs

symfony:tdd-with-phpunit

dev-toolings/superpowers-symfony

Apply RED-GREEN-REFACTOR with PHPUnit 10/11 for Symfony; KernelTestCase/WebTestCase, attributes ([Test]/[DataProvider]), Foundry

Testing & QA634 installs

symfony:quality-checks

dev-toolings/superpowers-symfony

Run code quality tools: PHP-CS-Fixer for style, PHPStan for static analysis, and type safety checks

Backend & APIs622 installs

symfony:doctrine-relations

dev-toolings/superpowers-symfony

Define Doctrine entity relationships (OneToMany, ManyToMany, ManyToOne); configure cascade, orphan removal, multiple entity managers; prevent N+1 queries

612 installs

Popular testing & qa skills

View category →

tdd

mattpocock/skills

Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

Testing & QA1.2M installs

grilling

mattpocock/skills

Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

Testing & QA996.2K installs

migrate-to-shoehorn

mattpocock/skills

Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.

Testing & QA484.1K installs

run-train

lllllllama/rigorpilot-skills

Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.

Testing & QA337.8K installs

test-driven-development

obra/superpowers

Use when implementing any feature or bugfix, before writing implementation code

Testing & QA261.8K installs

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

Testing & QA216.8K installs