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 690184a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 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,11 @@ 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 690184a

Please sign in to comment.