Skip to content

Commit 112e3a6

Browse files
authored
fix: only restore error handler for PHPUnit 10 or superior (#669)
1 parent bad65a2 commit 112e3a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Test/KernelHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public static function shutdownKernel(KernelInterface $kernel): void
3333
{
3434
$kernel->shutdown();
3535

36+
if (!class_exists(\PHPUnit\Runner\ErrorHandler::class)) {
37+
return;
38+
}
39+
3640
while (true) {
3741
$previousHandler = \set_error_handler(static fn() => null);
3842
\restore_error_handler();

0 commit comments

Comments
 (0)