Skip to content

Commit

Permalink
Closes #3531
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 15, 2019
1 parent 23a200a commit d00d0af
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog-7.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/Framework/TestResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d00d0af

Please sign in to comment.