Alcaeus\MongoDbAdapter\Tests\Mongo\MongoGridFSTest::testIndexesCreation PHP Method

testIndexesCreation() public method

public testIndexesCreation ( )
    public function testIndexesCreation()
    {
        $collection = $this->getGridFS();
        $id = $collection->storeBytes('abcd', ['foo' => 'bar', 'chunkSize' => 2]);
        $newChunksCollection = $this->getCheckDatabase()->selectCollection('fs.chunks');
        $indexes = iterator_to_array($newChunksCollection->listIndexes());
        $this->assertCount(2, $indexes);
        $index = $indexes[1];
        $this->assertSame(['files_id' => 1, 'n' => 1], $index->getKey());
        $this->assertTrue($index->isUnique());
    }