mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
first
This commit is contained in:
15
tests/Features/Exceptions.php
Normal file
15
tests/Features/Exceptions.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
it('gives access the the underlying expectException', function () {
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
|
||||
throw new InvalidArgumentException();
|
||||
});
|
||||
|
||||
it('catch exceptions', function () {
|
||||
throw new Exception('Something bad happened');
|
||||
})->throws(Exception::class);
|
||||
|
||||
it('catch exceptions and messages', function () {
|
||||
throw new Exception('Something bad happened');
|
||||
})->throws(Exception::class, 'Something bad happened');
|
||||
Reference in New Issue
Block a user