aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBruce Wells <brucekwells@gmail.com>2019-01-16 04:07:49 +0300
committerGitHub <noreply@github.com>2019-01-16 04:07:49 +0300
commit01a0c8e6270a3b1438cc77fafe3f18211f0fa46e (patch)
treebbe5d69fd1f519d18a3f9277140cae2c55ee5b06 /tests
parent47df3edbb6c437a049deee356db84f58edcba681 (diff)
parent5a26d651dd241f2457cda49206e3439513ea4788 (diff)
Merge branch 'master' into master
Diffstat (limited to 'tests')
-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();