Exemple #1
0
 public function testFromTimeOfDay()
 {
     $i = $this->testCount;
     do {
         $tod = gettimeofday();
         $sec = $tod['sec'];
         $usec = $tod['usec'];
         $str = $sec . str_pad($tod['usec'], 6, '0', STR_PAD_LEFT);
         $m = Microtime::fromTimeOfDay($tod);
         $this->assertSame($sec, $m->getSeconds());
         $this->assertSame($sec, (int) $m->toDateTime()->format('U'));
         $this->assertSame($usec, $m->getMicroSeconds());
         $this->assertSame($str, $m->toString());
         --$i;
     } while ($i > 0);
 }