DominionEnterprises\Mongo\QueueTest::ensureCountIndex PHP Method

ensureCountIndex() public method

public ensureCountIndex ( )
    public function ensureCountIndex()
    {
        $this->queue->ensureCountIndex(['type' => 1, 'boo' => -1], false);
        $this->queue->ensureCountIndex(['another.sub' => 1], true);
        $indexes = iterator_to_array($this->collection->listIndexes());
        $this->assertSame(3, count($indexes));
        $expectedOne = ['payload.type' => 1, 'payload.boo' => -1];
        $this->assertSame($expectedOne, $indexes[1]['key']);
        $expectedTwo = ['running' => 1, 'payload.another.sub' => 1];
        $this->assertSame($expectedTwo, $indexes[2]['key']);
    }