diff --git a/src/TestFramework/PhpUnit/Adapter/PhpUnitAdapter.php b/src/TestFramework/PhpUnit/Adapter/PhpUnitAdapter.php index 03326c597..5258633b1 100644 --- a/src/TestFramework/PhpUnit/Adapter/PhpUnitAdapter.php +++ b/src/TestFramework/PhpUnit/Adapter/PhpUnitAdapter.php @@ -136,7 +136,10 @@ public function testsPass(string $output): bool // "Warnings!" - e.g. when deprecated functions are used, but tests pass $isWarning = preg_match('/warnings!/i', $output); - return $isOk || $isOkWithInfo || $isWarning; + // "No tests executed!" - e.g. when --filter option contains too large regular expression + $isNoTestsExecuted = preg_match('/No tests executed!/i', $output); + + return $isOk || $isOkWithInfo || $isWarning | $isNoTestsExecuted; } public function getMemoryUsed(string $output): float diff --git a/tests/phpunit/TestFramework/PhpUnit/Adapter/PhpUnitAdapterTest.php b/tests/phpunit/TestFramework/PhpUnit/Adapter/PhpUnitAdapterTest.php index 6410d8b5a..eb9d9b56e 100644 --- a/tests/phpunit/TestFramework/PhpUnit/Adapter/PhpUnitAdapterTest.php +++ b/tests/phpunit/TestFramework/PhpUnit/Adapter/PhpUnitAdapterTest.php @@ -275,6 +275,8 @@ public function outputProvider(): iterable yield ['FAILURES!', false]; yield ['ERRORS!', false]; + + yield ['No tests executed!', true]; } public function memoryReportProvider(): iterable