Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DivisionTest.php
Go to the documentation of this file.
1 <?php
7 
8 class DivisionTest extends \PHPUnit\Framework\TestCase
9 {
13  public function testGetExactDivision($dividend, $divisor, $expected)
14  {
15  $mathDivision = new \Magento\Framework\Math\Division();
16  $remainder = $mathDivision->getExactDivision($dividend, $divisor);
17  $this->assertEquals($expected, $remainder);
18  }
19 
23  public function getExactDivisionDataProvider()
24  {
25  return [
26  [17, 3 , 2],
27  [7.7, 2 , 1.7],
28  [17.8, 3.2 , 1.8],
29  [11.7, 1.7 , 1.5],
30  [8, 2, 0]
31  ];
32  }
33 }
testGetExactDivision($dividend, $divisor, $expected)