High order "and" #1291
Unanswered
roni-estein
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This may be silly but when looking at tests I sometimes find myself reaching for a high order "and" for readability. So since I found pipes I've been modifying some expectations functions to work more in line with the way I expect things to work, for example, I adjusted toHaveProperties to work more like the old assertJsonSubset because it seemed more natural and readable, and then defer it to it's original function if the objects are not eloquent models.
However I haven't be able to adapt "and" and if anyone had a method of doing so In would appreciate if you had a moment to respond.
Here is an example of what I was trying to accomplish
I've tried a number of variations but they all essentially look like:
I always end up with an error:
ArgumentCountError: Too few arguments to function Pest\Expectation::and(), 0 passed in ... and exactly 1 expected
I've defined it as "but"
It works, but it's a second best solution
Beta Was this translation helpful? Give feedback.
All reactions