mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat(expect): add more methods
This commit is contained in:
16
tests/Expect/toBeInstanceOf.php
Normal file
16
tests/Expect/toBeInstanceOf.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
test('pass', function () {
|
||||
expect(new Exception())->toBeInstanceOf(Exception::class);
|
||||
expect(new Exception())->not->toBeInstanceOf(RuntimeException::class);
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect(new Exception())->toBeInstanceOf(RuntimeException::class);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('not failures', function () {
|
||||
expect(new Exception())->not->toBeInstanceOf(Exception::class);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
Reference in New Issue
Block a user