diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index c98dd63d..ab0f719d 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -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; @@ -148,6 +148,12 @@ public function runTest(string $method, ?array $args = null): void } + protected function runTestMethod($name, $params): void + { + [$this, $name](...$params); + } + + /** * @return mixed */