Foundry
PHP library that builds model factories and on-demand fixtures for Symfony and Doctrine, used in tests and dev environments.
Foundry is a PHP library for creating test and development data with factory classes. A factory creates and persists an object, and any field the caller does not set gets random data. Stories extract a specific database state so tests and dev fixtures can reuse it, and the foundry:load-fixtures command loads stories marked with the AsFixture attribute into a database, mainly in dev mode. The README says it supports doctrine/orm and doctrine/mongodb-odm, alone or combined. The documentation also covers a PHPUnit extension and factories declared as services.
Worth knowing
The docs say the library requires the database to be reset before each test, which the packaged ResetDatabase attribute handles. Without Symfony Flex, the bundle has to be enabled by hand in the test and dev environments, and the make:* commands need Symfony MakerBundle. The Behat integration is a separate package that the docs call experimental.
Identity
Rendering and deploy
Releases
Adoption
Sources
- 2026-11-17: links, Written in, License, GitHub stars
api.github.com/repos/zenstruck/foundry - 2026-11-17: links, Runs as, Install with
symfony.com/bundles/ZenstruckFoundryBundle/current/index.html - 2026-11-17: Maintainer, License model
github.com/zenstruck/foundry/blob/2.x/LICENSE - 2026-11-17: First release
api.github.com/repos/zenstruck/foundry/releases/tags/v1.0.0 - 2026-11-17: Categories, Built on
github.com/zenstruck/foundry/blob/2.x/README.md - 2026-11-17: Runtime, Minimum runtime
github.com/zenstruck/foundry/blob/v2.16.0/composer.json - 2026-11-17: Current major version, Last release
github.com/zenstruck/foundry/releases/tag/v2.16.0 - 2026-11-17: Packagist downloads
packagist.org/packages/zenstruck/foundry.json - 2026-11-17: Contributors
api.github.com/repos/zenstruck/foundry/contributors?per_page=1