3 namespace Drupal\Tests\migrate_drupal_ui\Functional\d6;
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 MigrateUpgrade6NoMultilingualTest extends MigrateUpgradeExecuteTestBase {
19 public static $modules = [
21 'content_translation',
34 protected function setUp() {
36 $this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal6.php');
42 protected function getSourceBasePath() {
43 return __DIR__ . '/files';
49 protected function getEntityCounts() {
51 'aggregator_item' => 1,
52 'aggregator_feed' => 2,
55 'block_content_type' => 1,
57 // The 'standard' profile provides the 'comment' comment type, and the
58 // migration creates 12 comment types, one per node type.
61 'configurable_language' => 5,
64 'field_storage_config' => 63,
68 'language_content_settings' => 3,
71 // The 'book' module provides the 'book' node type, and the migration
72 // creates 12 node types.
81 'taxonomy_vocabulary' => 7,
85 'menu_link_content' => 8,
88 'entity_form_display' => 29,
89 'entity_form_mode' => 1,
90 'entity_view_display' => 55,
91 'entity_view_mode' => 14,
92 'base_field_override' => 38,
99 protected function getEntityCountsIncremental() {
100 $counts = $this->getEntityCounts();
101 $counts['block_content'] = 3;
102 $counts['comment'] = 7;
104 $counts['menu_link_content'] = 9;
105 $counts['node'] = 18;
106 $counts['taxonomy_term'] = 9;
108 $counts['view'] = 16;
115 protected function getAvailablePaths() {
148 // Include modules that do not have an upgrade path and are enabled in the
149 // source database, defined in the $noUpgradePath property
150 // in MigrateUpgradeForm.
167 protected function getMissingPaths() {
180 public function testMigrateUpgradeExecute() {
181 $connection_options = $this->sourceDatabase->getConnectionOptions();
182 $this->drupalGet('/upgrade');
183 $session = $this->assertSession();
184 $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.');
186 $button = $session->buttonExists('Continue');
188 $session->pageTextContains('Provide credentials for the database of the Drupal site you want to upgrade.');
190 $driver = $connection_options['driver'];
191 $connection_options['prefix'] = $connection_options['prefix']['default'];
193 // Use the driver connection form to get the correct options out of the
194 // database settings. This supports all of the databases we test against.
195 $drivers = drupal_get_database_types();
196 $form = $drivers[$driver]->getFormOptions($connection_options);
197 $connection_options = array_intersect_key($connection_options, $form + $form['advanced_options']);
198 $version = $this->getLegacyDrupalVersion($this->sourceDatabase);
200 $driver => $connection_options,
201 'version' => $version,
203 if (count($drivers) !== 1) {
204 $edit['driver'] = $driver;
206 $edits = $this->translatePostValues($edit);
207 $this->drupalPostForm(NULL, $edits, t('Review upgrade'));
208 $session->pageTextContains("Install migrate_drupal_multilingual to run migration 'd6_system_maintenance_translation'.");