Closed AndyGibsonProtectline closed 6 years ago
You can easily subclass the \Assert\Assertion
and add your own assertions and/or exception class.
See https://github.com/beberlei/assert#your-own-assertion-class and https://github.com/beberlei/assert#exception--error-handling.
If you need more help or info, please ask.
For a value checker, \Assert\Assertion::choice()
or \Assert\Assertion::inArray()
both exist.
But I think \Assert\Assertion::satisfy()
may be the assertion you are looking for.
OK, thank you. I'll do this myself, then. Thanks for your help!
Hi!
Many apologies if I'm doing something really wrong.
I am trying to use Assert with Behat/MInk and I often end up trying to do something like the following: Given a parent with these properties When I add a child with name 'Jo' and age 21 And I view details of the parent Then I should see a child called 'Jo' aged 21
I then end up looping through a list of details and trying to see if any of the children entries match the given criteria.
I would find it really useful to have an assertion like AtLeastOneValueMatches( array, callback).
Should I...
Many thanks for a great library :)