diff --git a/ChangeLog-8.5.md b/ChangeLog-8.5.md index dc983209f5c..9e19b2b082a 100644 --- a/ChangeLog-8.5.md +++ b/ChangeLog-8.5.md @@ -2,6 +2,12 @@ All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [8.5.7] - 2020-MM-DD + +### Fixed + +* [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299): "No tests executed" does not always result in exit code `1` + ## [8.5.6] - 2020-06-15 ### Fixed @@ -64,6 +70,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil * [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable` * [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside +[8.5.7]: https://github.com/sebastianbergmann/phpunit/compare/8.5.6...8.5 [8.5.6]: https://github.com/sebastianbergmann/phpunit/compare/8.5.5...8.5.6 [8.5.5]: https://github.com/sebastianbergmann/phpunit/compare/8.5.4...8.5.5 [8.5.4]: https://github.com/sebastianbergmann/phpunit/compare/8.5.3...8.5.4 diff --git a/src/TextUI/TestRunner.php b/src/TextUI/TestRunner.php index 4b9826e5cc0..9ed277f83a1 100644 --- a/src/TextUI/TestRunner.php +++ b/src/TextUI/TestRunner.php @@ -739,6 +739,10 @@ public function doRun(Test $suite, array $arguments = [], array $warnings = [], } if ($exit) { + if (\count($result) === 0) { + exit(self::FAILURE_EXIT); + } + if ($result->wasSuccessfulIgnoringWarnings()) { if ($arguments['failOnRisky'] && !$result->allHarmless()) { exit(self::FAILURE_EXIT); diff --git a/tests/end-to-end/regression/GitHub/4299.phpt b/tests/end-to-end/regression/GitHub/4299.phpt new file mode 100644 index 00000000000..24db4217e58 --- /dev/null +++ b/tests/end-to-end/regression/GitHub/4299.phpt @@ -0,0 +1,14 @@ +--TEST-- +https://github.com/sebastianbergmann/phpunit/issues/4299 +--FILE-- +