Skip to content

Commit

Permalink
Quickfix to keep tear down exceptions from killing PHPUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
epdenouden authored and sebastianbergmann committed Jan 21, 2019
1 parent b880c49 commit 0b7b618
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Framework/TestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,15 @@ public function run(TestResult $result = null): TestResult
$test->run($result);
}

foreach ($hookMethods['afterClass'] as $afterClassMethod) {
if ($this->testCase === true && \class_exists($this->name, false) && \method_exists($this->name, $afterClassMethod)) {
\call_user_func([$this->name, $afterClassMethod]);
try {
foreach ($hookMethods['afterClass'] as $afterClassMethod) {
if ($this->testCase === true && \class_exists($this->name, false) && \method_exists($this->name,
$afterClassMethod)) {
\call_user_func([$this->name, $afterClassMethod]);
}
}
} catch(Throwable $t) {
trigger_error($t->__toString(), E_USER_WARNING);
}

$this->tearDown();
Expand Down

0 comments on commit 0b7b618

Please sign in to comment.