Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref #2236 - Move status assignment after last occurence of _e AND add… #2940

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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