tests: on opposite throwExpectationFailedException

This commit is contained in:
Nuno Maduro
2022-12-14 14:56:26 +00:00
parent e1e926076a
commit 6d7fd66f82

View File

@ -0,0 +1,16 @@
<?php
use Pest\Expectations\OppositeExpectation;
use PHPUnit\Framework\ExpectationFailedException;
it('throw expectation failed exception with string argument', function (): void {
$expectation = new OppositeExpectation(expect('foo'));
$expectation->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'.");