public function testCanReplayQueue()
 {
     $results = '';
     $q = new PriorityQueue();
     $q->insert('a', 1);
     $q->insert('b', 1);
     $q->insert('c', 1);
     foreach ($q as $v) {
         $results .= $v;
     }
     foreach ($q as $v) {
         $results .= $v;
     }
     $this->assertEquals('abcabc', $results);
 }
Esempio n. 2
0
 /**
  * Check to see if there are more events left in the filter.
  *
  * @return bool
  */
 public function hasEvents()
 {
     return $this->queue->valid();
 }