public function testUpdateDocumentIndexesShouldDeleteUnmappedIndexesBeforeCreatingMappedIndexes()
{
$database = $this->documentDatabases[\Documents\CmsArticle::class];
$database->expects($this->once())->method('command')->with($this->callback(function ($c) {
return array_key_exists('deleteIndexes', $c);
}));
$collection = $this->documentCollections[\Documents\CmsArticle::class];
$collection->expects($this->once())->method('getIndexInfo')->will($this->returnValue(array(array('v' => 1, 'key' => array('topic' => -1), 'name' => 'topic_-1'))));
$collection->expects($this->once())->method('ensureIndex');
$collection->expects($this->any())->method('getDatabase')->will($this->returnValue($database));
$this->schemaManager->updateDocumentIndexes(\Documents\CmsArticle::class);
}