Exemplo n.º 1
0
 /**
  * @covers h4kuna\DataType\Validator\Float::fromHour
  * @todo   Implement testFromHour().
  */
 public function testFromHour()
 {
     $this->assertSame(0.0, Floats::fromHour('0:0:0'));
     $this->assertSame(1.5, Floats::fromHour('1:30'));
     $this->assertSame(1.5, Floats::fromHour('1:30:0'));
     $this->assertSame(1.5083, round(Floats::fromHour('1:30:30'), 4));
 }
Exemplo n.º 2
0
 /**
  * @dataProvider provideTestFilter
  */
 public function testFilter($options, $raw, $filtered, $valid)
 {
     $int = new Floats($options);
     $this->assertEquals($filtered, $int->filter($raw));
     $this->assertEquals($valid, $int->validate($raw));
 }