summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2018-05-18 07:30:54 (GMT)
committerAlex Pott2018-05-18 07:30:54 (GMT)
commit9f76972c25ea4e881291c8c92d9c8d3094921359 (patch)
tree4c9329bc2b5fafd94dbbb6f0a02d6b33a3651c0d
parentf22c3b0952f9bedf5cacf0a6c5a8bd1142119d71 (diff)
Issue #2960013 by quietone, Jo Fitzgerald, mikeryan, alexpott: i18n menu links translation in wrong directory
-rw-r--r--core/modules/content_translation/migrations/d6_menu_links_translation.yml (renamed from core/modules/menu_link_content/migrations/d6_menu_links_translation.yml)0
-rw-r--r--core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php7
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeI18nReviewPageTestBase.php45
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php114
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6I18nReviewPageTest.php151
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6ReviewPageTest.php16
-rw-r--r--core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php16
7 files changed, 293 insertions, 56 deletions
diff --git a/core/modules/menu_link_content/migrations/d6_menu_links_translation.yml b/core/modules/content_translation/migrations/d6_menu_links_translation.yml
index 71e5599..71e5599 100644
--- a/core/modules/menu_link_content/migrations/d6_menu_links_translation.yml
+++ b/core/modules/content_translation/migrations/d6_menu_links_translation.yml
diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php
index 21911f0..4863dde 100644
--- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php
+++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d6/MigrateMenuLinkTranslationTest.php
@@ -15,7 +15,12 @@ class MigrateMenuLinkTranslationTest extends MigrateDrupal6TestBase {
/**
* {@inheritdoc}
*/
- public static $modules = ['menu_ui', 'menu_link_content', 'language'];
+ public static $modules = [
+ 'menu_ui',
+ 'menu_link_content',
+ 'language',
+ 'content_translation',
+ ];
/**
* {@inheritdoc}
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeI18nReviewPageTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeI18nReviewPageTestBase.php
new file mode 100644
index 0000000..8a57115
--- /dev/null
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeI18nReviewPageTestBase.php
@@ -0,0 +1,45 @@
+<?php
+
+namespace Drupal\Tests\migrate_drupal_ui\Functional;
+
+/**
+ * Tests the upgrade review form without translations.
+ *
+ * When using this test class do not enable content_translation.
+ */
+abstract class MigrateUpgradeI18nReviewPageTestBase extends MigrateUpgradeReviewPageTestBase {
+
+ /**
+ * Tests the review page when content_translation is enabled.
+ */
+ public function testMigrateUpgradeReviewPage() {
+ $this->prepare();
+ // Start the upgrade process.
+ $this->drupalGet('/upgrade');
+ $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, $this->edits, t('Review upgrade'));
+
+ $session = $this->assertSession();
+ $session->pageTextContains('WARNING: Content may be overwritten on your new site.');
+ $session->pageTextContains('There is conflicting content of these types:');
+ $session->pageTextContains('taxonomy terms');
+ $session->pageTextNotContains('There is translated content of these types:');
+ $session->pageTextNotContains('custom menu links');
+
+ $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
+ $session->statusCodeEquals(200);
+
+ // Ensure there are no errors about missing modules from the test module.
+ $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);
+ }
+
+}
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php
index 54fb0ba..5c97a69 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeReviewPageTestBase.php
@@ -12,21 +12,16 @@ abstract class MigrateUpgradeReviewPageTestBase extends MigrateUpgradeTestBase {
use CreateTestContentEntitiesTrait;
/**
+ * An array suitable for drupalPostForm().
+ *
+ * @var array
+ */
+ protected $edits = [];
+
+ /**
* {@inheritdoc}
*/
- public static $modules = [
- 'language',
- 'content_translation',
- 'migrate_drupal_ui',
- 'telephone',
- 'aggregator',
- 'book',
- 'forum',
- 'statistics',
- 'syslog',
- 'tracker',
- 'update',
- ];
+ public static $modules = ['migrate_drupal_ui'];
/**
* Tests the migrate upgrade review form.
@@ -51,6 +46,56 @@ abstract class MigrateUpgradeReviewPageTestBase extends MigrateUpgradeTestBase {
* @see \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase
*/
public function testMigrateUpgradeReviewPage() {
+ $this->prepare();
+ // Start the upgrade process.
+ $this->drupalGet('/upgrade');
+ $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, $this->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);
+
+ // Check there are no errors when a module in noUpgradePaths is not in the
+ // source system tables. Test with a module that is listed in noUpgradePaths
+ // for both Drupal 6 and Drupal 7.
+ // @see \Drupal\migrate_drupal_ui\Form\ReviewForm::$noUpgradePaths
+ $module = 'help';
+ $query = $this->sourceDatabase->delete('system');
+ $query->condition('type', 'module');
+ $query->condition('name', $module);
+ $query->execute();
+
+ // Start the upgrade process.
+ $this->drupalGet('/upgrade');
+ $this->drupalPostForm(NULL, [], t('Continue'));
+ $this->drupalPostForm(NULL, $this->edits, t('Review upgrade'));
+ $this->drupalPostForm(NULL, [], t('I acknowledge I may lose data. Continue anyway.'));
+
+ // Test the upgrade paths.
+ $available_paths = $this->getAvailablePaths();
+ $available_paths = array_diff($available_paths, [$module]);
+ $missing_paths = $this->getMissingPaths();
+ $this->assertUpgradePaths($session, $available_paths, $missing_paths);
+ }
+
+ /**
+ * Performs preparation for the form tests.
+ *
+ * This is not done in setup because setup executes before the source database
+ * is loaded.
+ */
+ public function prepare() {
$connection_options = $this->sourceDatabase->getConnectionOptions();
$driver = $connection_options['driver'];
$connection_options['prefix'] = $connection_options['prefix']['default'];
@@ -75,7 +120,7 @@ abstract class MigrateUpgradeReviewPageTestBase extends MigrateUpgradeTestBase {
if (count($drivers) !== 1) {
$edit['driver'] = $driver;
}
- $edits = $this->translatePostValues($edit);
+ $this->edits = $this->translatePostValues($edit);
// Enable all modules in the source except test and example modules, but
// include simpletest.
@@ -91,47 +136,6 @@ abstract class MigrateUpgradeReviewPageTestBase extends MigrateUpgradeTestBase {
$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);
-
- // Check there are no errors when a module in noUpgradePaths is not in the
- // source system tables. Test with a module that is listed in noUpgradePaths
- // for both Drupal 6 and Drupal 7.
- // @see \Drupal\migrate_drupal_ui\Form\ReviewForm::$noUpgradePaths
- $module = 'help';
- $query = $this->sourceDatabase->delete('system');
- $query->condition('type', 'module');
- $query->condition('name', $module);
- $query->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.'));
-
- // Test the upgrade paths.
- $available_paths = $this->getAvailablePaths();
- $available_paths = array_diff($available_paths, [$module]);
- $missing_paths = $this->getMissingPaths();
- $this->assertUpgradePaths($session, $available_paths, $missing_paths);
}
/**
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6I18nReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6I18nReviewPageTest.php
new file mode 100644
index 0000000..b70fe43
--- /dev/null
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6I18nReviewPageTest.php
@@ -0,0 +1,151 @@
+<?php
+
+namespace Drupal\Tests\migrate_drupal_ui\Functional\d6;
+
+use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeI18nReviewPageTestBase;
+
+/**
+ * Tests migrate upgrade review page for Drupal 6 without translations.
+ *
+ * @group migrate_drupal_6
+ * @group migrate_drupal_ui
+ */
+class MigrateUpgrade6I18nReviewPageTest extends MigrateUpgradeI18nReviewPageTestBase {
+
+ /**
+ * {@inheritdoc}
+ */
+ public static $modules = [
+ 'language',
+ 'telephone',
+ 'aggregator',
+ 'book',
+ 'forum',
+ 'statistics',
+ 'syslog',
+ 'tracker',
+ 'update',
+ ];
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function setUp() {
+ parent::setUp();
+ $this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal6.php');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function getSourceBasePath() {
+ return __DIR__ . '/files';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function getAvailablePaths() {
+ return [
+ 'aggregator',
+ 'block',
+ 'book',
+ 'comment',
+ 'contact',
+ 'content',
+ 'date',
+ 'dblog',
+ 'email',
+ 'filefield',
+ 'filter',
+ 'forum',
+ 'i18ntaxonomy',
+ 'imagecache',
+ 'imagefield',
+ 'language',
+ 'link',
+ 'locale',
+ 'menu',
+ 'node',
+ 'nodereference',
+ 'optionwidgets',
+ 'path',
+ 'profile',
+ 'search',
+ 'statistics',
+ 'syslog',
+ 'system',
+ 'taxonomy',
+ 'text',
+ 'update',
+ 'upload',
+ 'user',
+ 'userreference',
+ // Include modules that do not have an upgrade path, defined in the
+ // $noUpgradePath property in MigrateUpgradeForm.
+ 'blog',
+ 'blogapi',
+ 'calendarsignup',
+ 'color',
+ 'content_copy',
+ 'content_multigroup',
+ 'content_permissions',
+ 'date_api',
+ 'date_locale',
+ 'date_php4',
+ 'date_popup',
+ 'date_repeat',
+ 'date_timezone',
+ 'date_tools',
+ 'datepicker',
+ 'ddblock',
+ 'event',
+ 'fieldgroup',
+ 'filefield_meta',
+ 'help',
+ 'i18n',
+ 'i18nstrings',
+ 'imageapi',
+ 'imageapi_gd',
+ 'imageapi_imagemagick',
+ 'imagecache_ui',
+ 'jquery_ui',
+ 'nodeaccess',
+ 'number',
+ 'openid',
+ 'php',
+ 'ping',
+ 'poll',
+ 'throttle',
+ 'tracker',
+ 'translation',
+ 'trigger',
+ 'variable',
+ 'variable_admin',
+ 'views_export',
+ 'views_ui',
+ ];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function getMissingPaths() {
+ return [
+ 'devel',
+ 'devel_generate',
+ 'devel_node_access',
+ 'i18nblocks',
+ 'i18ncck',
+ 'i18ncontent',
+ 'i18nmenu',
+ 'i18npoll',
+ 'i18nprofile',
+ 'i18nsync',
+ 'i18nviews',
+ 'phone',
+ 'views',
+ ];
+ }
+
+}
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6ReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6ReviewPageTest.php
index 798f029..1eeb326 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6ReviewPageTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MigrateUpgrade6ReviewPageTest.php
@@ -15,6 +15,22 @@ class MigrateUpgrade6ReviewPageTest extends MigrateUpgradeReviewPageTestBase {
/**
* {@inheritdoc}
*/
+ public static $modules = [
+ 'language',
+ 'content_translation',
+ 'telephone',
+ 'aggregator',
+ 'book',
+ 'forum',
+ 'statistics',
+ 'syslog',
+ 'tracker',
+ 'update',
+ ];
+
+ /**
+ * {@inheritdoc}
+ */
protected function setUp() {
parent::setUp();
$this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal6.php');
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php
index 12b6616..44fe25d 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MigrateUpgrade7ReviewPageTest.php
@@ -15,6 +15,22 @@ class MigrateUpgrade7ReviewPageTest extends MigrateUpgradeReviewPageTestBase {
/**
* {@inheritdoc}
*/
+ public static $modules = [
+ 'language',
+ 'content_translation',
+ 'telephone',
+ 'aggregator',
+ 'book',
+ 'forum',
+ 'statistics',
+ 'syslog',
+ 'tracker',
+ 'update',
+ ];
+
+ /**
+ * {@inheritdoc}
+ */
protected function setUp() {
parent::setUp();
$this->loadFixture(drupal_get_path('module', 'migrate_drupal') . '/tests/fixtures/drupal7.php');