public function pop($n = 1, $timeout = 0) { $n = count($this->safeQueue->pop($n, $timeout)); if ($n) { return $this->mainQueue->pop($n, 0); } return []; }
public function test_unShift_and_pop() { $input = [1, 2, 3]; $this->queue->unShift($input); $output = $this->queue->pop(3); $this->assertEquals(array_reverse($input), $output); }