From 91ab3cc309c39f7c57af942c65cccb1913bf1a41 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Tue, 14 Jul 2015 22:43:41 +0100 Subject: [PATCH] Issue #2514168 by phenaproxima, mikeryan, benjy: Streamline migrate_drupal integration tests --- .../migrate/src/Tests/MigrateTestBase.php | 35 ++++---- .../src/Tests/MigrateDrupalTestBase.php | 10 ++- .../src/Tests/d6/MigrateActionConfigsTest.php | 11 +-- .../Tests/d6/MigrateAggregatorConfigsTest.php | 11 +-- .../Tests/d6/MigrateAggregatorFeedTest.php | 12 +-- .../Tests/d6/MigrateAggregatorItemTest.php | 13 +-- .../src/Tests/d6/MigrateBlockContentTest.php | 23 +----- .../src/Tests/d6/MigrateBlockTest.php | 14 +--- .../src/Tests/d6/MigrateBookConfigsTest.php | 13 +-- .../src/Tests/d6/MigrateBookTest.php | 13 +-- .../Tests/d6/MigrateCckFieldValuesTest.php | 1 - .../src/Tests/d6/MigrateCommentTest.php | 29 +++---- .../src/Tests/d6/MigrateCommentTypeTest.php | 14 +--- .../d6/MigrateCommentVariableDisplayBase.php | 21 +---- ...ntVariableEntityFormDisplaySubjectTest.php | 14 +--- .../d6/MigrateCommentVariableFieldTest.php | 13 +-- .../d6/MigrateCommentVariableInstanceTest.php | 14 +--- .../Tests/d6/MigrateContactCategoryTest.php | 12 +-- .../Tests/d6/MigrateContactConfigsTest.php | 13 +-- .../src/Tests/d6/MigrateDateFormatTest.php | 13 +-- .../src/Tests/d6/MigrateDblogConfigsTest.php | 12 +-- .../src/Tests/d6/MigrateDrupal6Test.php | 81 +++++++++---------- .../d6/MigrateFieldFormatterSettingsTest.php | 21 ++--- .../src/Tests/d6/MigrateFieldInstanceTest.php | 23 ++---- .../src/Tests/d6/MigrateFieldTest.php | 22 ++--- .../d6/MigrateFieldWidgetSettingsTest.php | 23 ++---- .../src/Tests/d6/MigrateFileConfigsTest.php | 12 +-- .../src/Tests/d6/MigrateFileTest.php | 21 ++--- .../src/Tests/d6/MigrateFilterFormatTest.php | 14 +--- .../src/Tests/d6/MigrateForumConfigsTest.php | 11 +-- .../src/Tests/d6/MigrateLocaleConfigsTest.php | 11 +-- .../src/Tests/d6/MigrateMenuConfigsTest.php | 11 +-- .../src/Tests/d6/MigrateMenuLinkTest.php | 12 +-- .../src/Tests/d6/MigrateMenuTest.php | 11 +-- .../d6/MigrateNodeBundleSettingsTest.php | 26 +----- .../src/Tests/d6/MigrateNodeConfigsTest.php | 12 +-- .../src/Tests/d6/MigrateNodeRevisionTest.php | 11 +-- .../src/Tests/d6/MigrateNodeTestBase.php | 29 +++---- .../src/Tests/d6/MigrateNodeTypeTest.php | 13 +-- .../src/Tests/d6/MigrateSearchConfigsTest.php | 12 +-- .../src/Tests/d6/MigrateSearchPageTest.php | 11 +-- .../Tests/d6/MigrateSimpletestConfigsTest.php | 13 +-- .../Tests/d6/MigrateStatisticsConfigsTest.php | 12 +-- .../src/Tests/d6/MigrateSyslogConfigsTest.php | 11 +-- .../src/Tests/d6/MigrateSystemCronTest.php | 13 +-- .../src/Tests/d6/MigrateSystemFileTest.php | 13 +-- .../src/Tests/d6/MigrateSystemFilterTest.php | 13 +-- .../src/Tests/d6/MigrateSystemImageGdTest.php | 13 +-- .../src/Tests/d6/MigrateSystemImageTest.php | 13 +-- .../src/Tests/d6/MigrateSystemLoggingTest.php | 11 +-- .../Tests/d6/MigrateSystemMaintenanceTest.php | 13 +-- .../Tests/d6/MigrateSystemPerformanceTest.php | 13 +-- .../src/Tests/d6/MigrateSystemRssTest.php | 13 +-- .../src/Tests/d6/MigrateSystemSiteTest.php | 13 +-- .../Tests/d6/MigrateTaxonomyConfigsTest.php | 11 +-- .../src/Tests/d6/MigrateTaxonomyTermTest.php | 20 ++--- .../d6/MigrateTaxonomyVocabularyTest.php | 12 +-- .../src/Tests/d6/MigrateTermNodeTestBase.php | 23 +++--- .../src/Tests/d6/MigrateTextConfigsTest.php | 11 +-- .../src/Tests/d6/MigrateUpdateConfigsTest.php | 11 +-- .../src/Tests/d6/MigrateUploadBase.php | 17 ++-- .../d6/MigrateUploadEntityDisplayTest.php | 13 +-- .../d6/MigrateUploadEntityFormDisplayTest.php | 14 +--- .../src/Tests/d6/MigrateUploadFieldTest.php | 6 +- .../Tests/d6/MigrateUploadInstanceTest.php | 12 +-- .../src/Tests/d6/MigrateUploadTest.php | 6 +- .../src/Tests/d6/MigrateUrlAliasTest.php | 11 +-- .../src/Tests/d6/MigrateUserConfigsTest.php | 16 +--- .../d6/MigrateUserContactSettingsTest.php | 23 ++---- .../MigrateUserPictureEntityDisplayTest.php | 8 +- ...igrateUserPictureEntityFormDisplayTest.php | 8 +- .../Tests/d6/MigrateUserPictureFieldTest.php | 6 +- .../Tests/d6/MigrateUserPictureFileTest.php | 18 ++--- .../d6/MigrateUserPictureInstanceTest.php | 6 +- .../MigrateUserProfileEntityDisplayTest.php | 23 +++--- ...igrateUserProfileEntityFormDisplayTest.php | 21 ++--- .../MigrateUserProfileFieldInstanceTest.php | 23 ++---- .../Tests/d6/MigrateUserProfileFieldTest.php | 21 ++--- .../Tests/d6/MigrateUserProfileValuesTest.php | 22 +++-- .../src/Tests/d6/MigrateUserRoleTest.php | 22 ++--- .../src/Tests/d6/MigrateUserTest.php | 33 +++----- .../src/Tests/d6/MigrateViewModesTest.php | 21 ++--- .../d6/MigrateVocabularyEntityDisplayTest.php | 13 +-- ...MigrateVocabularyEntityFormDisplayTest.php | 14 +--- .../d6/MigrateVocabularyFieldInstanceTest.php | 12 +-- .../Tests/d6/MigrateVocabularyFieldTest.php | 12 +-- .../d7/MigrateAggregatorSettingsTest.php | 10 +-- .../dependencies/MigrateDependenciesTest.php | 5 +- 88 files changed, 366 insertions(+), 1000 deletions(-) diff --git a/core/modules/migrate/src/Tests/MigrateTestBase.php b/core/modules/migrate/src/Tests/MigrateTestBase.php index 967f7726cb19..c3fd6ced6577 100644 --- a/core/modules/migrate/src/Tests/MigrateTestBase.php +++ b/core/modules/migrate/src/Tests/MigrateTestBase.php @@ -8,7 +8,9 @@ namespace Drupal\migrate\Tests; use Drupal\Core\Database\Database; +use Drupal\migrate\Entity\Migration; use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrateExecutable; use Drupal\migrate\MigrateMessageInterface; use Drupal\migrate\Row; use Drupal\simpletest\KernelTestBase; @@ -73,21 +75,6 @@ protected function tearDown() { parent::tearDown(); } - /** - * Prepare the migration. - * - * @param \Drupal\migrate\Entity\MigrationInterface $migration - * The migration object. - * @param array $files - * An array of files. - */ - protected function prepare(MigrationInterface $migration, array $files = array()) { - $this->loadDumps($files); - if ($this instanceof MigrateDumpAlterInterface) { - static::migrateDumpAlter($this); - } - } - /** * Load Drupal 6 database dumps to be used. * @@ -96,7 +83,7 @@ protected function prepare(MigrationInterface $migration, array $files = array() * @param string $method * The name of the method in the dump class to use. Defaults to load. */ - protected function loadDumps($files, $method = 'load') { + protected function loadDumps(array $files, $method = 'load') { // Load the database from the portable PHP dump. // The files may be gzipped. foreach ($files as $file) { @@ -137,6 +124,22 @@ protected function prepareMigrations(array $id_mappings) { } } + /** + * Executes a single migration. + * + * @param string|\Drupal\migrate\Entity\MigrationInterface $migration + * The migration to execute, or its ID. + */ + protected function executeMigration($migration) { + if (is_string($migration)) { + $migration = Migration::load($migration); + } + if ($this instanceof MigrateDumpAlterInterface) { + static::migrateDumpAlter($this); + } + (new MigrateExecutable($migration, $this))->import(); + } + /** * {@inheritdoc} */ diff --git a/core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php b/core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php index 673514cf82f1..d6bf7064644c 100644 --- a/core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php +++ b/core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php @@ -28,7 +28,7 @@ abstract class MigrateDrupalTestBase extends MigrateTestBase { */ protected function setUp() { parent::setUp(); - $this->loadDumps([$this->getDumpDirectory() . '/System.php']); + $this->loadDumps(['System.php']); $this->installEntitySchema('user'); $this->installConfig(['migrate_drupal', 'system']); @@ -44,6 +44,14 @@ protected function getDumpDirectory() { return __DIR__ . '/Table'; } + /** + * {@inheritdoc} + */ + protected function loadDumps(array $files, $method = 'load') { + $files = array_map(function($file) { return $this->getDumpDirectory() . '/' . $file; }, $files); + parent::loadDumps($files, $method); + } + /** * Turn all the migration templates for the specified drupal version into * real migration entities so we can test them. diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php index 533cd3c5c350..5f9613620097 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to action.settings.yml. @@ -32,13 +30,8 @@ class MigrateActionConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_action_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_action_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php index 69876f3cd041..60e863d7e88e 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to aggregator.settings.yml. @@ -32,13 +30,8 @@ class MigrateAggregatorConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_aggregator_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_aggregator_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php index 958d6bcb9034..8b7bf616c70a 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\aggregator\Entity\Feed; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to aggregator_feed entities. @@ -26,14 +24,8 @@ class MigrateAggregatorFeedTest extends MigrateDrupal6TestBase { protected function setUp() { parent::setUp(); $this->installEntitySchema('aggregator_feed'); - - $migration = entity_load('migration', 'd6_aggregator_feed'); - $dumps = array( - $this->getDumpDirectory() . '/AggregatorFeed.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['AggregatorFeed.php']); + $this->executeMigration('d6_aggregator_feed'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php index 9e075ba16c6f..8a047c1e5d5c 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\aggregator\Entity\Item; -use Drupal\Core\Language\LanguageInterface; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade aggregator items. @@ -47,14 +44,8 @@ protected function setUp() { )); $entity->enforceIsNew(); $entity->save(); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_aggregator_item'); - $dumps = array( - $this->getDumpDirectory() . '/AggregatorItem.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['AggregatorItem.php']); + $this->executeMigration('d6_aggregator_item'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php index eb13b49ef2cb..7b8dd9cb567f 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php @@ -7,12 +7,7 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\Core\Language\Language; use Drupal\block_content\Entity\BlockContent; -use Drupal\Core\Language\LanguageInterface; -use Drupal\field\Entity\FieldStorageConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade custom blocks. @@ -31,26 +26,16 @@ protected function setUp() { $this->installConfig(array('block_content')); $this->installEntitySchema('block_content'); - $migration = entity_load('migration', 'd6_block_content_type'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - $migration = entity_load('migration', 'd6_block_content_body_field'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_block_content_type'); + $this->executeMigration('d6_block_content_body_field'); $this->prepareMigrations(array( 'd6_filter_format' => array( array(array(2), array('full_html')) ) )); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_custom_block'); - $dumps = array( - $this->getDumpDirectory() . '/Boxes.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Boxes.php']); + $this->executeMigration('d6_custom_block'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php index a1ec049c6782..ceaef07ca3ff 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php @@ -7,8 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\block\Entity\Block; /** @@ -72,16 +70,8 @@ protected function setUp() { // Install one of D8's test themes. \Drupal::service('theme_handler')->install(array('test_theme')); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_block'); - $dumps = array( - $this->getDumpDirectory() . '/Blocks.php', - $this->getDumpDirectory() . '/BlocksRoles.php', - $this->getDumpDirectory() . '/AggregatorFeed.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Blocks.php', 'BlocksRoles.php', 'AggregatorFeed.php']); + $this->executeMigration('d6_block'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php index deb320890133..cf5a74571624 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to book.settings.yml. @@ -33,14 +30,8 @@ class MigrateBookConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - - $migration = entity_load('migration', 'd6_book_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_book_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php index a98e8278f4c6..3ad54f115cfe 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php @@ -7,8 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\node\Entity\Node; /** @@ -44,15 +42,8 @@ protected function setUp() { } $this->prepareMigrations($id_mappings); // Load database dumps to provide source data. - $dumps = array( - $this->getDumpDirectory() . '/Book.php', - $this->getDumpDirectory() . '/MenuLinks.php', - ); - $this->loadDumps($dumps); - // Migrate books.. - $migration = entity_load('migration', 'd6_book'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Book.php', 'MenuLinks.php']); + $this->executeMigration('d6_book'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php index 2bd727b476c1..20befed43f70 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php @@ -7,7 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\Core\Database\Database; use Drupal\migrate\MigrateExecutable; use Drupal\node\Entity\Node; diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php index 2c0e9c52defd..a6efb8e24984 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php @@ -7,11 +7,7 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\comment\Entity\Comment; use Drupal\comment\Tests\CommentTestTrait; -use Drupal\Core\Language\LanguageInterface; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade comments. @@ -60,21 +56,16 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_comment'); - - $dumps = array( - $this->getDumpDirectory() . '/Node.php', - $this->getDumpDirectory() . '/NodeRevisions.php', - $this->getDumpDirectory() . '/ContentTypeStory.php', - $this->getDumpDirectory() . '/ContentTypeTestPlanet.php', - $this->getDumpDirectory() . '/Variable.php', - $this->getDumpDirectory() . '/NodeType.php', - $this->getDumpDirectory() . '/Comments.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps([ + 'Node.php', + 'NodeRevisions.php', + 'ContentTypeStory.php', + 'ContentTypeTestPlanet.php', + 'Variable.php', + 'NodeType.php', + 'Comments.php', + ]); + $this->executeMigration('d6_comment'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php index 6a4560bef9d8..2b4e07de400c 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\comment\Entity\CommentType; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade comment type. @@ -30,16 +28,8 @@ protected function setUp() { $this->installEntitySchema('comment'); $this->installConfig(['node', 'comment']); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_comment_type'); - - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - $this->getDumpDirectory() . '/NodeType.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php', 'NodeType.php']); + $this->executeMigration('d6_comment_type'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php index cafd55d40696..e3a0e9003801 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Base class for Drupal 6 comment variables to Drupal 8 entity display tests. */ @@ -30,13 +27,6 @@ abstract class MigrateCommentVariableDisplayBase extends MigrateDrupal6TestBase */ static $modules = array('comment', 'node'); - /** - * The database dumps used. - * - * @var array - */ - protected $dumps; - /** * The node types being tested. * @@ -66,21 +56,14 @@ protected function setUp() { 'required' => 1, ))->save(); } - $this->dumps = array( - $this->getDumpDirectory() . '/Variable.php', - $this->getDumpDirectory() . '/NodeType.php', - ); $id_mappings = array( 'd6_comment_field_instance' => array( array(array('page'), array('node', 'comment', 'page')), ), ); $this->prepareMigrations($id_mappings); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', static::MIGRATION); - $this->prepare($migration, $this->dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php', 'NodeType.php']); + $this->executeMigration(static::MIGRATION); } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php index f38201592082..a65c9fc85b43 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade comment subject variable to core.entity_form_display.comment.*.default.yml * @@ -43,15 +40,8 @@ protected function setUp() { ), ); $this->prepareMigrations($id_mappings); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_comment_entity_form_display_subject'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - $this->getDumpDirectory() . '/NodeType.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php', 'NodeType.php']); + $this->executeMigration('d6_comment_entity_form_display_subject'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php index 0267dd4ddef2..c3986baf05af 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade comment variables to field.storage.node.comment.yml. @@ -42,15 +40,8 @@ protected function setUp() { ), ); $this->prepareMigrations($id_mappings); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_comment_field'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - $this->getDumpDirectory() . '/NodeType.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php', 'NodeType.php']); + $this->executeMigration('d6_comment_field'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php index 07b70c5c5f5e..22747ead6b68 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade comment variables to field.instance.node.*.comment.yml. * @@ -50,15 +47,8 @@ protected function setUp() { 'type' => 'comment', 'translatable' => '0', ))->save(); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_comment_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - $this->getDumpDirectory() . '/NodeType.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php', 'NodeType.php']); + $this->executeMigration('d6_comment_field_instance'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php index dd01a6c52d7e..4cc503342839 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\contact\Entity\ContactForm; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Migrate contact categories to contact.form.*.yml. @@ -31,13 +28,8 @@ class MigrateContactCategoryTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_contact_category'); - $dumps = array( - $this->getDumpDirectory() . '/Contact.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Contact.php']); + $this->executeMigration('d6_contact_category'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php index 1b48744275d2..44971d0d972c 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to contact.settings.yml. @@ -41,14 +38,8 @@ protected function setUp() { ), ); $this->prepareMigrations($id_mappings); - $migration = entity_load('migration', 'd6_contact_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - $this->getDumpDirectory() . '/Contact.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php', 'Contact.php']); + $this->executeMigration('d6_contact_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php index 48465d99990a..15a9cb6e5ec5 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php @@ -7,10 +7,7 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\Core\Datetime\DrupalDateTime; -use Drupal\migrate\MigrateMessage; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; /** @@ -25,14 +22,8 @@ class MigrateDateFormatTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_date_formats'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_date_formats'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php index 33cca917fabd..dd3ff1161204 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to dblog.settings.yml. @@ -33,13 +30,8 @@ class MigrateDblogConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_dblog_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_dblog_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php index b277e3b1ff9c..d5c90fae6ea7 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php @@ -206,49 +206,46 @@ protected function setUp() { * {@inheritdoc} */ protected function getDumps() { - $tests_path = $this->getDumpDirectory(); - $dumps = array( - $tests_path . '/AggregatorFeed.php', - $tests_path . '/AggregatorItem.php', - $tests_path . '/Blocks.php', - $tests_path . '/BlocksRoles.php', - $tests_path . '/Book.php', - $tests_path . '/Boxes.php', - $tests_path . '/Comments.php', - $tests_path . '/Contact.php', - $tests_path . '/ContentFieldMultivalue.php', - $tests_path . '/ContentFieldTest.php', - $tests_path . '/ContentFieldTestTwo.php', - $tests_path . '/ContentNodeField.php', - $tests_path . '/ContentNodeFieldInstance.php', - $tests_path . '/ContentTypeStory.php', - $tests_path . '/ContentTypeTestPlanet.php', - $tests_path . '/EventTimezones.php', - $tests_path . '/Files.php', - $tests_path . '/FilterFormats.php', - $tests_path . '/Filters.php', - $tests_path . '/MenuCustom.php', - $tests_path . '/MenuLinks.php', - $tests_path . '/Node.php', - $tests_path . '/NodeRevisions.php', - $tests_path . '/NodeType.php', - $tests_path . '/Permission.php', - $tests_path . '/ProfileFields.php', - $tests_path . '/ProfileValues.php', - $tests_path . '/Role.php', - $tests_path . '/TermData.php', - $tests_path . '/TermHierarchy.php', - $tests_path . '/TermNode.php', - $tests_path . '/Upload.php', - $tests_path . '/UrlAlias.php', - $tests_path . '/Users.php', - $tests_path . '/UsersRoles.php', - $tests_path . '/Variable.php', - $tests_path . '/Vocabulary.php', - $tests_path . '/VocabularyNodeTypes.php', + return array( + 'AggregatorFeed.php', + 'AggregatorItem.php', + 'Blocks.php', + 'BlocksRoles.php', + 'Book.php', + 'Boxes.php', + 'Comments.php', + 'Contact.php', + 'ContentFieldMultivalue.php', + 'ContentFieldTest.php', + 'ContentFieldTestTwo.php', + 'ContentNodeField.php', + 'ContentNodeFieldInstance.php', + 'ContentTypeStory.php', + 'ContentTypeTestPlanet.php', + 'EventTimezones.php', + 'Files.php', + 'FilterFormats.php', + 'Filters.php', + 'MenuCustom.php', + 'MenuLinks.php', + 'Node.php', + 'NodeRevisions.php', + 'NodeType.php', + 'Permission.php', + 'ProfileFields.php', + 'ProfileValues.php', + 'Role.php', + 'TermData.php', + 'TermHierarchy.php', + 'TermNode.php', + 'Upload.php', + 'UrlAlias.php', + 'Users.php', + 'UsersRoles.php', + 'Variable.php', + 'Vocabulary.php', + 'VocabularyNodeTypes.php', ); - - return $dumps; } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php index 7780b2c28b5a..15169545c719 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\Core\Entity\Entity\EntityViewMode; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade field formatter settings to entity.display.*.*.yml. @@ -66,17 +64,14 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - $migration = entity_load('migration', 'd6_field_formatter_settings'); - $dumps = array( - $this->getDumpDirectory() . '/ContentNodeFieldInstance.php', - $this->getDumpDirectory() . '/ContentNodeField.php', - $this->getDumpDirectory() . '/ContentFieldTest.php', - $this->getDumpDirectory() . '/ContentFieldTestTwo.php', - $this->getDumpDirectory() . '/ContentFieldMultivalue.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps([ + 'ContentNodeFieldInstance.php', + 'ContentNodeField.php', + 'ContentFieldTest.php', + 'ContentFieldTestTwo.php', + 'ContentFieldMultivalue.php', + ]); + $this->executeMigration('d6_field_formatter_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php index 17c0949ed69d..bae1e8548482 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\link\LinkItemInterface; /** @@ -67,20 +65,15 @@ protected function setUp() { entity_create('node_type', array('type' => 'story'))->save(); entity_create('node_type', array('type' => 'test_page'))->save(); - $migration = entity_load('migration', 'd6_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/ContentNodeFieldInstance.php', - $this->getDumpDirectory() . '/ContentNodeField.php', - $this->getDumpDirectory() . '/ContentFieldTest.php', - $this->getDumpDirectory() . '/ContentFieldTestTwo.php', - $this->getDumpDirectory() . '/ContentFieldMultivalue.php', - ); + $this->loadDumps([ + 'ContentNodeFieldInstance.php', + 'ContentNodeField.php', + 'ContentFieldTest.php', + 'ContentFieldTestTwo.php', + 'ContentFieldMultivalue.php', + ]); $this->createFields(); - - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - + $this->executeMigration('d6_field_instance'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php index 04a3f2e2f672..1b612b0882b0 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Migrate fields. @@ -30,18 +28,14 @@ class MigrateFieldTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_field'); - $dumps = array( - $this->getDumpDirectory() . '/ContentNodeFieldInstance.php', - $this->getDumpDirectory() . '/ContentNodeField.php', - $this->getDumpDirectory() . '/ContentFieldTest.php', - $this->getDumpDirectory() . '/ContentFieldTestTwo.php', - $this->getDumpDirectory() . '/ContentFieldMultivalue.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps([ + 'ContentNodeFieldInstance.php', + 'ContentNodeField.php', + 'ContentFieldTest.php', + 'ContentFieldTestTwo.php', + 'ContentFieldMultivalue.php', + ]); + $this->executeMigration('d6_field'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php index b9b79bbdf7b6..cc1540d9dd1c 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Migrate field widget settings. * @@ -62,18 +59,14 @@ protected function setUp() { ), ); $this->prepareMigrations($id_mappings); - $migration = entity_load('migration', 'd6_field_instance_widget_settings'); - $dumps = array( - $this->getDumpDirectory() . '/ContentNodeFieldInstance.php', - $this->getDumpDirectory() . '/ContentNodeField.php', - $this->getDumpDirectory() . '/ContentFieldTest.php', - $this->getDumpDirectory() . '/ContentFieldTestTwo.php', - $this->getDumpDirectory() . '/ContentFieldMultivalue.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - + $this->loadDumps([ + 'ContentNodeFieldInstance.php', + 'ContentNodeField.php', + 'ContentFieldTest.php', + 'ContentFieldTestTwo.php', + 'ContentFieldMultivalue.php', + ]); + $this->executeMigration('d6_field_instance_widget_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php index f1dd27455762..4e974a03eef1 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to file.settings.yml. @@ -33,13 +30,8 @@ class MigrateFileConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_file_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_file_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php index 0ec3b7889f7c..fa4d5c8323db 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileTest.php @@ -8,7 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\Component\Utility\Random; -use Drupal\migrate\MigrateExecutable; use Drupal\migrate\Tests\MigrateDumpAlterInterface; use Drupal\Core\Database\Database; use Drupal\simpletest\TestBase; @@ -44,17 +43,13 @@ protected function setUp() { $this->installEntitySchema('file'); $this->installConfig(['file']); - $dumps = array( - $this->getDumpDirectory() . '/Files.php', - ); + $this->loadDumps(['Files.php']); /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ $migration = entity_load('migration', 'd6_file'); $source = $migration->get('source'); $source['site_path'] = 'core/modules/simpletest'; $migration->set('source', $source); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration($migration); $this->standalone = TRUE; } @@ -77,11 +72,8 @@ public function testFiles() { // Test that we can re-import and also test with file_directory_path set. db_truncate(entity_load('migration', 'd6_file')->getIdMap()->mapTableName())->execute(); - $migration = entity_load_unchanged('migration', 'd6_file'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); + + $this->loadDumps(['Variable.php']); // Update the file_directory_path. Database::getConnection('default', 'migrate') @@ -94,8 +86,9 @@ public function testFiles() { ->fields(array('value' => serialize($this->getTempFilesDirectory()))) ->condition('name', 'file_directory_temp') ->execute(); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + + $migration = entity_load_unchanged('migration', 'd6_file'); + $this->executeMigration($migration); $file = File::load(2); $this->assertIdentical('public://core/modules/simpletest/files/image-2.jpg', $file->getFileUri()); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFilterFormatTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFilterFormatTest.php index 1c11f83da307..8702b0e86952 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFilterFormatTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFilterFormatTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade variables to filter.formats.*.yml. * @@ -27,15 +24,8 @@ class MigrateFilterFormatTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_filter_format'); - $dumps = array( - $this->getDumpDirectory() . '/Filters.php', - $this->getDumpDirectory() . '/FilterFormats.php', - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Filters.php', 'FilterFormats.php', 'Variable.php']); + $this->executeMigration('d6_filter_format'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php index f91dade33c65..d02fe7b45ed0 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to forum.settings.yml. @@ -37,13 +35,8 @@ protected function setUp() { array(array(1), array('vocabulary_1_i_0_')), ) )); - $migration = entity_load('migration', 'd6_forum_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_forum_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php index 721745dc4d96..92117043da57 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to locale.settings.yml. @@ -32,13 +30,8 @@ class MigrateLocaleConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_locale_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_locale_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php index d12a9e6b7599..3833bb0cf42b 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to menu_ui.settings.yml. @@ -32,13 +30,8 @@ class MigrateMenuConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_menu_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_menu_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuLinkTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuLinkTest.php index 18aea259d24f..e68dc8a28268 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuLinkTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuLinkTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Menu link migration. * @@ -43,13 +40,8 @@ protected function setUp() { ), )); - $migration = entity_load('migration', 'd6_menu_links'); - $dumps = array( - $this->getDumpDirectory() . '/MenuLinks.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['MenuLinks.php']); + $this->executeMigration('d6_menu_links'); } public function testMenuLinks() { diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php index e45199234a07..940385ad91a5 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; use Drupal\system\Entity\Menu; @@ -25,13 +23,8 @@ class MigrateMenuTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_menu'); - $dumps = array( - $this->getDumpDirectory() . '/MenuCustom.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['MenuCustom.php']); + $this->executeMigration('d6_menu'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php index 0a8d60b4557e..bda9bbeecd66 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeBundleSettingsTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Test migrating node settings into the base_field_bundle_override config entity. * @@ -58,25 +55,10 @@ public function setUp() { ); $this->prepareMigrations($id_mappings); - // Setup the dumps. - $migration = entity_load('migration', 'd6_node_setting_promote'); - $dumps = array( - $this->getDumpDirectory() . '/NodeType.php', - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - - // Run the migrations. - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - - $migration = entity_load('migration', 'd6_node_setting_status'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - - $migration = entity_load('migration', 'd6_node_setting_sticky'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['NodeType.php', 'Variable.php']); + $this->executeMigration('d6_node_setting_promote'); + $this->executeMigration('d6_node_setting_status'); + $this->executeMigration('d6_node_setting_sticky'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php index edf8b1ac47b8..4e1bed2ec619 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to node.settings.yml. @@ -33,13 +30,8 @@ class MigrateNodeConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_node_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_node_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php index 41f3850be4cb..aad5af74122f 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php @@ -7,7 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; use Drupal\Core\Database\Database; /** @@ -30,10 +29,7 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - $dumps = array( - $this->getDumpDirectory() . '/Users.php', - ); - $this->loadDumps($dumps); + $this->loadDumps(['Users.php']); // Create our users for the node authors. $query = Database::getConnection('default', 'migrate')->query('SELECT * FROM {users} WHERE uid NOT IN (0, 1)'); @@ -43,10 +39,7 @@ protected function setUp() { $user->save(); } - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_node_revision'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_node_revision'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTestBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTestBase.php index 4ff3ae3d16a2..faf34b7dd44b 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTestBase.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTestBase.php @@ -7,7 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\migrate\Entity\MigrationInterface; use Drupal\user\Entity\User; @@ -95,21 +94,19 @@ protected function setUp() { $node->enforceIsNew(); $node->save(); - // Load dumps. - $dumps = array( - $this->getDumpDirectory() . '/Node.php', - $this->getDumpDirectory() . '/NodeRevisions.php', - $this->getDumpDirectory() . '/ContentTypeStory.php', - $this->getDumpDirectory() . '/ContentTypeTestPlanet.php', - $this->getDumpDirectory() . '/NodeType.php', - $this->getDumpDirectory() . '/Variable.php', - $this->getDumpDirectory() . '/ContentNodeFieldInstance.php', - $this->getDumpDirectory() . '/ContentNodeField.php', - $this->getDumpDirectory() . '/ContentFieldTest.php', - $this->getDumpDirectory() . '/ContentFieldTestTwo.php', - $this->getDumpDirectory() . '/ContentFieldMultivalue.php', - ); - $this->loadDumps($dumps); + $this->loadDumps([ + 'Node.php', + 'NodeRevisions.php', + 'ContentTypeStory.php', + 'ContentTypeTestPlanet.php', + 'NodeType.php', + 'Variable.php', + 'ContentNodeFieldInstance.php', + 'ContentNodeField.php', + 'ContentFieldTest.php', + 'ContentFieldTestTwo.php', + 'ContentFieldMultivalue.php', + ]); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php index b79b495437c3..0e36e1e49a3b 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTypeTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\node\Entity\NodeType; /** @@ -33,15 +31,8 @@ protected function setUp() { parent::setUp(); $this->installConfig(array('node')); - - $migration = entity_load('migration', 'd6_node_type'); - $dumps = array( - $this->getDumpDirectory() . '/NodeType.php', - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['NodeType.php', 'Variable.php']); + $this->executeMigration('d6_node_type'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php index 3e6e430be097..b0b7cd61b30b 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to search.settings.yml. @@ -33,13 +30,8 @@ class MigrateSearchConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_search_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_search_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php index a964ca2b9695..d748c0b559e7 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchPageTest.php @@ -8,7 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; /** @@ -30,14 +29,8 @@ class MigrateSearchPageTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_search_page'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_search_page'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php index 6ad86e853630..fe5f4d5e0cc5 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to simpletest.settings.yml. @@ -35,14 +32,8 @@ protected function setUp() { parent::setUp(); $this->installConfig(['simpletest']); - - $migration = entity_load('migration', 'd6_simpletest_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_simpletest_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php index d9b0246506c4..9570efc03307 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php @@ -8,9 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to statistics.settings.yml. @@ -33,13 +30,8 @@ class MigrateStatisticsConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_statistics_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_statistics_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php index 1b6fd4018242..abe49136e561 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to syslog.settings.yml. @@ -32,13 +30,8 @@ class MigrateSyslogConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_syslog_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_syslog_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php index 5bebe8f02d68..e5fd01bf56bf 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade cron variable to system.*.yml. * @@ -23,13 +19,8 @@ class MigrateSystemCronTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_cron'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_cron'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php index 5b70f279b43d..5aa79cc159bd 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade variables to system.*.yml. * @@ -23,13 +19,8 @@ class MigrateSystemFileTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_file'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_file'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php index c82bcc1dd3b8..251b41b64203 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade filter variables to system.*.yml. * @@ -23,13 +19,8 @@ class MigrateSystemFilterTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_filter'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_filter'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php index 377a21c7f712..b2bd962c3c21 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade image gd variables to system.*.yml. * @@ -23,13 +19,8 @@ class MigrateSystemImageGdTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_image_gd'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_image_gd'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php index 656fb9fc3f4b..ddc832803056 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade image variables to system.*.yml. * @@ -23,13 +19,8 @@ class MigrateSystemImageTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_image'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_image'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php index d3bd5e4a3eac..228909626e87 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php @@ -7,9 +7,7 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade error_level variable to system.logging.yml. @@ -25,13 +23,8 @@ class MigrateSystemLoggingTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_logging'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_logging'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php index ca0954cd49f5..08229a6442d5 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade maintenance variables to system.*.yml. * @@ -23,13 +19,8 @@ class MigrateSystemMaintenanceTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_maintenance'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_maintenance'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php index 2f137202a7bf..21f16fc4b7c0 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade performance variables to system.*.yml. * @@ -23,13 +19,8 @@ class MigrateSystemPerformanceTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_performance'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_performance'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php index b89815c9b733..652e68a6b3ed 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade rss variable to system.*.yml. * @@ -23,13 +19,8 @@ class MigrateSystemRssTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_rss'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_rss'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php index d543c202b9ea..05841af38061 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateMessage; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upgrade site variables to system.*.yml. * @@ -23,13 +19,8 @@ class MigrateSystemSiteTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_system_site'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, new MigrateMessage()); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_system_site'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php index 11de9e8b9c8d..2a47150b007a 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to taxonomy.settings.yml. @@ -32,13 +30,8 @@ class MigrateTaxonomyConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_taxonomy_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_taxonomy_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php index 4e5dcc32a3c1..05c12dacfccb 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php @@ -7,8 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\taxonomy\Entity\Term; /** @@ -34,17 +32,13 @@ protected function setUp() { array(array(2), array('vocabulary_2_i_1_')), array(array(3), array('vocabulary_3_i_2_')), ))); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_taxonomy_term'); - $dumps = array( - $this->getDumpDirectory() . '/TermData.php', - $this->getDumpDirectory() . '/TermHierarchy.php', - $this->getDumpDirectory() . '/Vocabulary.php', - $this->getDumpDirectory() . '/VocabularyNodeTypes.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps([ + 'TermData.php', + 'TermHierarchy.php', + 'Vocabulary.php', + 'VocabularyNodeTypes.php', + ]); + $this->executeMigration('d6_taxonomy_term'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php index ba36183b88ca..3cc867a9e351 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyVocabularyTest.php @@ -7,8 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\taxonomy\Entity\Vocabulary; /** @@ -30,14 +28,8 @@ class MigrateTaxonomyVocabularyTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_taxonomy_vocabulary'); - $dumps = array( - $this->getDumpDirectory() . '/Vocabulary.php', - $this->getDumpDirectory() . '/VocabularyNodeTypes.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Vocabulary.php', 'VocabularyNodeTypes.php']); + $this->executeMigration('d6_taxonomy_vocabulary'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTestBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTestBase.php index ac087b911bca..e917f326d9b6 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTestBase.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTestBase.php @@ -81,18 +81,17 @@ protected function setUp() { $node->save(); } } - $dumps = array( - $this->getDumpDirectory() . '/Node.php', - $this->getDumpDirectory() . '/NodeRevisions.php', - $this->getDumpDirectory() . '/ContentTypeStory.php', - $this->getDumpDirectory() . '/ContentTypeTestPlanet.php', - $this->getDumpDirectory() . '/TermNode.php', - $this->getDumpDirectory() . '/TermHierarchy.php', - $this->getDumpDirectory() . '/TermData.php', - $this->getDumpDirectory() . '/Vocabulary.php', - $this->getDumpDirectory() . '/VocabularyNodeTypes.php', - ); - $this->loadDumps($dumps); + $this->loadDumps([ + 'Node.php', + 'NodeRevisions.php', + 'ContentTypeStory.php', + 'ContentTypeTestPlanet.php', + 'TermNode.php', + 'TermHierarchy.php', + 'TermData.php', + 'Vocabulary.php', + 'VocabularyNodeTypes.php', + ]); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php index 915f7dc433b9..de0347839110 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to text.settings.yml. @@ -32,13 +30,8 @@ class MigrateTextConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_text_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_text_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php index ae9809dd7f6d..b3235ffbd59c 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to update.settings.yml. @@ -32,13 +30,8 @@ class MigrateUpdateConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_update_settings'); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_update_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php index e195da1d8159..b39211672f76 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php @@ -7,8 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Base class for file/upload migration tests. */ @@ -90,14 +88,13 @@ protected function setUp() { $node->save(); } } - $dumps = array( - $this->getDumpDirectory() . '/Node.php', - $this->getDumpDirectory() . '/NodeRevisions.php', - $this->getDumpDirectory() . '/ContentTypeStory.php', - $this->getDumpDirectory() . '/ContentTypeTestPlanet.php', - $this->getDumpDirectory() . '/Upload.php', - ); - $this->loadDumps($dumps); + $this->loadDumps([ + 'Node.php', + 'NodeRevisions.php', + 'ContentTypeStory.php', + 'ContentTypeTestPlanet.php', + 'Upload.php', + ]); } } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php index 3008b9ccc780..c48bbbda3d23 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityDisplayTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upload entity display. * @@ -41,14 +38,8 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - $migration = entity_load('migration', 'd6_upload_entity_display'); - $dumps = array( - $this->getDumpDirectory() . '/NodeType.php', - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['NodeType.php', 'Variable.php']); + $this->executeMigration('d6_upload_entity_display'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php index f6d9cfc79272..3555fcc624c6 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadEntityFormDisplayTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Upload form entity display. * @@ -41,15 +38,8 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - $migration = entity_load('migration', 'd6_upload_entity_form_display'); - $dumps = array( - $this->getDumpDirectory() . '/NodeType.php', - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - + $this->loadDumps(['NodeType.php', 'Variable.php']); + $this->executeMigration('d6_upload_entity_form_display'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php index f9abe7974766..f4be6e2c4b53 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadFieldTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Uploads migration. @@ -30,9 +28,7 @@ class MigrateUploadFieldTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_upload_field'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_upload_field'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php index d66e3d130272..b1ce798f35cc 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upload field instance migration. @@ -52,14 +50,8 @@ protected function setUp() { 'translatable' => '0', ))->save(); - $migration = entity_load('migration', 'd6_upload_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/NodeType.php', - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['NodeType.php', 'Variable.php']); + $this->executeMigration('d6_upload_field_instance'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php index 14df7173fb74..218fec095e80 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadTest.php @@ -7,7 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; use Drupal\node\Entity\Node; /** @@ -22,10 +21,7 @@ class MigrateUploadTest extends MigrateUploadBase { */ protected function setUp() { parent::setUp(); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_upload'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_upload'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php index 572861d91cb6..3651890146c0 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUrlAliasTest.php @@ -9,7 +9,6 @@ use Drupal\migrate\MigrateExecutable; use Drupal\migrate\Plugin\MigrateIdMapInterface; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; /** @@ -26,14 +25,8 @@ protected function setUp() { parent::setUp(); $this->installSchema('system', ['url_alias']); - - $migration = entity_load('migration', 'd6_url_alias'); - $dumps = array( - $this->getDumpDirectory() . '/UrlAlias.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['UrlAlias.php']); + $this->executeMigration('d6_url_alias'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php index 0c9636a0828e..956e44485d4e 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\config\Tests\SchemaCheckTestTrait; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Upgrade variables to user.*.yml. @@ -25,17 +23,9 @@ class MigrateUserConfigsTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $dumps = array( - $this->getDumpDirectory() . '/Variable.php', - ); - $migration = entity_load('migration', 'd6_user_mail'); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - - $migration = entity_load('migration', 'd6_user_settings'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d6_user_mail'); + $this->executeMigration('d6_user_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserContactSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserContactSettingsTest.php index a4a0a18fe4fd..355b43e231aa 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserContactSettingsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserContactSettingsTest.php @@ -7,10 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\Core\Database\Database; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Users contact settings migration. * @@ -31,13 +27,12 @@ protected function setUp() { $this->installSchema('user', array('users_data')); - $dumps = array( - $this->getDumpDirectory() . '/Users.php', - $this->getDumpDirectory() . '/ProfileValues.php', - $this->getDumpDirectory() . '/UsersRoles.php', - $this->getDumpDirectory() . '/EventTimezones.php', - ); - $this->loadDumps($dumps); + $this->loadDumps([ + 'Users.php', + 'ProfileValues.php', + 'UsersRoles.php', + 'EventTimezones.php', + ]); $id_mappings = array( 'd6_user' => array( @@ -46,13 +41,9 @@ protected function setUp() { array(array(15), array(15)), ), ); - $this->prepareMigrations($id_mappings); - // Migrate users. - $migration = entity_load('migration', 'd6_user_contact_settings'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_user_contact_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php index 4d88e4a75089..3a9effb61799 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityDisplayTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * User picture entity display. * @@ -36,10 +33,7 @@ protected function setUp() { ), ); $this->prepareMigrations($id_mappings); - - $migration = entity_load('migration', 'd6_user_picture_entity_display'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_user_picture_entity_display'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php index 9dbdd4a3f577..ebbd0f9f28fe 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureEntityFormDisplayTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * User picture entity form display. * @@ -35,10 +32,7 @@ protected function setUp() { ), ); $this->prepareMigrations($id_mappings); - - $migration = entity_load('migration', 'd6_user_picture_entity_form_display'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_user_picture_entity_form_display'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php index eac1c3d8217a..aebf590c351a 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFieldTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * User picture field migration. @@ -25,9 +23,7 @@ class MigrateUserPictureFieldTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_user_picture_field'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_user_picture_field'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php index 969176cd9507..fe176266e06b 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureFileTest.php @@ -7,8 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\file\Entity\File; /** @@ -32,21 +30,19 @@ protected function setUp() { parent::setUp(); $this->installEntitySchema('file'); + $this->loadDumps([ + 'Users.php', + 'ProfileValues.php', + 'UsersRoles.php', + 'EventTimezones.php', + ]); - $dumps = array( - $this->getDumpDirectory() . '/Users.php', - $this->getDumpDirectory() . '/ProfileValues.php', - $this->getDumpDirectory() . '/UsersRoles.php', - $this->getDumpDirectory() . '/EventTimezones.php', - ); /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ $migration = entity_load('migration', 'd6_user_picture_file'); $source = $migration->get('source'); $source['site_path'] = 'core/modules/simpletest'; $migration->set('source', $source); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration($migration); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php index e032ff02a49d..aac48e1b0050 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * User picture field instance migration. @@ -44,9 +42,7 @@ protected function setUp() { 'translatable' => '0', ))->save(); - $migration = entity_load('migration', 'd6_user_picture_field_instance'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_user_picture_field_instance'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php index 5492526c01a6..b38f2b7a8d48 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php @@ -7,8 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; /** @@ -74,15 +72,14 @@ protected function setUp() { 'type' => 'boolean', ))->save(); - $migration = entity_load('migration', 'd6_user_profile_entity_display'); - $dumps = array( - $this->getDumpDirectory() . '/ProfileFields.php', - $this->getDumpDirectory() . '/Users.php', - $this->getDumpDirectory() . '/ProfileValues.php', - $this->getDumpDirectory() . '/UsersRoles.php', - $this->getDumpDirectory() . '/EventTimezones.php', - ); - $this->prepare($migration, $dumps); + $this->loadDumps([ + 'ProfileFields.php', + 'Users.php', + 'ProfileValues.php', + 'UsersRoles.php', + 'EventTimezones.php', + ]); + $field_data = Database::getConnection('default', 'migrate') ->select('profile_fields', 'u') ->fields('u') @@ -98,8 +95,8 @@ protected function setUp() { 'required' => 1, ))->save(); } - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + + $this->executeMigration('d6_user_profile_entity_display'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php index a127ded48bee..d0882897ffbe 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php @@ -7,8 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\Core\Database\Database; /** @@ -69,15 +67,13 @@ protected function setUp() { 'type' => 'boolean', ))->save(); - $migration = entity_load('migration', 'd6_user_profile_entity_form_display'); - $dumps = array( - $this->getDumpDirectory() . '/ProfileFields.php', - $this->getDumpDirectory() . '/Users.php', - $this->getDumpDirectory() . '/ProfileValues.php', - $this->getDumpDirectory() . '/UsersRoles.php', - $this->getDumpDirectory() . '/EventTimezones.php', - ); - $this->prepare($migration, $dumps); + $this->loadDumps([ + 'ProfileFields.php', + 'Users.php', + 'ProfileValues.php', + 'UsersRoles.php', + 'EventTimezones.php', + ]); $field_data = Database::getConnection('default', 'migrate') ->select('profile_fields', 'u') @@ -95,8 +91,7 @@ protected function setUp() { ))->save(); } - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_user_profile_entity_form_display'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php index 101ab0c0043a..cb834d7764ee 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Tests the user profile field instance migration. @@ -33,19 +31,14 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); $this->createFields(); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_user_profile_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/ProfileFields.php', - $this->getDumpDirectory() . '/Users.php', - $this->getDumpDirectory() . '/ProfileValues.php', - $this->getDumpDirectory() . '/UsersRoles.php', - $this->getDumpDirectory() . '/EventTimezones.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - + $this->loadDumps(array( + 'ProfileFields.php', + 'Users.php', + 'ProfileValues.php', + 'UsersRoles.php', + 'EventTimezones.php', + )); + $this->executeMigration('d6_user_profile_field_instance'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php index 4388c220e47a..b331a59d8228 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Tests the user profile field migration. @@ -25,17 +23,14 @@ class MigrateUserProfileFieldTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_user_profile_field'); - $dumps = array( - $this->getDumpDirectory() . '/ProfileFields.php', - $this->getDumpDirectory() . '/Users.php', - $this->getDumpDirectory() . '/ProfileValues.php', - $this->getDumpDirectory() . '/UsersRoles.php', - $this->getDumpDirectory() . '/EventTimezones.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps([ + 'ProfileFields.php', + 'Users.php', + 'ProfileValues.php', + 'UsersRoles.php', + 'EventTimezones.php', + ]); + $this->executeMigration('d6_user_profile_field'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php index 63fb2332b94a..fa4489e5a1c4 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileValuesTest.php @@ -9,7 +9,6 @@ use Drupal\migrate\MigrateExecutable; use Drupal\Core\Database\Database; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\user\Entity\User; /** @@ -106,15 +105,14 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - // Load database dumps to provide source data. - $dumps = array( - $this->getDumpDirectory() . '/ProfileFields.php', - $this->getDumpDirectory() . '/Users.php', - $this->getDumpDirectory() . '/ProfileValues.php', - $this->getDumpDirectory() . '/UsersRoles.php', - $this->getDumpDirectory() . '/EventTimezones.php', - ); - $this->loadDumps($dumps); + $this->loadDumps([ + 'ProfileFields.php', + 'Users.php', + 'ProfileValues.php', + 'UsersRoles.php', + 'EventTimezones.php', + ]); + $field_data = Database::getConnection('default', 'migrate') ->select('profile_fields', 'u') ->fields('u') @@ -140,10 +138,8 @@ protected function setUp() { $user->save(); } - // Migrate profile fields. $migration_format = entity_load('migration', 'd6_profile_values:user'); - $executable = new MigrateExecutable($migration_format, $this); - $executable->import(); + $this->executeMigration($migration_format); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php index 3c62d497e9c2..62e7d94000f5 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserRoleTest.php @@ -7,8 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\user\Entity\Role; /** @@ -39,18 +37,14 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = entity_load('migration', 'd6_user_role'); - $dumps = array( - $this->getDumpDirectory() . '/Permission.php', - $this->getDumpDirectory() . '/Role.php', - $this->getDumpDirectory() . '/Filters.php', - $this->getDumpDirectory() . '/FilterFormats.php', - $this->getDumpDirectory() . '/Variable.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps([ + 'Permission.php', + 'Role.php', + 'Filters.php', + 'FilterFormats.php', + 'Variable.php', + ]); + $this->executeMigration('d6_user_role'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php index d7ebec08de9f..d584c3ad85c6 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php @@ -10,8 +10,6 @@ use Drupal\user\Entity\User; use Drupal\file\Entity\File; use Drupal\Core\Database\Database; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\user\RoleInterface; /** @@ -88,20 +86,18 @@ protected function setUp() { file_put_contents($file->getFileUri(), file_get_contents('core/modules/simpletest/files/image-2.jpg')); $file->save(); - // Load database dumps to provide source data. - $dumps = array( - $this->getDumpDirectory() . '/Filters.php', - $this->getDumpDirectory() . '/FilterFormats.php', - $this->getDumpDirectory() . '/Variable.php', - $this->getDumpDirectory() . '/ProfileFields.php', - $this->getDumpDirectory() . '/Permission.php', - $this->getDumpDirectory() . '/Role.php', - $this->getDumpDirectory() . '/Users.php', - $this->getDumpDirectory() . '/ProfileValues.php', - $this->getDumpDirectory() . '/UsersRoles.php', - $this->getDumpDirectory() . '/EventTimezones.php', - ); - $this->loadDumps($dumps); + $this->loadDumps([ + 'Filters.php', + 'FilterFormats.php', + 'Variable.php', + 'ProfileFields.php', + 'Permission.php', + 'Role.php', + 'Users.php', + 'ProfileValues.php', + 'UsersRoles.php', + 'EventTimezones.php', + ]); $id_mappings = array( 'd6_user_role' => array( @@ -125,10 +121,7 @@ protected function setUp() { $this->prepareMigrations($id_mappings); - // Migrate users. - $migration = entity_load('migration', 'd6_user'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d6_user'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php index 729e2adf801c..7c6471b41b52 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateViewModesTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\Core\Entity\Entity\EntityViewMode; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Migrate view modes. @@ -30,17 +28,14 @@ class MigrateViewModesTest extends MigrateDrupal6TestBase { */ protected function setUp() { parent::setUp(); - $migration = entity_load('migration', 'd6_view_modes'); - $dumps = array( - $this->getDumpDirectory() . '/ContentNodeFieldInstance.php', - $this->getDumpDirectory() . '/ContentNodeField.php', - $this->getDumpDirectory() . '/ContentFieldTest.php', - $this->getDumpDirectory() . '/ContentFieldTestTwo.php', - $this->getDumpDirectory() . '/ContentFieldMultivalue.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps([ + 'ContentNodeFieldInstance.php', + 'ContentNodeField.php', + 'ContentFieldTest.php', + 'ContentFieldTestTwo.php', + 'ContentFieldMultivalue.php', + ]); + $this->executeMigration('d6_view_modes'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php index 46cb5c288359..2a411252954c 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Vocabulary entity display migration. * @@ -71,14 +68,8 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - $migration = entity_load('migration', 'd6_vocabulary_entity_display'); - $dumps = array( - $this->getDumpDirectory() . '/Vocabulary.php', - $this->getDumpDirectory() . '/VocabularyNodeTypes.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Vocabulary.php', 'VocabularyNodeTypes.php']); + $this->executeMigration('d6_vocabulary_entity_display'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php index 7a07405ea355..47edc32daf94 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d6; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; - /** * Vocabulary entity form display migration. * @@ -71,15 +68,8 @@ protected function setUp() { ); $this->prepareMigrations($id_mappings); - $migration = entity_load('migration', 'd6_vocabulary_entity_form_display'); - $dumps = array( - $this->getDumpDirectory() . '/Vocabulary.php', - $this->getDumpDirectory() . '/VocabularyNodeTypes.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - + $this->loadDumps(['Vocabulary.php', 'VocabularyNodeTypes.php']); + $this->executeMigration('d6_vocabulary_entity_form_display'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php index 52e60c1f65c3..5e834162f75c 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php @@ -9,8 +9,6 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\field\Entity\FieldConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Vocabulary field instance migration. @@ -64,14 +62,8 @@ protected function setUp() { ), ))->save(); - $migration = entity_load('migration', 'd6_vocabulary_field_instance'); - $dumps = array( - $this->getDumpDirectory() . '/Vocabulary.php', - $this->getDumpDirectory() . '/VocabularyNodeTypes.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Vocabulary.php', 'VocabularyNodeTypes.php']); + $this->executeMigration('d6_vocabulary_field_instance'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php index 7ac3455e093d..79e39f789ed5 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php @@ -8,8 +8,6 @@ namespace Drupal\migrate_drupal\Tests\d6; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\migrate\MigrateExecutable; -use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; /** * Vocabulary field migration. @@ -45,14 +43,8 @@ protected function setUp() { 'vid' => 'test_vocab', ))->save(); - $migration = entity_load('migration', 'd6_vocabulary_field'); - $dumps = array( - $this->getDumpDirectory() . '/Vocabulary.php', - $this->getDumpDirectory() . '/VocabularyNodeTypes.php', - ); - $this->prepare($migration, $dumps); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->loadDumps(['Vocabulary.php', 'VocabularyNodeTypes.php']); + $this->executeMigration('d6_vocabulary_field'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/d7/MigrateAggregatorSettingsTest.php b/core/modules/migrate_drupal/src/Tests/d7/MigrateAggregatorSettingsTest.php index b01180cd4f52..a4fc2a4f58f3 100644 --- a/core/modules/migrate_drupal/src/Tests/d7/MigrateAggregatorSettingsTest.php +++ b/core/modules/migrate_drupal/src/Tests/d7/MigrateAggregatorSettingsTest.php @@ -7,9 +7,6 @@ namespace Drupal\migrate_drupal\Tests\d7; -use Drupal\migrate\Entity\Migration; -use Drupal\migrate\MigrateExecutable; - /** * Tests migration of Aggregator's variables to configuration. * @@ -25,11 +22,8 @@ class MigrateAggregatorSettingsTest extends MigrateDrupal7TestBase { protected function setUp() { parent::setUp(); $this->installConfig(static::$modules); - $this->loadDumps([ - $this->getDumpDirectory() . '/Variable.php', - ]); - $migration = Migration::load('d7_aggregator_settings'); - (new MigrateExecutable($migration, $this))->import(); + $this->loadDumps(['Variable.php']); + $this->executeMigration('d7_aggregator_settings'); } /** diff --git a/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php b/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php index f75a7017504c..81842c150571 100644 --- a/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php +++ b/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php @@ -55,10 +55,7 @@ public function testMigrateDependenciesOrder() { public function testAggregatorMigrateDependencies() { /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_aggregator_item'); - $dumps = array( - $this->getDumpDirectory() . '/AggregatorItem.php', - ); - $this->prepare($migration, $dumps); + $this->loadDumps(['AggregatorItem.php']); $executable = new MigrateExecutable($migration, $this); $this->startCollectingMessages(); $executable->import(); -- GitLab