3 namespace Drupal\Tests\migrate_drupal_ui\Functional\d7;
5 use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase;
8 * Tests Drupal 6 upgrade without translations.
10 * The test method is provided by the MigrateUpgradeTestBase class.
12 * @group migrate_drupal_ui
14 class MigrateUpgrade7NoMultilingualTest extends MigrateUpgradeExecuteTestBase {
19 public static $modules = [
22 'content_translation',
35 protected function setUp() {
37 $this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal7.php');
43 protected function getSourceBasePath() {
44 return __DIR__ . '/files';
50 protected function getEntityCounts() {
52 'aggregator_item' => 11,
53 'aggregator_feed' => 1,
56 'block_content_type' => 1,
58 // The 'standard' profile provides the 'comment' comment type, and the
59 // migration creates 6 comment types, one per node type.
61 // Module 'language' comes with 'en', 'und', 'zxx'. Migration adds 'is'.
62 'configurable_language' => 4,
66 'field_storage_config' => 50,
70 'language_content_settings' => 2,
80 'taxonomy_term' => 18,
81 'taxonomy_vocabulary' => 4,
85 'menu_link_content' => 10,
88 'entity_form_display' => 17,
89 'entity_form_mode' => 1,
90 'entity_view_display' => 28,
91 'entity_view_mode' => 14,
92 'base_field_override' => 9,
99 protected function getEntityCountsIncremental() {
100 $counts = $this->getEntityCounts();
101 $counts['block_content'] = 2;
102 $counts['comment'] = 3;
104 $counts['menu_link_content'] = 11;
106 $counts['taxonomy_term'] = 19;
114 protected function getAvailablePaths() {
150 // Include modules that do not have an upgrade path and are enabled in the
151 // source database, defined in the $noUpgradePath property
152 // in MigrateUpgradeForm.
170 protected function getMissingPaths() {
172 // These modules are in the missing path list because they are installed
173 // on the source site but they are not installed on the destination site.
183 public function testMigrateUpgradeExecute() {
184 $connection_options = $this->sourceDatabase->getConnectionOptions();
185 $this->drupalGet('/upgrade');
186 $session = $this->assertSession();
187 $session->responseContains('Upgrade a site by importing its files and the data from its database into a clean and empty new install of Drupal 8.');
189 $button = $session->buttonExists('Continue');
191 $session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
193 $driver = $connection_options['driver'];
194 $connection_options['prefix'] = $connection_options['prefix']['default'];
196 // Use the driver connection form to get the correct options out of the
197 // database settings. This supports all of the databases we test against.
198 $drivers = drupal_get_database_types();
199 $form = $drivers[$driver]->getFormOptions($connection_options);
200 $connection_options = array_intersect_key($connection_options, $form + $form['advanced_options']);
201 $version = $this->getLegacyDrupalVersion($this->sourceDatabase);
203 $driver => $connection_options,
204 'version' => $version,
206 if (count($drivers) !== 1) {
207 $edit['driver'] = $driver;
209 $edits = $this->translatePostValues($edit);
210 $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
211 $session->pageTextContains("Install migrate_drupal_multilingual to run migration 'd7_system_maintenance_translation'.");