+ Test for division by zero
This commit is contained in:
parent
fd7a113b95
commit
fa935b0af6
1 changed files with 7 additions and 1 deletions
|
@ -27,6 +27,12 @@ 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Expressions data provider
|
||||
*/
|
||||
|
@ -62,4 +68,4 @@ class MathTest extends \PHPUnit_Framework_TestCase
|
|||
array('100500 * 3.5E-5')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue