D
doctrine-fixtures-foundry
About doctrine-fixtures-foundry
A Symfony skill for creating Doctrine Fixtures Foundry factories, states, stories, and test data. It guides test and development setup, including Foundry v1-to-v2 migrations and database reset practices.
Key features
- 01Entity factories with minimal defaults
- 02Immutable named states and relations
- 03Shared scenarios with stories
- 04Foundry v1-to-v2 migration guidance
Use cases
- 01Create related entities for tests
- 02Seed repeatable development data
- 03Migrate legacy Foundry factories
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ dev-toolings/ superpowers-symfony --skill doctrine-fixtures-foundryAfter installing, type/doctrine-fixtures-foundryin Claude Code to confirm it loaded.
Bundled filesreference.md
Details
From the project READMEDoctrine Fixtures Foundry (Symfony)
Use when
- Creating test or development data for Doctrine entities.
- Writing a Foundry factory, a named state, a sequence, or a story.
- Building related entities for a test without hand-written setup.
- Migrating legacy Foundry v1 factories or
->object()calls to v2.
Default workflow
- Generate a factory per entity and keep
defaults()to required and unique fields. - Express each variation as an immutable named state (
admin(),published()). - Let factories create default relations with
OtherFactory::new(). - Group shared scenarios in stories, and reset the database per test class.
- Assert on real objects and on the repository through
Factory::assert().
Guardrails
- Use
self::faker()->unique()for every unique column, or tests collide. - Do not call
->object()or->_real(): v2 factories return real objects. - Seed Faker (
FOUNDRY_FAKER_SEED) when a failure must be reproducible. - Do not build a factory for trivial data a test can create inline.
Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.
Output contract
- Factories with minimal defaults, named states and relation defaults.
- Stories for shared scenarios, when more than one test needs them.
- Test setup wired with the Foundry extension and
#[ResetDatabase].
References
reference.md
Comments
Markdown supported