Exemplo n.º 1
0
 public function __construct(Pulse $pulse = null)
 {
     $this->timers = new Timers($this);
     $this->pulse = $pulse ?: Pulse::getInstance();
     $this->pulseCallback = array($this, 'tick');
     $this->pulse->on('tick', $this->pulseCallback);
 }
Exemplo n.º 2
0
 public function testBeatShouldNotEmitIfStopped()
 {
     $pulse = new Pulse();
     $pulse->stop();
     $boolean = false;
     $pulse->on('tick', function () use(&$boolean) {
         $boolean = true;
     });
     $pulse->beat();
     $this->assertFalse($boolean);
 }