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); }
public function testBeatShouldNotEmitIfStopped() { $pulse = new Pulse(); $pulse->stop(); $boolean = false; $pulse->on('tick', function () use(&$boolean) { $boolean = true; }); $pulse->beat(); $this->assertFalse($boolean); }