migrateControllerClass = MigrateController::className(); $this->migrationBaseClass = Migration::className(); parent::setUp(); $this->setUpMigrationPath(); Yii::$app->setComponents(['mongodb' => $this->getConnection()]); } public function tearDown() { parent::tearDown(); if (extension_loaded('mongo')) { try { $this->getConnection()->getCollection('migration')->drop(); } catch (Exception $e) { // shutdown exception } } $this->tearDownMigrationPath(); } /** * @return array applied migration entries */ protected function getMigrationHistory() { $query = new Query(); return $query->from('migration')->all(); } }