From 309dc195a6b258fb4982d9a81228204d614352f0 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 21 Jan 2024 23:14:22 +0100 Subject: [PATCH] test(): checks count of arguments --- src/Framework/functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Framework/functions.php b/src/Framework/functions.php index a26f0499..2cb4f61c 100644 --- a/src/Framework/functions.php +++ b/src/Framework/functions.php @@ -9,6 +9,10 @@ function test(string $description, Closure $closure): void { + if (($count = func_num_args()) > 2) { + throw new \Exception(__FUNCTION__ . "() expects 2 parameter, $count given."); + } + if ($fn = (new ReflectionFunction('setUp'))->getStaticVariables()['fn']) { $fn(); }