queueScore example

// Retrieve two items from queue1.     $items = [];
    $new_items = [];

    $items[] = $item = $queue1->claimItem();
    $new_items[] = $item->data;

    $items[] = $item = $queue1->claimItem();
    $new_items[] = $item->data;

    // First two dequeued items should match the first two items we queued.     $this->assertEquals(2, $this->queueScore($data$new_items), 'Two items matched');

    // Add two more items.     $queue1->createItem($data[2]);
    $queue1->createItem($data[3]);

    $this->assertSame(4, $queue1->numberOfItems(), 'Queue 1 is not empty after adding items.');
    $this->assertSame(0, $queue2->numberOfItems(), 'Queue 2 is empty while Queue 1 has items');

    $items[] = $item = $queue1->claimItem();
    $new_items[] = $item->data;

    
Home | Imprint | This part of the site doesn't use cookies.