+ Test for division by zero

This commit is contained in:
Alexander Kiryukhin 2016-04-01 17:24:34 +03:00
parent fd7a113b95
commit fa935b0af6

View file

@ -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')
);
}
}
}