FindSoftware

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

Status
Active
Maintainer
Kevin Bond3
First release
20204

Rendering and deploy

Runs as
Dev only2
Install with
composer2

Releases

Current major version
27
Last release
2026-11-097

Adoption

GitHub stars
8051
Packagist downloads
17,207,8978
Contributors
879

Why these figures do not compare

Sources

  1. 2026-11-17: links, Written in, License, GitHub stars
    api.github.com/repos/zenstruck/foundry
  2. 2026-11-17: links, Runs as, Install with
    symfony.com/bundles/ZenstruckFoundryBundle/current/index.html
  3. 2026-11-17: Maintainer, License model
    github.com/zenstruck/foundry/blob/2.x/LICENSE
  4. 2026-11-17: First release
    api.github.com/repos/zenstruck/foundry/releases/tags/v1.0.0
  5. 2026-11-17: Categories, Built on
    github.com/zenstruck/foundry/blob/2.x/README.md
  6. 2026-11-17: Runtime, Minimum runtime
    github.com/zenstruck/foundry/blob/v2.16.0/composer.json
  7. 2026-11-17: Current major version, Last release
    github.com/zenstruck/foundry/releases/tag/v2.16.0
  8. 2026-11-17: Packagist downloads
    packagist.org/packages/zenstruck/foundry.json
  9. 2026-11-17: Contributors
    api.github.com/repos/zenstruck/foundry/contributors?per_page=1

Last reviewed · Listed since Edit on GitHubThis page as markdownas JSON