public function testEnsureIndexAlreadyExistsWithDifferentOptions()
{
$collection = $this->getCollection();
$collection->ensureIndex(['bar' => 1], ['unique' => true]);
$this->setExpectedException('MongoResultException', 'Index with name: bar_1 already exists with different options');
$collection->ensureIndex(['bar' => 1]);
}