Files
pest/tests/Features/Exceptions.php
Nuno Maduro de2929077b first
2020-05-11 18:38:30 +02:00

16 lines
460 B
PHP

<?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');