thephpleague / factory-muffin

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

Adds support for setting model attributes through setters #406

Closed luiz-brandao closed 8 years ago

luiz-brandao commented 8 years ago

Some model attributes needs to be set through setter methods, but FactoryMuffin only sets the attributes directly. This fix checks for the presence of a setter method on the model and calls it instead. I also includes a camelize function.

luiz-brandao commented 8 years ago

I hope it's all good now.

GrahamCampbell commented 8 years ago

Thanks. I'll make the remaining small change. ;)

luiz-brandao commented 8 years ago

Isn't it already static?

GrahamCampbell commented 8 years ago

See the commit I just pushed for what I meant.

luiz-brandao commented 8 years ago

I got it! ;)