-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Object Mother Support (Fixture Factory) #36
Comments
I understand that a Fixture Factory can take great advantage of a fake data generator, but I think porting something like Factory Girl to PHP goes beyond the boundaries of Faker itself. Maybe another project? Would you like to extract FixtureFactory from xi-doctrine, make it ORM-agnostic, and publish it to GitHub? I'd be willing to help with the Faker integration in that case. |
ok - got a mini project going. will port the good parts of xi-doctrine fixture factory and try to get a little closer to the actual Factory Girl implementation from Ruby. If I make FactoryGirl totally ORM-agnostic do you think we'll be able to make use of the different Faker providers? |
Hey @fzaninotto - is ORM support new? Are you thinking about adding support for sequences? Thx |
Hi, No, it is not new. What exactlyu would you want that Faker handles on sequences? ORMs usually deal with that themselves. |
See |
cc @fzaninotto - can you check the link i posted? I think you're not understanding what I mean perhaps. |
It seems that Faker could be an exceptional candidate for Fixture Factory support. This was originally made popular by Martin Fowler's Object Mother Pattern and has since been adopted in popular ruby packages like Factory Girl and Object Daddy. Here's a great Blog Post on the benefits of Factories over Fixtures.
There appears to be one such attempt in PHP land, namely in the Xi Project. https://github.com/xi-project/xi-doctrine. See FixtureFactory. Faker already has the ability to create fixtures and has ORM/ODM providers. With a little work, we could provide a very solid Object Mother that makes testing incredibly succinct.
The text was updated successfully, but these errors were encountered: