aboutsummaryrefslogtreecommitdiff
path: root/tests/MathTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/MathTest.php')
-rw-r--r--tests/MathTest.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/MathTest.php b/tests/MathTest.php
index 94a14d4..59ce207 100644
--- a/tests/MathTest.php
+++ b/tests/MathTest.php
@@ -674,6 +674,16 @@ class MathTest extends TestCase
$calculator->execute('myfunc(1)');
}
+ public function testFunctionIncorrectNumberOfParametersTooMany() : void
+ {
+ $calculator = new MathExecutor();
+ $this->expectException(IncorrectNumberOfFunctionParametersException::class);
+ $calculator->addFunction('myfunc', static function($arg1, $arg2) {
+ return $arg1 + $arg2;
+ });
+ $calculator->execute('myfunc(1,2,3)');
+ }
+
public function testFunctionIf() : void
{
$calculator = new MathExecutor();