/** * @test * @expectedException \Granam\Float\Tools\Exceptions\ValueLostOnCast * @dataProvider provideStrictness * @param bool $strict */ public function I_can_force_exception_in_case_of_rounding($strict) { try { $floatObject = new FloatObject($floatValue = '123456.999', $strict, true); self::assertSame((double) $floatValue, $floatObject->getValue()); } catch (\Exception $exception) { self::fail('Unexpected any exception here: ' . $exception->getMessage()); } new FloatObject('123456.999999999999999999999999999999999999', $strict, true); self::fail('Rounding has not been detected'); }