Skip to content

Commit

Permalink
ref #2236 - Move status assignment after last occurence of _e AND add…
Browse files Browse the repository at this point in the history
… assert
  • Loading branch information
jean authored and sebastianbergmann committed Dec 28, 2017
1 parent c728a76 commit 950417e
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 @@ -925,11 +925,6 @@ public function runBare(): void
$e = $_e;
}

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

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

if (isset($_e)) {
$this->status = 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 @@ -175,6 +175,7 @@ public function testExceptionInTearDown(): void
$this->assertTrue($test->testSomething);
$this->assertTrue($test->assertPostConditions);
$this->assertTrue($test->tearDown);
$this->assertEquals(BaseTestRunner::STATUS_ERROR, $test->getStatus());
}

public function testNoArgTestCasePasses(): void
Expand Down

0 comments on commit 950417e

Please sign in to comment.