/** * @test * @dataProvider roundExamples */ public function roundWorks($value, $precision, $expected) { $helper = new MathHelper(); $result = $helper->round($value, $precision); if ($expected === static::NAN) { $this->assertTrue(is_nan($result), 'Expected NAN'); } else { $this->assertEquals($expected, $result, 'Rounded value did not match', 0.0001); } }