Skip to content

Commit

Permalink
Fix #3564 by reusing an existing test as a stub to fill the log entry
Browse files Browse the repository at this point in the history
  • Loading branch information
epdenouden authored and sebastianbergmann committed Mar 18, 2019
1 parent eb343b8 commit 7969f5b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Framework/TestSuite.php
Expand Up @@ -758,11 +758,13 @@ public function run(TestResult $result = null): TestResult
} catch (Throwable $t) {
$message = "Exception in {$this->name}::$afterClassMethod" . \PHP_EOL . $t->getMessage();
$error = new SyntheticError($message, 0, $t->getFile(), $t->getLine(), $t->getTrace());
$test = new \Failure($afterClassMethod);

$result->startTest($test);
$result->addFailure($test, $error, 0);
$result->endTest($test, 0);
$placeholderTest = clone $test;
$placeholderTest->setName($afterClassMethod);

$result->startTest($placeholderTest);
$result->addFailure($placeholderTest, $error, 0);
$result->endTest($placeholderTest, 0);
}

$this->tearDown();
Expand Down

0 comments on commit 7969f5b

Please sign in to comment.