diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php index 47dc602807c6..42534884c75e 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php @@ -170,14 +170,10 @@ protected function assertThrows(Closure $test, string $expectedClass = Throwable $actualMessage = $exception->getMessage(); } - if (! $thrown) { - Assert::fail( - sprintf( - 'Failed asserting that exception of type "%s" is thrown.', - $expectedClass - ) - ); - } + Assert::assertTrue( + $thrown, + sprintf('Failed asserting that exception of type "%s" is thrown.', $expectedClass) + ); if (isset($expectedMessage)) { if (! isset($actualMessage)) {