Skip to content

Commit

Permalink
Merge branch '5.1' into 5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Bergmann authored and Sebastian Bergmann committed Nov 20, 2015
2 parents 8c27962 + 5ac452f commit 40f5775
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
7 changes: 7 additions & 0 deletions ChangeLog-4.8.md
Expand Up @@ -2,6 +2,12 @@

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

## [4.8.19] - 2015-MM-DD

### Fixed

* Fixed [#1955](https://github.com/sebastianbergmann/phpunit/issues/1955): Process isolation fails when running tests with `phpdbg -qrr`

## [4.8.18] - 2015-11-11

### Changed
Expand Down Expand Up @@ -137,6 +143,7 @@ New PHAR release due to updated dependencies
* Made the argument check of `assertContains()` and `assertNotContains()` more strict to prevent undefined behavior such as [#1808](https://github.com/sebastianbergmann/phpunit/issues/1808)
* Changed the name of the default group from `__nogroup__` to `default`

[4.8.19]: https://github.com/sebastianbergmann/phpunit/compare/4.8.18...4.8.19
[4.8.18]: https://github.com/sebastianbergmann/phpunit/compare/4.8.17...4.8.18
[4.8.17]: https://github.com/sebastianbergmann/phpunit/compare/4.8.16...4.8.17
[4.8.16]: https://github.com/sebastianbergmann/phpunit/compare/4.8.15...4.8.16
Expand Down
8 changes: 8 additions & 0 deletions ChangeLog-5.0.md
Expand Up @@ -2,6 +2,13 @@

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

## [5.0.10] - 2015-MM-DD

### Fixed

* Fixed [#1953](https://github.com/sebastianbergmann/phpunit/issues/1953): `Error`s raised outside the scope of a test method are not handled properly
* Fixed [#1955](https://github.com/sebastianbergmann/phpunit/issues/1955): Process isolation fails when running tests with `phpdbg -qrr`

## [5.0.9] - 2015-11-10

### Added
Expand Down Expand Up @@ -107,6 +114,7 @@ All notable changes of the PHPUnit 5.0 release series are documented in this fil
* The PHPUnit_Selenium component can no longer be configured using the `<selenium/browser>` element of PHPUnit's configuration file
* PHPUnit is no longer supported on PHP 5.3, PHP 5.4, and PHP 5.5

[5.0.10]: https://github.com/sebastianbergmann/phpunit/compare/5.0.9...5.0.10
[5.0.9]: https://github.com/sebastianbergmann/phpunit/compare/5.0.8...5.0.9
[5.0.8]: https://github.com/sebastianbergmann/phpunit/compare/5.0.7...5.0.8
[5.0.7]: https://github.com/sebastianbergmann/phpunit/compare/5.0.6...5.0.7
Expand Down
8 changes: 5 additions & 3 deletions src/Framework/TestFailure.php
Expand Up @@ -34,19 +34,21 @@ class PHPUnit_Framework_TestFailure
* Constructs a TestFailure with the given test and exception.
*
* @param PHPUnit_Framework_Test $failedTest
* @param Exception $thrownException
* @param Throwable $t
*/
public function __construct(PHPUnit_Framework_Test $failedTest, Exception $thrownException)
public function __construct(PHPUnit_Framework_Test $failedTest, $t)
{
if ($failedTest instanceof PHPUnit_Framework_SelfDescribing) {
$this->testName = $failedTest->toString();
} else {
$this->testName = get_class($failedTest);
}

if (!$failedTest instanceof PHPUnit_Framework_TestCase || !$failedTest->isInIsolation()) {
$this->failedTest = $failedTest;
}
$this->thrownException = $thrownException;

$this->thrownException = $t;
}

/**
Expand Down
25 changes: 15 additions & 10 deletions src/Framework/TestResult.php
Expand Up @@ -206,43 +206,48 @@ public function flushListeners()
* Adds an error to the list of errors.
*
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param Throwable $t
* @param float $time
*/
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time)
public function addError(PHPUnit_Framework_Test $test, $t, $time)
{
if ($e instanceof PHPUnit_Framework_RiskyTest) {
$this->risky[] = new PHPUnit_Framework_TestFailure($test, $e);
if ($t instanceof PHPUnit_Framework_RiskyTest) {
$this->risky[] = new PHPUnit_Framework_TestFailure($test, $t);
$notifyMethod = 'addRiskyTest';

if ($this->stopOnRisky) {
$this->stop();
}
} elseif ($e instanceof PHPUnit_Framework_IncompleteTest) {
$this->notImplemented[] = new PHPUnit_Framework_TestFailure($test, $e);
} elseif ($t instanceof PHPUnit_Framework_IncompleteTest) {
$this->notImplemented[] = new PHPUnit_Framework_TestFailure($test, $t);
$notifyMethod = 'addIncompleteTest';

if ($this->stopOnIncomplete) {
$this->stop();
}
} elseif ($e instanceof PHPUnit_Framework_SkippedTest) {
$this->skipped[] = new PHPUnit_Framework_TestFailure($test, $e);
} elseif ($t instanceof PHPUnit_Framework_SkippedTest) {
$this->skipped[] = new PHPUnit_Framework_TestFailure($test, $t);
$notifyMethod = 'addSkippedTest';

if ($this->stopOnSkipped) {
$this->stop();
}
} else {
$this->errors[] = new PHPUnit_Framework_TestFailure($test, $e);
$this->errors[] = new PHPUnit_Framework_TestFailure($test, $t);
$notifyMethod = 'addError';

if ($this->stopOnError || $this->stopOnFailure) {
$this->stop();
}
}

// @see https://github.com/sebastianbergmann/phpunit/issues/1953
if ($t instanceof Error) {
$t = new PHPUnit_Framework_ExceptionWrapper($t);
}

foreach ($this->listeners as $listener) {
$listener->$notifyMethod($test, $e, $time);
$listener->$notifyMethod($test, $t, $time);
}

$this->lastTestFailed = true;
Expand Down

0 comments on commit 40f5775

Please sign in to comment.