Example #1
0
 /**
  * @dataProvider isSimplifiedProvider
  * @covers ::isSimplified
  *
  * @param string $ratio
  * @param bool   $expected
  */
 public function testCanDetermineIfSimplified($ratio, bool $expected)
 {
     $ratio = Ratio::fromString($ratio);
     self::assertSame($expected, $ratio->isSimplified());
 }
Example #2
0
 /**
  * @dataProvider ratioToExpectedDecimalProvider
  * @covers ::create
  *
  * @param string $ratio
  * @param string $decimal
  */
 public function testCreateDelegatesToStaticRatioFactory(string $ratio, string $decimal, int $scale = null)
 {
     $decimal = Decimal::create($decimal, $scale);
     $ratio = Ratio::fromString($ratio);
     self::assertTrue($decimal->equals(Decimal::fromRatio($ratio, $scale)));
 }