mirror of
https://github.com/pestphp/pest.git
synced 2026-03-05 23:37:22 +01:00
tests: on opposite throwExpectationFailedException
This commit is contained in:
16
tests/Unit/Expectations/OppositeExpectation.php
Normal file
16
tests/Unit/Expectations/OppositeExpectation.php
Normal 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'.");
|
||||
Reference in New Issue
Block a user