I've added assertion method to check for creation rules as well as update rules on a field.
Why?
First of all, thank you for creating such a nice package that helps me very much to do unit testing in Nova. But yesterday, I just realized, there are fields that have different rule upon creation or updating. So for this case, using assertHasRule won't work. And that is the reason I come up with this new assertion method.
How?
We can use the creationRules and updateRules attributes from the Field instance to check if it contains the given rule.
Testing
I also have added the corresponding test for both creation rule assertion and update rule assertion.
Final Notes
Hope this will help and sorry for my bad English :sweat_smile: .
@joshua060198 Hello! Thank you for submitting to my project! I'm sorry it has taken me so long to review your pull request. I have just a few small changes, and then I will add this to my next release.
What?
I've added assertion method to check for creation rules as well as update rules on a field.
Why?
First of all, thank you for creating such a nice package that helps me very much to do unit testing in Nova. But yesterday, I just realized, there are fields that have different rule upon creation or updating. So for this case, using
assertHasRule
won't work. And that is the reason I come up with this new assertion method.How?
We can use the
creationRules
andupdateRules
attributes from theField
instance to check if it contains the given rule.Testing
I also have added the corresponding test for both creation rule assertion and update rule assertion.
Final Notes
Hope this will help and sorry for my bad English :sweat_smile: .