Skip to content

Commit

Permalink
Backport 950417e for #2236
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 28, 2017
1 parent dd8aaee commit b7654e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Framework/TestCase.php
Expand Up @@ -945,11 +945,6 @@ public function runBare()
$e = $_e;
}

if (isset($_e)) {
$this->status = PHPUnit_Runner_BaseTestRunner::STATUS_ERROR;
$this->statusMessage = $_e->getMessage();
}

// Clean up the mock objects.
$this->mockObjects = [];
$this->prophet = null;
Expand Down Expand Up @@ -986,6 +981,11 @@ public function runBare()
}
}

if (isset($_e)) {
$this->status = PHPUnit_Runner_BaseTestRunner::STATUS_ERROR;
$this->statusMessage = $_e->getMessage();
}

clearstatcache();

if ($currentWorkingDirectory != getcwd()) {
Expand Down
1 change: 1 addition & 0 deletions tests/Framework/TestCaseTest.php
Expand Up @@ -159,6 +159,7 @@ public function testExceptionInTearDown()
$this->assertTrue($test->testSomething);
$this->assertTrue($test->assertPostConditions);
$this->assertTrue($test->tearDown);
$this->assertEquals(PHPUnit_Runner_BaseTestRunner::STATUS_ERROR, $test->getStatus());
}

public function testNoArgTestCasePasses()
Expand Down

0 comments on commit b7654e5

Please sign in to comment.