diff --git a/core/modules/migrate/src/Tests/MigrateTestBase.php b/core/modules/migrate/src/Tests/MigrateTestBase.php index 967f7726cb19f5a9f8e240ec3292e52bd063ad47..c3fd6ced657745a07f1df6b0aa0706a5b2b5a78c 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 673514cf82f1b8e2030f0d7ee1ca0b782d881453..d6bf7064644c075fa23f94b050b3898a89739b7a 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 533cd3c5c3507fd4a800c1c0d0177af7989929e9..5f96136200971bc3949d926dacc5fd4ea2fd2c07 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 69876f3cd041ce73c52ece2b58e6274d447fdbee..60e863d7e88e906c3ca5bab3ee04735c95d9685b 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 958d6bcb9034da2815a108549c8672da62d99306..8b7bf616c70a12fbe28728681ad9aa1f467391fe 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 9e075ba16c6f253339cf8c209fb57b83722f890e..8a047c1e5d5cad527e5bfbeae25e69b911624db0 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 eb13b49ef2cbaf43997358394904c907df511aa4..7b8dd9cb567fb059ae82eece4259f34b25d6baf6 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 a1ec049c6782a15636c970bd76c13d6cad7f35c5..ceaef07ca3ff1277859c78ad6644868bee3226f7 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 deb3208901330ee4f57c75db8a387893d10a8984..cf5a745716243ba0779fb4cd6bc2d0c1bbfc9a75 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 a98e8278f4c61eaa28af785187a29664116665bd..3ad54f115cfe8154a454325066d0ea35ada94e7c 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 2bd727b476c133b254e06fcec87fd016e9371c70..20befed43f70d227da65369190c34d1b0dd8a1e4 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 2c0e9c52defdbe2dcef9b62c562219d0379205e9..a6efb8e249843098a49bfc8d20defafc021e30c3 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 6a4560bef9d86bb0208abf7629f775eb57325109..2b4e07de400c16691fda78ea9c0f0308e8fd0507 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 cafd55d406961b88dd610f5c345fe7eb05abac80..e3a0e9003801de7fac72a2ab6368d12942decd9b 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 f382015920825bdbb239da10015fe6152a33d29d..a65c9fc85b43959947bf21bc447ea2948abe0718 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 0267dd4ddef29d590769a782ee24ae62c3312017..c3986baf05af446297ad72d11dccd8ccf089d8e8 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 07b70c5c5f5edd494ba3a6d9850bf5ec5a7e936b..22747ead6b68b814d3c00091e418fcc3750a9ec8 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 dd01a6c52d7e12e75a671e7ec928a276fcae826e..4cc5033428395ea7d8d53bd5d288110bb64400ec 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 1b48744275d2f8bf02caa5924d86a32fe4ae3545..44971d0d972cc44646ce0af894a5b3d25394de39 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 48465d99990ace6fb1891b5fcdf2d4ead0d3dcd9..15a9cb6e5ec5d60200c1358336827a5710ac9adc 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 33cca917fabdc0e5821d3962ad417bfbc9bc0d63..dd3ff116120449e2697006d6a08cf74bea37630c 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 b277e3b1ff9c81f667254c9bef6b90996fb19c30..d5c90fae6ea71168c97f95b21aee6ba5b8839181 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 7780b2c28b5a083831b555c1bfedd11fb0f9af5e..15169545c7190036a9a1064d6ea047e47bc9f4b8 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 17c0949ed69d512ebe51ad8f46fd64180009c16c..bae1e8548482312d4ee180b94df34d7048b6c515 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 04a3f2e2f672604357d2a86a41057486cc917ff2..1b612b0882b01be77f12b933e77c5f79ad6bfb5a 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 b9b79bbdf7b60c8b5227f66e441f0d90c5b0b427..cc1540d9dd1c1b8e75a5ad3a186adca274b873c5 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 f1dd274557628e65aeba02a6849e85a66d1cbad7..4e974a03eef1e51e805df07176292ecddfb47a5b 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 0ec3b7889f7cd81efddd3d091776c03b8ab816b1..fa4d5c8323db0f3007b6c5316c7b5eff66510510 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 1c11f83da3077050eeac8fdf1426e10a0b657a5a..8702b0e869520c7a66e928e7983c49fe5826ce08 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 f91dade33c658290f7a1bd58f6af6d8a2e069894..d02fe7b45ed033d5ac52f55453e955df6b81fbf1 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 721745dc4d9614c7c918c4621a18833782d5b8c0..92117043da57146d2387ea49cbe18dc166a9d915 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 d12a9e6b7599e23b1c23fda528d5706ec1662f7f..3833bb0cf42b0a17e95ed918cc95d92f7babefe3 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 18aea259d24ffd022fd3e7592e2c4e8a5b862001..e68dc8a28268207d1660f0df77c4f05f78470064 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 e45199234a079a4ce58ad5f00beefa6ac8ddcc57..940385ad91a59a38c9c85894880169775f61d9cc 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 0a8d60b4557e151bf35f2967834eaadd5767f6c1..bda9bbeecd669ad2b0dd36678f67ad534dc62310 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 edf8b1ac47b8f3d369e2e050c50f26e781162c15..4e1bed2ec619d832d2a963908d536d1fbd35a489 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 41f3850be4cbe85fa435039cff40234e04e5101e..aad5af74122f8de66802a138d4ce617cfaabb388 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 4ff3ae3d16a2804c3596b3508bdb682768e031eb..faf34b7dd44bf3f5b83b139ee3889a060ba118c6 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 b79b495437c31716915bf0774d25794f62f48dfc..0e36e1e49a3bd70f3f760e92cb3055f803225c12 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 3e6e430be097c4eca80665a29ea4a7fc2d5e69cf..b0b7cd61b30b59a2ff427f8b117074f0637642c8 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 a964ca2b96957d6d0405370cf41d0d3e7d16f056..d748c0b559e7827fb557397843d93d1e41de962f 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 6ad86e853630d9408b4e927093da59ba160fc2fb..fe5f4d5e0cc5f6538c1f133b1d76d7e28379f390 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 d9b0246506c45cc1899777df0a3336814938625e..9570efc03307fbe4ed19b416456ff594bb186774 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 1b6fd4018242594a40814e86a00ac3e19598b8e2..abe49136e561dcf8a40b72b13e322ee7881167df 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 5bebe8f02d680cdf939a81db05df221b9e65c03c..e5fd01bf56bf83122e3c12eaf4cfb3a35a730608 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 5b70f279b43db1d622ec44b40111ad8a669e5fd8..5aa79cc159bd821f72824dc3f907821f7b038092 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 c82bcc1dd3b899ed061485437c593fafaea2bbe7..251b41b64203c19768e2b4499da1f39ad9f2e8bd 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 377a21c7f71260c617caad85819ee0303b8d7d5e..b2bd962c3c21ab34a03a6ca0f1653b97939eea3c 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 656fb9fc3f4b33c63f797d5c687f318490ad1fd7..ddc832803056eed8b6babf0e65995bfd87b8d3bb 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 d3bd5e4a3eac7820e7029c9d4569509cb7131923..228909626e87f6a8846278433e31d64e51589fe0 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 ca0954cd49f5c40543d6c563dcc4f539ad8bb4dd..08229a6442d55bd4472e0ebb3fa2d68001edddbb 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 2f137202a7bf5d4f9e7c41ff00b0defa453b8845..21f16fc4b7c0d559cd73885ace8008c7c3f50ef0 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 b89815c9b7339bb6010bf16454c409ce787354d6..652e68a6b3ed8433a34918ab17ea8d0b9633f87b 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 d543c202b9ea812d22f080e5f8a10b5ce8709fa6..05841af380610406c09f7558a7cccc420f12b3e5 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 11de9e8b9c8da74cbbbe4df7f4a0b10cfe76cd1c..2a47150b007a9f7a4c98ec483f43b8c68b13a035 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 4e5dcc32a3c122ec74aea5306ebcffc0536a9874..05c12dacfccbd053cc667b2ec8f758814a56950f 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 ba36183b88cacf3acbc15f690b8b4507fd056bb5..3cc867a9e351b3d0b3ae478f1ee5c1895dd3eef4 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 ac087b911bcac970624e914ad0c41fc14f9a708c..e917f326d9b68230acb86c5b7a144921c16497bd 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 915f7dc433b91c40175b9d88913b4f806aee79a6..de0347839110115c8dd4c666a7e99a88ddf2c876 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 ae9809dd7f6da5028bfc88b2ee624df1428ad1df..b3235ffbd59c6149aed265782898e3962ac5141c 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 e195da1d8159815b5eeecb2cd5ceff1d7937b5d6..b39211672f76d47e0d5764ed6f0d5437e1741f02 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 3008b9ccc78032538cd2728ce263f92ef971b7c9..c48bbbda3d23d25021e4a83e913f077f699e5b73 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 f6d9cfc792725252f05e9a96133a9b2c6d11f6dd..3555fcc624c6a50fbcbcf654ab9f56bac09b8b79 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 f9abe7974766158ca23b536a0550c9b3c2ed5842..f4be6e2c4b53d2a9ea534bfbfc539f983442c3fb 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 d66e3d1302726a33f1730c6a91b7e7fb36ab82d7..b1ce798f35cc47785502e40d1865d55a5d7e22e5 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 14df7173fb74561ac90cf0cba194d901780a61c0..218fec095e8031cde09685c76c357f88748759c5 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 572861d91cb6869ad97bccc83d49d18ea6087e5b..3651890146c01a5eeb0e29079df9ede2813a03f2 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 0c9636a0828e3db0294daf75b223a0670e81920f..956e44485d4e4aeeacd228c83ccebde614eac0a9 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 a4a0a18fe4fdc36d1dadd0adb9faeea481a7f3b6..355b43e231aa8a69427ae50d7ffe0b34ebaa0e8d 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 4d88e4a750893292baac834515b90ba511af167d..3a9effb617990402e76fd6d85c8137bacffa349c 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 9dbdd4a3f57724f6332650e905f155a754cca536..ebbd0f9f28fe3f2181051ad9a336198eae45480f 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 eac1c3d8217aa82afae7b6c2d920845b7b43ab9d..aebf590c351a919eb4dc7cc198ed6738ee36cd85 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 969176cd95075ce4059138822c516a190771ab7a..fe176266e06b034d509b710f900c3b5b0985085a 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 e032ff02a49d1c3dc2e2207ac5892da5b0e170dc..aac48e1b0050980ba19340b3b1a133decc154b6e 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 5492526c01a65ac1a277e1f28d8a6a6eaea1a6f2..b38f2b7a8d4870fc7db4967b59fe494e8ce01f60 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 a127ded48bee7625e90339d2b06c7cbbc3f28038..d0882897ffbef8e7b63c01efcc51f781cd50eace 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 101ab0c0043a9ddbc8ed876669b58a291a539024..cb834d7764ee199fb365a0f25708770687f33b09 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 4388c220e47a8fa23a99fb65a9b95698c3054a9f..b331a59d8228066ceac1abe6c9b795b727b3bf9a 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 63fb2332b94acc26f06c4c4327762fe472beb2be..fa4489e5a1c4735ace762aea47d835efa23edb3c 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 3c62d497e9c29402f8b4b71bd15af297f6933567..62e7d94000f5a5dbf3a98ec98cc3dd077a9edd6b 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 d7ebec08de9f29639eea2edc387b12c69b12a851..d584c3ad85c6ecedcf850b5484ab51650766b77c 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 729e2adf801c6ee9a1648be3d7cc02423c1de1ee..7c6471b41b52accd7b453c6f3434e004275bf864 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 46cb5c2883593c3204c69eceb364b0d0c587d203..2a411252954cdf3f77b4676741bad9f47815114e 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 7a07405ea3555766a7175775f71894a4563e0548..47edc32daf94ae5c15d839527ee09ed4b9c3c209 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 52e60c1f65c302a78b05938a254c48f717c4e4ca..5e834162f75c12e6c5832d7f4199123bda0f3abb 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 7ac3455e093db6dbfc8fa88f9d26d86286283f41..79e39f789ed5ca8e159f04e7f22f22d4d58d5bdc 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 b01180cd4f52d7de20e9fe3a7c64058bd452c8d1..a4fc2a4f58f3f85078bd2efa481343a732f8b99b 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 f75a7017504c79d87038983e05a75cba7c81a620..81842c15057104a6996213fda6f451fa07e9ac08 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();