From 6d7fd66f829e18c88856ece5ae4eff311608302d Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Wed, 14 Dec 2022 14:56:26 +0000 Subject: [PATCH] tests: on opposite `throwExpectationFailedException` --- tests/Unit/Expectations/OppositeExpectation.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/Unit/Expectations/OppositeExpectation.php diff --git a/tests/Unit/Expectations/OppositeExpectation.php b/tests/Unit/Expectations/OppositeExpectation.php new file mode 100644 index 00000000..448ebf6d --- /dev/null +++ b/tests/Unit/Expectations/OppositeExpectation.php @@ -0,0 +1,16 @@ +throwExpectationFailedException('toBe', 'bar'); +})->throws(ExpectationFailedException::class, "Expecting 'foo' not to be 'bar'."); + +it('throw expectation failed exception with array argument', function (): void { + $expectation = new OppositeExpectation(expect('foo')); + + $expectation->throwExpectationFailedException('toBe', ['bar']); +})->throws(ExpectationFailedException::class, "Expecting 'foo' not to be 'bar'.");