From c3cf6199aa876b0d8f4711ab39596d8803688cb3 Mon Sep 17 00:00:00 2001 From: Martin Jonas Date: Sun, 21 Aug 2022 11:30:50 +0200 Subject: [PATCH] TestCase - runTestMethod --- src/Framework/TestCase.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 */