Exemple #1
0
 public function testTimerFunctionReceivesTimerSignature()
 {
     declare (ticks=1);
     $clock = new Clock();
     $clock->addPeriodicTimer(1, function ($signature) use($clock) {
         $clock->clear($signature);
     });
     $start = microtime(true);
     $clock->block();
     $duration = microtime(true) - $start;
     $this->assertGreaterThan(1, $duration);
     $this->assertLessThan(1.001, $duration);
 }