dev-toolings/superpowers-symfony109 installs
functional-tests
Write functional tests for Symfony controllers and HTTP endpoints using WebTestCase, getContainer, loginUser, and DAMA rollback
How do I install this agent skill?
npx skills add https://github.com/dev-toolings/superpowers-symfony --skill functional-testsIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides standard guidelines and implementation references for writing functional tests in Symfony applications. It covers well-known testing practices, environment configuration, and standard library usage without any detected security risks.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
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
- Choose the base class:
WebTestCasefor HTTP,KernelTestCasefor services, plainTestCasefor pure logic. - Call
static::createClient()directly (neverbootKernel()first) and read private services withstatic::getContainer(). - Authenticate with
$client->loginUser($user)instead of replaying the login form. - Assert the response and the DOM:
assertResponseIsSuccessful(),assertResponseRedirects(),assertSelectorTextContains(),assertEmailCount(). - Isolate tests with the DAMADoctrineTestBundle
PHPUnitExtension, plus Foundry reset for fixtures. - 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.localis not loaded in the test environment: use.env.testor.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
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/dev-toolings/superpowers-symfony/functional-tests">View functional-tests on skillZs</a>