Skip to content

Commit

Permalink
Closes #4299
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 17, 2020
1 parent 7258f8f commit 0ae8690
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ChangeLog-8.5.md
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/TextUI/TestRunner.php
Expand Up @@ -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);
Expand Down
14 changes: 14 additions & 0 deletions tests/end-to-end/regression/GitHub/4299.phpt
@@ -0,0 +1,14 @@
--TEST--
https://github.com/sebastianbergmann/phpunit/issues/4299
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = __DIR__ . '/4299';

require __DIR__ . '/../../../bootstrap.php';

PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

No tests executed!
Empty file.

0 comments on commit 0ae8690

Please sign in to comment.