Closed LostKobrakai closed 8 years ago
What use case do you have for this?
I want to use it with ProcessWire, which does use a pattern like in the test quite often. The magic method is the catch-all portion and in some cases longer work is delegated to a explicit setter function, which may or may not be public.
I just noticed is_callable(array($model, $setter))
would work as well and might be more readable. Should I change it to that?
The test doesn't really test this is correct?
Trying to use the setName() method would result in an error, which it doesn't with my addition. I think the assert might not be needed and I'm not really into phpunit, so I don't know how to correctly test for such errors.
Maybe just make that method throw an exception so we can be 1000% sure?
Thanks. I've merged your tests, but fixed it a different way.
FactoryMuffin::generate does currently try to access protected or private setter methods independent of the visibility of the method.