Closed mtagliab closed 4 years ago
@webimpress I think an unit test is missing here. Like this one:
@froschdesign test added. Would you mind to have a look on it, please?
It's a bit tricky as I mentioned in the commit comment - we can't use getValidators
on ValidatorChain
, as the result is not sorted by priority. When validators are called (in isValid
) these are ordered, and this is how I check it.
@webimpress
When validators are called (in
isValid
) these are ordered, and this is how I check it.
👍
Thanks, @mtagliab!
I noticed that it was impossible to set validator's priority using the "array notation", even if this feature was already there as it already exists for filters (see line 384 of Factory.php).
To add the priority, it will be enough to add the
priority
key in the array:FactoryTest fix
I also noticed that the FactoryTest class had a minor issue, which was that validators where not tested inside the
testFactoryWillCreateInputWithSuggestedValidators
method. I fixed the loop and added a final assert to verify that all the validators have been tested.