Alcaeus\MongoDbAdapter\Tests\Mongo\MongoCollectionTest::testEnsureIndexAlreadyExists PHP Method

testEnsureIndexAlreadyExists() public method

    public function testEnsureIndexAlreadyExists()
    {
        $collection = $this->getCollection();
        $collection->ensureIndex(['bar' => 1], ['unique' => true]);
        $expected = ['createdCollectionAutomatically' => false, 'numIndexesBefore' => 2, 'numIndexesAfter' => 2, 'ok' => 1.0, 'note' => 'all indexes already exist'];
        $this->assertEquals($expected, $collection->ensureIndex(['bar' => 1], ['unique' => true]));
    }
MongoCollectionTest