Need help with foundry?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

zenstruck
376 Stars 26 Forks MIT License 304 Commits 23 Opened issues

Description

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

Services available

!
?

Need anything else?

Contributors list

Foundry

CI Status Scrutinizer Code Quality Code Coverage Latest Version

Foundry makes creating fixtures data fun again, via an expressive, auto-completable, on-demand fixtures system with Symfony and Doctrine:

$post = PostFactory::new() // Create the factory for Post objects
    ->published()          // Make the post in a "published" state
    ->create([             // create & persist the Post object
        'slug' => 'post-a' // This Post object only requires the slug field - all other fields are random data
    ])
;

The factories can be used inside DoctrineFixturesBundle to load fixtures or inside your tests, where it has even more features.

Foundry supports

doctrine/orm
(with doctrine/doctrine-bundle),
doctrine/mongodb-odm
(with doctrine/mongodb-odm-bundle) or a combination of these.

Want to watch a screencast 🎥 about it? Check out https://symfonycasts.com/foundry

Read the Documentation

Credit

The AAA style of testing was first introduced to me by Adam Wathan's excellent Test Driven Laravel Course. The inspiration for this libraries API comes from Laravel factories and christophrumpel/laravel-factories-reloaded.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.