thephpleague / factory-muffin

Enables the rapid creation of objects for testing
https://factory-muffin.thephpleague.com/
MIT License
532 stars 72 forks source link

OneToMany Doctrine relation. #454

Open stevs986 opened 6 years ago

stevs986 commented 6 years ago

Hi is there any option to create more than one related entity. In example in your test you have User and Cat. Is there any option to create more than one Cat which is related to User. Something like: static::$fm->define(self::USER_ENTITY)->setDefinitions([ 'name' => Faker::firstNameMale(), 'email' => Faker::email(), 'cat' => 'entity[5]|'.self::CAT_ENTITY, ]);

Note [5] in entity creation definition.