functional-tests — Claude Code skill: what it does, how to install
functional-tests guides Claude Code in writing functional Symfony tests using WebTestCase, KernelTestCase, loginUser, and DAMA rollback.
MIT ★ 234 updated 2026-10-05
npx skills add dev-toolings/superpowers-symfony --skill functional-tests -a claude-codeWhat functional-tests does
This skill enforces structured testing standards for Symfony HTTP routes and database-dependent services. It selects WebTestCase for controllers, invokes static::createClient() directly, inspects internal dependencies via static::getContainer(), and bypasses form-based logins by invoking $client->loginUser($user) directly.
Database state is kept isolated using DAMADoctrineTestBundle alongside Foundry fixtures. Mocking the EntityManager or repositories is explicitly prohibited when tests touch data, keeping assertions tied strictly to the actual database engine.
Keep in mind that .env.local is bypassed in test mode, so parameters belong in .env.test or .env.test.local. In addition, form validation failures expect HTTP 422 via assertResponseIsUnprocessable(), while assertSessionHasFlashMessage() requires Symfony 8.1 or higher.
What it helps with
- generate HTTP controller tests using WebTestCase and DOM assertions
- verify role-protected endpoints using loginUser
- isolate integration database state via DAMADoctrineTestBundle
- build parameterized smoke test suites for hardcoded application URLs
Example prompts for the agent
- Write a WebTestCase for the checkout endpoint that checks for a redirect and an email dispatch
- Create functional tests for the profile controller using loginUser and real database records
- Set up smoke tests with a data provider to verify status codes across public endpoints
How to install functional-tests
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill functional-tests -a claude-code2Manually: put the files in place
~/.claude/skills/functional-tests/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/functional-tests/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill functional-tests -a codex2Manually: put the files in place
.agents/skills/functional-tests/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill functional-tests -a cursor2Manually: put the files in place
.cursor/skills/functional-tests/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dev-toolings/superpowers-symfony content/skills/functional-tests2Manually: put the files in place
.github/skills/functional-tests/SKILL.md1Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill functional-tests -a gemini-cli2Platform CLI
gemini skills install https://github.com/dev-toolings/superpowers-symfony --path content/skills/functional-testsManually: put the files in place
.devin/skills/functional-tests/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about functional-tests
How to install functional-tests in Claude Code?
Run npx skills add dev-toolings/superpowers-symfony --skill functional-tests -a claude-code in your terminal.
What does the functional-tests skill do?
It equips the agent with guidelines to write Symfony functional tests, covering proper client setup, DOM checks, response validations, and transaction rollbacks.
Which environment files are supported during test runs?
The test runner ignores .env.local, requiring configuration parameters to be placed inside .env.test or .env.test.local.
Source text
SKILL.md · MIT
--- name: functional-tests description: Write functional tests for Symfony controllers and HTTP endpoints using WebTestCase, getContainer, loginUser, and DAMA rollback capabilities: [read, search, edit, shell] tags: [testing] # projected by `bun run build` — do not edit by hand allowed-tools: - Read - Glob - Grep - Write - Edit - Bash --- # Functional Tests (Symfony) ## Use when - A controller or HTTP endpoint must be checked through the kernel: status, redirect, rendered DOM, form errors, emails. - A repository or service must be tested against the real database with `KernelTestCase`. - An authenticated or role-restricted route needs coverage via `loginUser()`. - Key URLs need cheap smoke tests. ## Default workflow 1. Choose the base class: `WebTestCase` for HTTP, `KernelTestCase` for services, plain `TestCase` for pure logic. 2. Call `static::createClient()` directly (never `bootKernel()` first) and read private services with `static::getContainer()`. 3. Authenticate with `$client->loginUser($user)` instead of replaying the login form. 4. Assert the response and the DOM: `assertResponseIsSuccessful()`, `assertResponseRedirects()`, `assertSelectorTextContains()`, `assertEmailCount()`. 5. Isolate tests with the DAMADoctrineTestBundle `PHPUnitExtension`, plus Foundry reset for fixtures. 6. Add smoke tests with a data provider and hardcoded URLs. ## Guardrails - Use the real database and real repositories; do not mock the EntityManager or repositories in data-touching tests. - Invalid form submissions assert 422 with `assertResponseIsUnprocessable()` (Symfony 8.0+ behavior). - `.env.local` is not loaded in the test environment: use `.env.test` or `.env.test.local`. - `assertSessionHasFlashMessage()` requires Symfony 8.1+. ## Progressive disclosure - Use this file for execution posture and risk controls. - Open references when deep implementation details are needed. ## Output contract - Test classes with the base class chosen for each. - The authentication and database isolation strategy. - Status codes, DOM assertions and smoke URLs covered. ## References - `reference.md`
© dev-toolings · MIT · dev-toolings/superpowers-symfony