lundi 4 janvier 2016

Laravel 5.1 mocking 'unique' validation rule

We are using the 'unique' rule for validation on the application, but for tests we're mocking the database layer through the use of repository pattern. Is there a way to mock the unique rule so that it doesn't attempt to check the database?

I tried mocking Illuminate\Validation\Validator::validateUnique it doesn't work but since the method is protected.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire