$new_items[] =
$item->data;
// All dequeued items should match the items we queued exactly once,
// therefore the score must be exactly 4.
$this->
assertEquals(4,
$this->
queueScore($data,
$new_items), 'Four items matched'
);
// There should be no duplicate items.
$this->
assertEquals(4,
$this->
queueScore($new_items,
$new_items), 'Four items matched'
);
// Delete all items from queue1.
foreach ($items as $item) { $queue1->
deleteItem($item);
} // Check that both queues are empty.
$this->
assertSame(0,
$queue1->
numberOfItems(), 'Queue 1 is empty'
);
$this->
assertSame(0,
$queue2->
numberOfItems(), 'Queue 2 is empty'
);
} /**
* Returns the number of equal items in two arrays.
*/
protected function queueScore($items,
$new_items) {