Skip to content

Commit 0ae8690

Browse files
Closes #4299
1 parent 7258f8f commit 0ae8690

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

ChangeLog-8.5.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [8.5.7] - 2020-MM-DD
6+
7+
### Fixed
8+
9+
* [#4299](https://github.com/sebastianbergmann/phpunit/issues/4299): "No tests executed" does not always result in exit code `1`
10+
511
## [8.5.6] - 2020-06-15
612

713
### Fixed
@@ -64,6 +70,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
6470
* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable`
6571
* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside
6672

73+
[8.5.7]: https://github.com/sebastianbergmann/phpunit/compare/8.5.6...8.5
6774
[8.5.6]: https://github.com/sebastianbergmann/phpunit/compare/8.5.5...8.5.6
6875
[8.5.5]: https://github.com/sebastianbergmann/phpunit/compare/8.5.4...8.5.5
6976
[8.5.4]: https://github.com/sebastianbergmann/phpunit/compare/8.5.3...8.5.4

src/TextUI/TestRunner.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,10 @@ public function doRun(Test $suite, array $arguments = [], array $warnings = [],
739739
}
740740

741741
if ($exit) {
742+
if (\count($result) === 0) {
743+
exit(self::FAILURE_EXIT);
744+
}
745+
742746
if ($result->wasSuccessfulIgnoringWarnings()) {
743747
if ($arguments['failOnRisky'] && !$result->allHarmless()) {
744748
exit(self::FAILURE_EXIT);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/4299
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--no-configuration';
6+
$_SERVER['argv'][] = __DIR__ . '/4299';
7+
8+
require __DIR__ . '/../../../bootstrap.php';
9+
10+
PHPUnit\TextUI\Command::main();
11+
--EXPECTF--
12+
PHPUnit %s by Sebastian Bergmann and contributors.
13+
14+
No tests executed!

tests/end-to-end/regression/GitHub/4299/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)