doctrine-fixtures-foundry
Installation
SKILL.md
Doctrine 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().