From d00d0af031bdb4dc97fcfffb9088825ed86772eb Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Fri, 15 Feb 2019 17:31:49 +0100 Subject: [PATCH] Closes #3531 --- ChangeLog-7.5.md | 7 +++++++ src/Framework/TestResult.php | 7 ++++++- src/TextUI/TestRunner.php | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog-7.5.md b/ChangeLog-7.5.md index 0a763c711a8..c1d6e8b0c0c 100644 --- a/ChangeLog-7.5.md +++ b/ChangeLog-7.5.md @@ -2,6 +2,12 @@ All notable changes of the PHPUnit 7.5 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [7.5.6] - 2019-MM-DD + +### Fixed + +* Fixed [#3531](https://github.com/sebastianbergmann/phpunit/issues/3531): Test suite fails on warning + ## [7.5.5] - 2019-02-15 ### Fixed @@ -66,6 +72,7 @@ All notable changes of the PHPUnit 7.5 release series are documented in this fil * Fixed [#3429](https://github.com/sebastianbergmann/phpunit/pull/3429): Inefficient loop in `getHookMethods()` * Fixed [#3437](https://github.com/sebastianbergmann/phpunit/pull/3437): JUnit logger skips PHPT tests +[7.5.6]: https://github.com/sebastianbergmann/phpunit/compare/7.5.5...7.5.6 [7.5.5]: https://github.com/sebastianbergmann/phpunit/compare/7.5.4...7.5.5 [7.5.4]: https://github.com/sebastianbergmann/phpunit/compare/7.5.3...7.5.4 [7.5.3]: https://github.com/sebastianbergmann/phpunit/compare/7.5.2...7.5.3 diff --git a/src/Framework/TestResult.php b/src/Framework/TestResult.php index 1fafc8d5fc9..fd81c867be9 100644 --- a/src/Framework/TestResult.php +++ b/src/Framework/TestResult.php @@ -1080,7 +1080,12 @@ public function time(): float */ public function wasSuccessful(): bool { - return empty($this->errors) && empty($this->failures) && empty($this->warnings); + return $this->wasSuccessfulIgnoringWarnings() && empty($this->warnings); + } + + public function wasSuccessfulIgnoringWarnings(): bool + { + return empty($this->errors) && empty($this->failures); } /** diff --git a/src/TextUI/TestRunner.php b/src/TextUI/TestRunner.php index 4c7d77fc2b8..35e3a8e8cc5 100644 --- a/src/TextUI/TestRunner.php +++ b/src/TextUI/TestRunner.php @@ -774,7 +774,7 @@ public function doRun(Test $suite, array $arguments = [], bool $exit = true): Te } if ($exit) { - if ($result->wasSuccessful()) { + if ($result->wasSuccessfulIgnoringWarnings()) { if ($arguments['failOnRisky'] && !$result->allHarmless()) { exit(self::FAILURE_EXIT); }