thephpleague / factory-muffin

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

Attribute definition overwriting fix #379

Closed jsyi closed 9 years ago

jsyi commented 9 years ago

When passing attribute definitions to create()/instance() it is unclear from the documentation how conflicts between the passed definitions and definitions created by calls to define() should be resolved.

I had expected that the generators specified when calling create() or instance() should override those set by define(), but when using a factory with a group definition, the group definitions over write what was passed as a parameter to create().

Previous behavior:

group factory generators > generators passed as parameters to create() > base model factory generators

this change:

generators passed as parameters to create() > group factory generators > base model factory generators

GrahamCampbell commented 9 years ago

This is a breaking change, so is not allowed into 2.1, sorry. Could you send this to 3.0 please? (master)

jsyi commented 9 years ago

No problem