public function __construct(Clock $clock) { $this->timers = new SplObjectStorage(); $this->scheduler = new SplPriorityQueue(); $clock->on('tick', array($this, 'tick')); }
public function testTickShouldNotEmitIfResumed() { $clock = new Clock($this->getPulseMock()); $boolean = false; $clock->on('tick', function () use(&$boolean) { $boolean = true; }); $clock->pause(); $clock->resume(); $clock->tick(); $this->assertTrue($boolean); }