Example #1
0
 /**
  * Test getting the current time in micro seconds.
  * Again, testing against the current time makes the test fragile.
  * Testing against a return type at least ensures a valid result.
  */
 public function testCurrentMicro()
 {
     $testTime = new SystemTime();
     $currentMicro = $testTime->currentMicro();
     $this->assertInternalType('float', $currentMicro);
     $this->assertGreaterThan(0, $currentMicro);
 }
Example #2
0
 public function current()
 {
     $this->updateQueue();
     if (isset($this->permanentCurrent)) {
         return $this->permanentCurrent;
     }
     if (isset($this->upcomingCurrent)) {
         return $this->upcomingCurrent;
     }
     return parent::current();
 }