Skip to content

Commit

Permalink
better handling of null value in assertNoExceptionsThrown
Browse files Browse the repository at this point in the history
  • Loading branch information
johanrosenson committed Feb 23, 2021
1 parent ad69741 commit 8bea1e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ExceptionAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ public function assertNoExceptionsThrown(callable $callback) : void
$thrownException,
\sprintf(
'Failed asserting that no exceptions was thrown, exception of type "%1$s was thrown.',
\get_class($thrownException),
$thrownException === null
? 'N/A'
: \get_class($thrownException),
),
);
}
Expand Down

0 comments on commit 8bea1e1

Please sign in to comment.