Skip to content
Development
Skill

/tdd-with-pest

Apply RED-GREEN-REFACTOR with Pest v4 (PHP 8.3+) for Symfony via the PHPUnit bridge; Foundry factories, WebTestCase, verify failures first

From plugin
superpowers-symfony
22744 skills14 agents13 commands1 hook

Claude Code

$ npx -y skills add dev-toolings/superpowers-symfony --skill tdd-with-pest --agent claude-code

SKILL.md

tdd-with-pest.SKILL.md
name: tdd-with-pest
description: Apply RED-GREEN-REFACTOR with Pest v4 (PHP 8.3+) for Symfony via the PHPUnit bridge; Foundry factories, WebTestCase, verify failures first
capabilities: [read, search, edit, shell]
tags: [testing, tdd]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep
  - Write
  - Edit
  - Bash

Tdd With Pest (Symfony)

Use when

  • Driving a feature with RED-GREEN-REFACTOR in a project that runs Pest v4 (PHP 8.3+).
  • Writing `it()` and `expect()` tests that need the Symfony kernel or an HTTP client.
  • Converting existing PHPUnit class tests to Pest syntax with `pest-plugin-drift`.
  • Adding a bug-reproducing test to a Pest suite before the fix.

Default workflow

1. Confirm PHP 8.3+ and Pest v4, then generate `tests/Pest.php` with `./vendor/bin/pest --init`. 2. Bind the bridge classes in `tests/Pest.php`: `uses(KernelTestCase::class, Factories::class, ResetDatabase::class)->in('Integration')` and `uses(WebTestCase::class, ...)->in('Functional')`. 3. RED: write an `it()` test with Foundry v2 factories, run `./vendor/bin/pest --filter` and check it fails for the right reason. 4. GREEN: write the minimal code, then REFACTOR and re-run `./vendor/bin/pest`. 5. Gate the suite with `--parallel` and `--coverage --min=80`.

Guardrails

  • There is no official Symfony Pest plugin: never reference `pestphp/pest-plugin-symfony`, bind `KernelTestCase` or `WebTestCase` through `uses()`.
  • Foundry v2 factories return real objects: no `->object()` call.
  • Pest test files are anonymous, so use the `Factories` and `ResetDatabase` traits rather than the `#[ResetDatabase]` attribute.
  • Chain related checks with `expect()->and()`; keep one concept per test.

Progressive disclosure

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

Output contract

  • The failing `./vendor/bin/pest` output (RED), then the passing run.
  • `tests/Pest.php` bindings added or changed.
  • Test files changed and the commands executed.

References

  • `reference.md`
Read more
@dev-toolings
Ships withsuperpowers-symfony

Superpowers Symfony gives coding agents deep, version-accurate Symfony expertise: from Doctrine schema design and API Platform REST/GraphQL APIs to test-driven development, async Messenger workflows, caching, rate limiting, and clean architecture.

22744 skills14 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
227
Star history of dev-toolings/superpowers-symfony on GitHub, a chart by star-history.com

Other skills on superpowers-symfony.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about tdd-with-pest.

Which coding agents can use tdd-with-pest?
tdd-with-pest installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.