Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PHP
  3. Foundry

Foundry

MITPHPv2.9.2

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

Visit WebsiteGitHubGitHub
784 stars112 forks0 contributors

What is Foundry?

Foundry is a model factory library for Symfony and Doctrine applications that simplifies creating development and test fixtures. It provides an expressive, auto-completable API to generate on-demand test data with randomized field values, reducing the boilerplate of manual fixture creation. It solves the problem of tedious, repetitive fixture writing by offering a fluent, type-safe system that integrates with DoctrineFixturesBundle and testing suites.

Target Audience

PHP developers building Symfony applications with Doctrine ORM or MongoDB ODM who need to create fixtures for database seeding or testing. It's particularly useful for teams practicing test-driven development (TDD) or those managing complex data scenarios in tests.

Value Proposition

Developers choose Foundry because it turns fixture creation from a chore into an enjoyable task with its expressive, auto-completable API and intelligent defaults. Its unique selling point is combining Laravel-style factory elegance with Symfony/Doctrine integration, supporting both SQL and NoSQL databases seamlessly.

Overview

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.

Use Cases

Best For

  • Generating randomized test data for unit and functional tests in Symfony
  • Creating complex database fixtures with custom states (e.g., 'published', 'archived')
  • Seeding development databases with realistic data using DoctrineFixturesBundle
  • Reducing boilerplate in test suites by auto-filling unspecified model fields
  • Building type-safe, auto-completable fixture definitions in PHPStorm or VS Code
  • Testing applications that use both Doctrine ORM and MongoDB ODM simultaneously

Not Ideal For

  • Projects not using Symfony or Doctrine ORM/ODM (e.g., Laravel or raw PHP applications)
  • Teams requiring completely static, deterministic fixtures without any randomization for reproducibility
  • Simple applications with trivial data models where manual fixture writing is negligible
  • Environments where Docker is unavailable or disliked for local testing setup

Pros & Cons

Pros

Expressive, Type-Safe API

The fluent, chainable syntax with IDE auto-completion, as shown in the README code example, makes fixture writing intuitive and reduces errors.

On-Demand and Randomized Data

Generates fixtures only when needed and fills unspecified fields with sensible random data, reducing boilerplate in tests and database seeding.

Multi-Database Support

Works seamlessly with both Doctrine ORM for SQL databases and MongoDB ODM, allowing use in mixed-database Symfony applications.

Custom State Management

Enables defining states like 'published' to create objects in specific configurations, enhancing flexibility for complex test scenarios.

Cons

Complex Test Setup

The test suite requires Docker and detailed environment configurations, as per the README, which can be a barrier for quick local development.

Ecosystem Lock-in

Tightly integrated with Symfony and Doctrine, making it unsuitable for projects using other frameworks or ORMs without significant adaptation.

Breaking Changes Overhead

The presence of an upgrade guide to v2 indicates significant breaking changes that could disrupt existing codebases during updates.

Frequently Asked Questions

Quick Stats

Stars784
Forks112
Contributors0
Open Issues25
Last commit26 days ago
CreatedSince 2020

Tags

#fixtures#orm#database-testing#factory#dev-tools#doctrine#testing#test#faker#php#symfony

Built With

P
PHP
D
Docker
P
PHPUnit
S
Symfony
D
Doctrine ORM

Links & Resources

Website

Included in

PHP32.5k
Auto-fetched 4 hours ago

Related Projects

PHPUnitPHPUnit

The PHP Unit Testing framework.

Stars20,022
Forks2,225
Last commit1 day ago
MockeryMockery

Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL).

Stars10,727
Forks462
Last commit1 month ago
ProphecyProphecy

Highly opinionated mocking framework for PHP 5.3+

Stars8,487
Forks247
Last commit19 days ago
CodeceptionCodeception

Full-stack testing PHP framework

Stars4,853
Forks1,288
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub