thephpleague / factory-muffin

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

Question: Is there any way to create a doctrine entity without a need for setters? #447

Open 3amprogrammer opened 6 years ago

3amprogrammer commented 6 years ago

I am using Codeception with Symfony and Doctrine2 modules enabled. I would like to be able to do something like this

$movies = $I->haveMultiple(Movie::class, 15); // haveMultiple uses this library behind the scenes.

However this doesn't work if setters for each property of Movie class are missing.

Codeceptions' method haveInRepository seems to be using reflection to set those properties, but I must specify data explicitly.

Has this problem already been solved or should I write some custom adapter?