DominionEnterprises\Mongo\QueueTest::ackSend PHP Method

ackSend() public method

public ackSend ( )
    public function ackSend()
    {
        $messageOne = ['key1' => 0, 'key2' => true];
        $messageThree = ['hi' => 'there', 'rawr' => 2];
        $this->queue->send($messageOne);
        $this->queue->send(['key' => 'value']);
        $resultOne = $this->queue->get($messageOne, PHP_INT_MAX, 0);
        $this->assertSame(2, $this->collection->count());
        $this->queue->ackSend($resultOne, $messageThree);
        $this->assertSame(2, $this->collection->count());
        $actual = $this->queue->get(['hi' => 'there'], PHP_INT_MAX, 0);
        $expected = ['id' => $resultOne['id']] + $messageThree;
        $actual['id'] = $actual['id']->__toString();
        $expected['id'] = $expected['id']->__toString();
        $this->assertSame($expected, $actual);
    }