diff --git a/src/Util/PHP/AbstractPhpProcess.php b/src/Util/PHP/AbstractPhpProcess.php index fba0b9600b8..39e720ea493 100644 --- a/src/Util/PHP/AbstractPhpProcess.php +++ b/src/Util/PHP/AbstractPhpProcess.php @@ -11,6 +11,7 @@ use __PHP_Incomplete_Class; use ErrorException; +use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\Exception; use PHPUnit\Framework\SyntheticError; use PHPUnit\Framework\Test; @@ -248,6 +249,14 @@ private function processChildResult(Test $test, TestResult $result, string $stdo $childResult = \unserialize(\str_replace("#!/usr/bin/env php\n", '', $stdout)); \restore_error_handler(); + + if ($childResult === false) { + $result->addFailure( + $test, + new AssertionFailedError('Test was run in child process and ended unexpectedly'), + $time + ); + } } catch (ErrorException $e) { \restore_error_handler(); $childResult = false;