sourceDatabase->getConnectionOptions(); $driver = $connection_options['driver']; $connection_options['prefix'] = $connection_options['prefix']['default']; // Use the driver connection form to get the correct options out of the // database settings. This supports all of the databases we test against. $drivers = drupal_get_database_types(); $form = $drivers[$driver]->getFormOptions($connection_options); $connection_options = array_intersect_key($connection_options, $form + $form['advanced_options']); $version = $this->getLegacyDrupalVersion($this->sourceDatabase); $edit = [ $driver => $connection_options, 'source_private_file_path' => $this->getSourceBasePath(), 'version' => $version, ]; if ($version == 6) { $edit['d6_source_base_path'] = $this->getSourceBasePath(); } else { $edit['source_base_path'] = $this->getSourceBasePath(); } if (count($drivers) !== 1) { $edit['driver'] = $driver; } $edits = $this->translatePostValues($edit); // Enable all modules in the source except test and example modules, but // include simpletest. /** @var \Drupal\Core\Database\Query\SelectInterface $update */ $update = $this->sourceDatabase->update('system') ->fields(['status' => 1]) ->condition('type', 'module'); $and = $update->andConditionGroup() ->condition('name', '%test%', 'NOT LIKE') ->condition('name', '%example%', 'NOT LIKE'); $conditions = $update->orConditionGroup(); $conditions->condition($and); $conditions->condition('name', 'simpletest'); $update->condition($conditions); $update->execute(); // Start the upgrade process. $this->drupalGet('/upgrade'); $this->drupalPostForm(NULL, [], t('Continue')); $this->drupalPostForm(NULL, $edits, t('Review upgrade')); $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.')); // Ensure there are no errors about missing modules from the test module. $session = $this->assertSession(); $session->pageTextNotContains(t('Source module not found for migration_provider_no_annotation.')); $session->pageTextNotContains(t('Source module not found for migration_provider_test.')); $session->pageTextNotContains(t('Destination module not found for migration_provider_test')); // Ensure there are no errors about any other missing migration providers. $session->pageTextNotContains(t('module not found')); // Test the upgrade paths. $available_paths = $this->getAvailablePaths(); $missing_paths = $this->getMissingPaths(); $this->assertUpgradePaths($session, $available_paths, $missing_paths); } /** * {@inheritdoc} */ protected function getEntityCounts() { return []; } /** * {@inheritdoc} */ protected function getEntityCountsIncremental() { return []; } }