Skip to content

Commit 8bea1e1

Browse files
committed
better handling of null value in assertNoExceptionsThrown
1 parent ad69741 commit 8bea1e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ExceptionAssertions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public function assertNoExceptionsThrown(callable $callback) : void
9494
$thrownException,
9595
\sprintf(
9696
'Failed asserting that no exceptions was thrown, exception of type "%1$s was thrown.',
97-
\get_class($thrownException),
97+
$thrownException === null
98+
? 'N/A'
99+
: \get_class($thrownException),
98100
),
99101
);
100102
}

0 commit comments

Comments
 (0)