aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/MathTest.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/MathTest.php b/tests/MathTest.php
index 5bb2ec0..09168c2 100644
--- a/tests/MathTest.php
+++ b/tests/MathTest.php
@@ -147,6 +147,15 @@ class MathTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('testing', $calculator->execute("concat('test','ing')"));
}
+ public function testFunctionParameterOrder()
+ {
+ $calculator = new MathExecutor();
+
+ $calculator->addFunction('concat', function ($arg1, $arg2) {return $arg1.$arg2;});
+ $this->assertEquals('testing', $calculator->execute('concat("test","ing")'));
+ $this->assertEquals('testing', $calculator->execute("concat('test','ing')"));
+ }
+
public function testFunction()
{
$calculator = new MathExecutor();