diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/IdConflictTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/IdConflictTestBase.php index adaae9f0ef..46a8f432ff 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/IdConflictTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/IdConflictTestBase.php @@ -2,13 +2,11 @@ namespace Drupal\Tests\migrate_drupal_ui\Functional; - use Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait; +use Drupal\Tests\migrate_drupal\Traits\CreateTestContentEntitiesTrait; - /** - * Provides a base class for testing the review step of the Upgrade form. - * - * When using this test class, enable translation modules. - */ +/** + * Tests the ID Conflict form. + */ abstract class IdConflictTestBase extends MigrateUpgradeTestBase { use CreateTestContentEntitiesTrait; @@ -26,26 +24,7 @@ abstract class IdConflictTestBase extends MigrateUpgradeTestBase { public static $modules = ['migrate_drupal_ui']; /** - * Tests the migrate upgrade review form. - * - * The upgrade review form displays a list of modules that will be upgraded - * and a list of modules that will not be upgraded. This test is to ensure - * that the review page works correctly for all contributed Drupal 6 and - * Drupal 7 modules that have moved to core, e.g. Views, and for modules that - * were in Drupal 6 or Drupal 7 core but are not in Drupal 8 core, e.g. - * Overlay. - * - * To do this all modules in the source fixtures are enabled, except test and - * example modules. This means that we can test that the modules that do not - * need any migrations, such as Overlay, since there will be no available - * migrations which declare those modules as their source_module. It is - * assumed that the test fixtures include all modules that have moved to or - * dropped from core. - * - * The upgrade review form will also display errors for each migration that - * does not have a source_module definition. That function is not tested here. - * - * @see \Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase + * Tests the ID conflict form. */ public function testIdConflictPage() { $this->prepare(); @@ -165,4 +144,3 @@ protected function getEntityCountsIncremental() { } } - diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php index 7038e7b378..7cb4ee2743 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeExecuteTestBase.php @@ -112,8 +112,6 @@ public function testMigrateUpgradeExecute() { 'file', 'taxonomy_term', 'user', - 'comment', - 'node', ]; $this->assertIdConflict($session, $entity_types); diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php index b49c6510f9..a2782aec6d 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php @@ -1,19 +1,17 @@ pageTextContains(t('The no_source_module plugin must define the source_module property.')); // Uninstall the module causing the missing module error messages. - $this->container->get('module_installer')->uninstall(['migration_provider_test'], TRUE); + $this->container->get('module_installer') + ->uninstall(['migration_provider_test'], TRUE); // Test the file sources. $this->drupalGet('/upgrade'); @@ -170,23 +173,4 @@ public function testMigrateUpgradeExecute() { $this->assertIdConflict($session, $entity_types); } - /** - * Tests that follow-up migrations have been run successfully. - */ - protected function assertFollowUpMigrationResults() { - $node = Node::load(10); - $this->assertSame('12', $node->get('field_reference')->target_id); - $this->assertSame('12', $node->get('field_reference_2')->target_id); - $translation = $node->getTranslation('fr'); - $this->assertSame('12', $translation->get('field_reference')->target_id); - $this->assertSame('12', $translation->get('field_reference_2')->target_id); - - $node = Node::load(12)->getTranslation('en'); - $this->assertSame('10', $node->get('field_reference')->target_id); - $this->assertSame('10', $node->get('field_reference_2')->target_id); - $translation = $node->getTranslation('fr'); - $this->assertSame('10', $translation->get('field_reference')->target_id); - $this->assertSame('10', $translation->get('field_reference_2')->target_id); - } - } diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php similarity index 75% copy from core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php copy to core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php index b49c6510f9..215b6198bb 100644 --- a/core/modules/migrate_drupal_ui/tests/src/Functional/d6/IdConflictTest.php +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/IdConflictTest.php @@ -2,34 +2,32 @@ namespace Drupal\Tests\migrate_drupal_ui\Functional\d6; - use Drupal\node\Entity\Node; - use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase; - - /** - * Tests Drupal 6 Id Conflict page. - * - * The test method is provided by the MigrateUpgradeTestBase class. - * - * @group migrate_drupal_ui - * - * @group legacy - */ +use Drupal\Tests\migrate_drupal_ui\Functional\MigrateUpgradeExecuteTestBase; + +/** + * Tests Drupal 7 Id Conflict page. + * + * The test method is provided by the MigrateUpgradeTestBase class. + * + * @group migrate_drupal_ui + * @group legacy + */ class IdConflictTest extends MigrateUpgradeExecuteTestBase { /** - * Modules to enable. - * - * @var array + * {@inheritdoc} */ public static $modules = [ + 'file', 'language', - 'content_translation', 'config_translation', + 'content_translation', 'migrate_drupal_ui', 'telephone', 'aggregator', 'book', 'forum', + 'rdf', 'statistics', 'migration_provider_test', // Required for translation migrations. @@ -62,22 +60,26 @@ protected function getSourceBasePath() { /** * {@inheritdoc} */ - protected function getEntityCounts() {} + protected function getEntityCounts() { + } /** * {@inheritdoc} */ - protected function getEntityCountsIncremental() {} + protected function getEntityCountsIncremental() { + } /** * {@inheritdoc} */ - protected function getAvailablePaths() {} + protected function getAvailablePaths() { + } /** * {@inheritdoc} */ - protected function getMissingPaths() {} + protected function getMissingPaths() { + } /** * Executes all steps of migrations upgrade. @@ -128,7 +130,8 @@ public function testMigrateUpgradeExecute() { $session->pageTextContains(t('The no_source_module plugin must define the source_module property.')); // Uninstall the module causing the missing module error messages. - $this->container->get('module_installer')->uninstall(['migration_provider_test'], TRUE); + $this->container->get('module_installer') + ->uninstall(['migration_provider_test'], TRUE); // Test the file sources. $this->drupalGet('/upgrade'); @@ -170,23 +173,4 @@ public function testMigrateUpgradeExecute() { $this->assertIdConflict($session, $entity_types); } - /** - * Tests that follow-up migrations have been run successfully. - */ - protected function assertFollowUpMigrationResults() { - $node = Node::load(10); - $this->assertSame('12', $node->get('field_reference')->target_id); - $this->assertSame('12', $node->get('field_reference_2')->target_id); - $translation = $node->getTranslation('fr'); - $this->assertSame('12', $translation->get('field_reference')->target_id); - $this->assertSame('12', $translation->get('field_reference_2')->target_id); - - $node = Node::load(12)->getTranslation('en'); - $this->assertSame('10', $node->get('field_reference')->target_id); - $this->assertSame('10', $node->get('field_reference_2')->target_id); - $translation = $node->getTranslation('fr'); - $this->assertSame('10', $translation->get('field_reference')->target_id); - $this->assertSame('10', $translation->get('field_reference_2')->target_id); - } - } diff --git a/core/modules/node/tests/modules/node_migrate_master/node_migrate_master.module.php b/core/modules/node/tests/modules/node_migrate_master/node_migrate_master.module.php index a4abe2dafc..b3d9bbc7f3 100644 --- a/core/modules/node/tests/modules/node_migrate_master/node_migrate_master.module.php +++ b/core/modules/node/tests/modules/node_migrate_master/node_migrate_master.module.php @@ -1,2 +1 @@