diff options
author | Alexander Kiryukhin <alexander@kiryukhin.su> | 2018-09-12 20:05:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-12 20:05:09 +0300 |
commit | 4a672cfd94c07e1821227f27fd1edd2217685136 (patch) | |
tree | c50b777d06d9e9eeff6aeb59005c389ddf9a552b /tests/MathTest.php | |
parent | 76d1b4b8f02d555e4b4f4fd4d641597f0f6b5f4e (diff) | |
parent | 2722a5201d326317e391ae6c0e2fa7e0c2b537b4 (diff) |
Merge pull request #28 from phpfui/support_for_double_quoted_strings
Support for double quoted strings
Diffstat (limited to 'tests/MathTest.php')
-rw-r--r-- | tests/MathTest.php | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/MathTest.php b/tests/MathTest.php index 9bf8d97..db6e486 100644 --- a/tests/MathTest.php +++ b/tests/MathTest.php @@ -27,7 +27,7 @@ class MathTest extends \PHPUnit_Framework_TestCase $this->assertEquals($calculator->execute($expression), $phpResult); } - public function testZeroDevision() + public function testZeroDivision() { $calculator = new MathExecutor(); $this->assertEquals($calculator->execute('1 / 0'), 0); @@ -44,35 +44,35 @@ class MathTest extends \PHPUnit_Framework_TestCase */ public function providerExpressions() { - return array( - array('0.1 + 0.2'), - array('1 + 2'), + return [ + ['0.1 + 0.2'], + ['1 + 2'], - array('0.1 - 0.2'), - array('1 - 2'), + ['0.1 - 0.2'], + ['1 - 2'], - array('0.1 * 2'), - array('1 * 2'), + ['0.1 * 2'], + ['1 * 2'], - array('0.1 / 0.2'), - array('1 / 2'), + ['0.1 / 0.2'], + ['1 / 2'], - array('2 * 2 + 3 * 3'), + ['2 * 2 + 3 * 3'], - array('1 + 0.6 - 3 * 2 / 50'), + ['1 + 0.6 - 3 * 2 / 50'], - array('(5 + 3) * -1'), + ['(5 + 3) * -1'], - array('2+2*2'), - array('(2+2)*2'), - array('(2+2)*-2'), - array('(2+-2)*2'), + ['2+2*2'], + ['(2+2)*2'], + ['(2+2)*-2'], + ['(2+-2)*2'], - array('sin(10) * cos(50) / min(10, 20/2)'), + ['sin(10) * cos(50) / min(10, 20/2)'], - array('100500 * 3.5E5'), - array('100500 * 3.5E-5') - ); + ['100500 * 3.5E5'], + ['100500 * 3.5E-5'], + ]; } public function testFunction() |