public function testCreateProject_LexProject_IndexesCreated() { self::$environ = new LexiconMongoTestEnvironment(); self::$environ->clean(); $user1Id = self::$environ->createUser("user1name", "User1 Name", "*****@*****.**"); $user1 = new UserModel($user1Id); $srProject = null; $projectId = ProjectCommands::createProject(SF_TESTPROJECT, SF_TESTPROJECTCODE, LexProjectModel::LEXICON_APP, $user1->id->asString(), self::$environ->website, $srProject); $project = new LexProjectModel($projectId); $databaseName = $project->databaseName(); $collectionName = LexEntryModel::mapper($databaseName)->getCollectionName(); $indexCount = iterator_count(MongoStore::getCollectionIndexes($databaseName, $collectionName)); $this->assertTrue($indexCount >= 3); $index = ['key' => ['guid' => 1]]; $this->assertTrue(MongoStore::isAllIndexFieldNamesInCollection($index, $databaseName, $collectionName)); $collectionName = LexOptionListModel::mapper($databaseName)->getCollectionName(); $indexCount = iterator_count(MongoStore::getCollectionIndexes($databaseName, $collectionName)); $this->assertTrue($indexCount >= 2); $index = ['key' => ['code' => 1]]; $this->assertTrue(MongoStore::isAllIndexFieldNamesInCollection($index, $databaseName, $collectionName)); }