Skip to content

Commit

Permalink
TestCase - runTestMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMystikJonas committed Aug 21, 2022
1 parent fd9d510 commit c3cf619
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ public function runTest(string $method, ?array $args = null): void
try {
if ($info['throws']) {
$e = Assert::error(function () use ($method, $params): void {
[$this, $method->getName()](...$params);
$this->runTestMethod($method->getName(), $params);
}, ...$throws);
if ($e instanceof AssertException) {
throw $e;
}
} else {
[$this, $method->getName()](...$params);
$this->runTestMethod($method->getName(), $params);
}
} catch (\Throwable $e) {
$this->handleErrors = false;
Expand All @@ -148,6 +148,12 @@ public function runTest(string $method, ?array $args = null): void
}


protected function runTestMethod($name, $params): void
{
[$this, $name](...$params);
}


/**
* @return mixed
*/
Expand Down

0 comments on commit c3cf619

Please sign in to comment.