aboutsummaryrefslogtreecommitdiff
path: root/tests/MathTest.php
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2020-05-20 22:26:59 +0300
committerGitHub <noreply@github.com>2020-05-20 22:26:59 +0300
commit913cf0a1e8920dbcc18649fa173a0c7e6ba5d5ef (patch)
treebb1049748d4b6f12209d0a868fb17592b85789ea /tests/MathTest.php
parent949334d6c37d384800c639ba9941e94f5157f5ac (diff)
parent2c18fbb2452baa1839f9102b309de1967b30307d (diff)
Merge pull request #63 from phpfui/neonxp-ngv2.0.0
Update parameters and add back functions
Diffstat (limited to 'tests/MathTest.php')
-rw-r--r--tests/MathTest.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/MathTest.php b/tests/MathTest.php
index 958f14c..39ac649 100644
--- a/tests/MathTest.php
+++ b/tests/MathTest.php
@@ -203,7 +203,7 @@ class MathTest extends TestCase
['(-3 * -1)'],
['1 + (-3 * -1)'],
['1 + ( -3 * 1)'],
- ['1 + (3 * -1)'],
+ ['1 + (3 *-1)'],
['1 - 0'],
['1-0'],
];
@@ -226,12 +226,7 @@ class MathTest extends TestCase
public function testZeroDivision()
{
$calculator = new MathExecutor();
- $calculator->addOperator(new Operator("/", false, 180, function ($a, $b) {
- if ($b == 0) {
- return 0;
- }
- return $a / $b;
- }));
+ $calculator->setDivisionByZeroIsZero();
$this->assertEquals(0, $calculator->execute('10 / 0'));
}