public function testQueue() { $queue = new Queue(); $method = $this->getMock('Helthe\\Component\\Segmentio\\Method\\MethodInterface'); $queue->enqueue($method); $this->assertSame($method, $queue->dequeue()); }
/** * {@inheritdoc} */ public function track($event, array $properties = array()) { $this->queue->enqueue(new TrackMethod($event, $properties)); }
/** * Renders a queue of library methods. * * @return string */ public function renderQueue(Queue $queue) { $render = ''; while ($method = $queue->dequeue(MethodInterface::BROWSER_PLATFORM)) { $render .= $this->renderMethod($method) . "\n"; } return trim($render); }