aboutsummaryrefslogtreecommitdiff
path: root/tests/MathTest.php
diff options
context:
space:
mode:
authorAlexander Kiryukhin <alexander@kiryukhin.su>2018-09-06 20:39:47 +0300
committerGitHub <noreply@github.com>2018-09-06 20:39:47 +0300
commit3011a1c55686ef5a0c7759ae1efcb2a71623ab9c (patch)
treec192d6dd2948e83122893ab67228141b271c2d22 /tests/MathTest.php
parent29d32a155f9956d1041a4420c19986565f695040 (diff)
parent855ca5dfc1a6d70d9872df4b0d7bea8ba3c4c040 (diff)
Merge branch 'master' into getters_for_function_and_operators
Diffstat (limited to 'tests/MathTest.php')
-rw-r--r--tests/MathTest.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/MathTest.php b/tests/MathTest.php
index 2b2727f..9bf8d97 100644
--- a/tests/MathTest.php
+++ b/tests/MathTest.php
@@ -27,6 +27,18 @@ class MathTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($calculator->execute($expression), $phpResult);
}
+ public function testZeroDevision()
+ {
+ $calculator = new MathExecutor();
+ $this->assertEquals($calculator->execute('1 / 0'), 0);
+ }
+
+ public function testExponentiation()
+ {
+ $calculator = new MathExecutor();
+ $this->assertEquals($calculator->execute('10 ^ 2'), 100);
+ }
+
/**
* Expressions data provider
*/