aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBruce Wells <bruce.wells@simparel.com>2019-01-11 04:29:20 +0300
committerBruce Wells <bruce.wells@simparel.com>2019-01-11 04:32:22 +0300
commite03df64281a1c33639b13c9f490d4452c1a1784d (patch)
tree449ad548f128c09503ef62df570a8d700ca9145d /tests
parent18b12aeeff34c8ac9a350165ae36f08f4138dc9c (diff)
Fixed function argument ordering and default parameter type for addFunction
Updated unit tests Fixed docs
Diffstat (limited to 'tests')
-rw-r--r--tests/MathTest.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/MathTest.php b/tests/MathTest.php
index 55e0799..d1c9604 100644
--- a/tests/MathTest.php
+++ b/tests/MathTest.php
@@ -146,6 +146,14 @@ class MathTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($calculator->execute('round(100/30)'), $phpResult);
}
+ public function testFunctionsWithQuotes()
+ {
+ $calculator = new MathExecutor();
+ $calculator->addFunction('concat', function($first, $second){return $first.$second;});
+ $this->assertEquals('testing', $calculator->execute('concat("test", "ing")'));
+ $this->assertEquals('testing', $calculator->execute("concat('test', 'ing')"));
+ }
+
public function testQuotes()
{
$calculator = new MathExecutor();