thephpleague / factory-muffin

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

Support for Yii2 model validation errors #471

Closed marden closed 3 years ago

marden commented 3 years ago

Yii2 Framework provides a model validation using rules method. Error messages are saved to errors property in the model. Current version of AbstractStore checks only for validationErrors property but it's not enough. Every time error occurs we see "We could not save the model" without details.

So I added support for Yii2 validation errors.

P.S. Not quite sure about formatting errors as a string. It seems print_r fits well.

marden commented 3 years ago

@GrahamCampbell Any feedback appreciated. Please review.