-
Hello! Is there a native pest way to test for multiple possible conditions? There's the |
Beta Was this translation helpful? Give feedback.
Answered by
owenvoke
May 11, 2023
Replies: 1 comment
-
I don't think this is something we natively have on Pest, however a suggestion is you could use the use PHPUnit\Framework\Constraint;
it('can check with logical or', function () {
expect('abc')->toMatchConstraint(
Constraint\LogicalOr::fromConstraints(
new Constraint\IsEqual('abc'),
new Constraint\IsNull(),
)
);
}); It would be kind of nice to add this functionality in future though. 👀 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DKhalil
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think this is something we natively have on Pest, however a suggestion is you could use the
->toMatchConstraint()
method with PHPUnit'sLogicalOr
constraint.It would be kind of nice to add this functionality in future though. 👀