diff --git a/core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php b/core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php index 7ebf34f..f4ca307 100644 --- a/core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php +++ b/core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php @@ -60,9 +60,8 @@ public function testMigration() { $this->assertEntity('comment_node_forum', 'Forum topic comment'); $this->assertEntity('comment_node_test_content_type', 'Test content type comment'); + $migration = $this->getMigration()->createInstance('d7_comment_type'); // Validate that the source count and processed count match up. - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('d7_comment_type'); $this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount()); } diff --git a/core/modules/field/src/Tests/Migrate/d6/MigrateFieldFormatterSettingsTest.php b/core/modules/field/src/Tests/Migrate/d6/MigrateFieldFormatterSettingsTest.php index adb9e04..11d0d72 100644 --- a/core/modules/field/src/Tests/Migrate/d6/MigrateFieldFormatterSettingsTest.php +++ b/core/modules/field/src/Tests/Migrate/d6/MigrateFieldFormatterSettingsTest.php @@ -181,7 +181,7 @@ public function testEntityDisplaySettings() { $component = $display->getComponent('field_test_datetime'); $this->assertIdentical($expected, $component); // Test that our Id map has the correct data. - $this->assertIdentical(array('node', 'story', 'teaser', 'field_test'), $this->container->get('plugin.manager.migration')->createInstance('d6_field_formatter_settings')->getIdMap()->lookupDestinationID(array('story', 'teaser', 'node', 'field_test'))); + $this->assertIdentical(array('node', 'story', 'teaser', 'field_test'), $this->getMigration()->createInstance('d6_field_formatter_settings')->getIdMap()->lookupDestinationID(array('story', 'teaser', 'node', 'field_test'))); } } diff --git a/core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php b/core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php index bf8f1c7..69c55e6 100644 --- a/core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php +++ b/core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php @@ -98,7 +98,7 @@ public function testFields() { // Validate that the source count and processed count match up. /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('d6_field'); + $migration = $this->getMigration()->createInstance('d6_field'); $this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount()); // Check that we've reported on a conflict in widget_types. diff --git a/core/modules/field/src/Tests/Migrate/d7/MigrateFieldTest.php b/core/modules/field/src/Tests/Migrate/d7/MigrateFieldTest.php index c60f6e8..67c78e3 100644 --- a/core/modules/field/src/Tests/Migrate/d7/MigrateFieldTest.php +++ b/core/modules/field/src/Tests/Migrate/d7/MigrateFieldTest.php @@ -9,7 +9,6 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\field\FieldStorageConfigInterface; -use Drupal\migrate\Entity\Migration; use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase; /** @@ -116,8 +115,9 @@ public function testFields() { // Validate that the source count and processed count match up. /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('d7_field'); + $migration = $this->getMigration()->createInstance('d7_field'); $this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount()); } + } diff --git a/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php index 5c416e4..dbd332c 100644 --- a/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php @@ -77,7 +77,7 @@ public function testFiles() { $this->assertEntity(5, 'html-1.txt', '24', 'public://html-1.txt', 'text/plain', '1'); // Test that we can re-import and also test with file_directory_path set. - $migration_plugin_manager = $this->container->get('plugin.manager.migration'); + $migration_plugin_manager = $this->getMigration(); \Drupal::database() ->truncate($migration_plugin_manager->createInstance('d6_file')->getIdMap()->mapTableName()) ->execute(); diff --git a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php index fd6677f..d0aab98 100644 --- a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php @@ -44,7 +44,7 @@ public function testUploadEntityDisplay() { $component = $display->getComponent('upload'); $this->assertTrue(is_null($component)); - $this->assertIdentical(array('node', 'page', 'default', 'upload'), $this->container->get('plugin.manager.migration')->createInstance('d6_upload_entity_display')->getIdMap()->lookupDestinationID(array('page'))); + $this->assertIdentical(array('node', 'page', 'default', 'upload'), $this->getMigration()->createInstance('d6_upload_entity_display')->getIdMap()->lookupDestinationID(array('page'))); } } diff --git a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityFormDisplayTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityFormDisplayTest.php index a391457..5b98a9b 100644 --- a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityFormDisplayTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityFormDisplayTest.php @@ -44,7 +44,7 @@ public function testUploadEntityFormDisplay() { $component = $display->getComponent('upload'); $this->assertTrue(is_null($component)); - $this->assertIdentical(array('node', 'page', 'default', 'upload'), $this->container->get('plugin.manager.migration')->createInstance('d6_upload_entity_form_display')->getIdMap()->lookupDestinationID(array('page'))); + $this->assertIdentical(array('node', 'page', 'default', 'upload'), $this->getMigration()->createInstance('d6_upload_entity_form_display')->getIdMap()->lookupDestinationID(array('page'))); } } diff --git a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadFieldTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadFieldTest.php index f77ed18..fa17c87 100644 --- a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadFieldTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadFieldTest.php @@ -32,7 +32,7 @@ protected function setUp() { public function testUpload() { $field_storage = FieldStorageConfig::load('node.upload'); $this->assertIdentical('node.upload', $field_storage->id()); - $this->assertIdentical(array('node', 'upload'), $this->container->get('plugin.manager.migration')->createInstance('d6_upload_field')->getIdMap()->lookupDestinationID(array(''))); + $this->assertIdentical(array('node', 'upload'), $this->getMigration()->createInstance('d6_upload_field')->getIdMap()->lookupDestinationID(array(''))); } } diff --git a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadInstanceTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadInstanceTest.php index 0f1ce66..504dda9 100644 --- a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadInstanceTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadInstanceTest.php @@ -44,7 +44,7 @@ public function testUploadFieldInstance() { $field = FieldConfig::load('node.article.upload'); $this->assertTrue(is_null($field)); - $this->assertIdentical(array('node', 'page', 'upload'), $this->container->get('plugin.manager.migration')->createInstance('d6_upload_field_instance')->getIdMap()->lookupDestinationID(array('page'))); + $this->assertIdentical(array('node', 'page', 'upload'), $this->getMigration()->createInstance('d6_upload_field_instance')->getIdMap()->lookupDestinationID(array('page'))); } } diff --git a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadTest.php index c852cbe..e2eb13b 100644 --- a/core/modules/file/src/Tests/Migrate/d6/MigrateUploadTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateUploadTest.php @@ -55,7 +55,7 @@ protected function setUp() { $this->migrateContent(); // Since we are only testing a subset of the file migration, do not check // that the full file migration has been run. - $migration = $this->container->get('plugin.manager.migration')->createInstance('d6_upload'); + $migration = $this->getMigration()->createInstance('d6_upload'); $migration->set('requirements', []); $this->executeMigration($migration); } diff --git a/core/modules/file/src/Tests/Migrate/d7/MigrateFileTest.php b/core/modules/file/src/Tests/Migrate/d7/MigrateFileTest.php index 89e6320..e9ca8c4 100644 --- a/core/modules/file/src/Tests/Migrate/d7/MigrateFileTest.php +++ b/core/modules/file/src/Tests/Migrate/d7/MigrateFileTest.php @@ -35,7 +35,7 @@ protected function setUp() { file_put_contents('public://sites/default/files/cube.jpeg', str_repeat('*', 3620)); /** @var \Drupal\migrate\Plugin\Migration $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('d7_file'); + $migration = $this->getMigration()->createInstance('d7_file'); // Set the destination plugin's source_base_path configuration value, which // would normally be set by the user running the migration. $migration->set('destination', [ diff --git a/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php b/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php index c4a78ea..f187e40 100644 --- a/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php +++ b/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php @@ -42,7 +42,7 @@ public function testMissingTable() { ->execute(); try { - $this->container->get('plugin.manager.migration')->createInstance('d6_imagecache_presets') + $this->getMigration()->createInstance('d6_imagecache_presets') ->getSourcePlugin() ->checkRequirements(); $this->fail('Did not catch expected RequirementsException.'); diff --git a/core/modules/migrate/src/Plugin/Migration.php b/core/modules/migrate/src/Plugin/Migration.php index d109788..f804542 100644 --- a/core/modules/migrate/src/Plugin/Migration.php +++ b/core/modules/migrate/src/Plugin/Migration.php @@ -68,7 +68,7 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn * * @var array */ - protected $process; + protected $process = []; /** * The cached process plugins. @@ -605,7 +605,7 @@ public function getMigrationDependencies() { public function getPluginDefinition() { $definition = []; // While normal plugins do not change their definitions on the fly, this - // one does so accomodate for that. + // one does so accommodate for that. foreach (parent::getPluginDefinition() as $key => $value) { $definition[$key] = isset($this->$key) ? $this->$key : $value; } diff --git a/core/modules/migrate/src/Plugin/MigrationPluginManager.php b/core/modules/migrate/src/Plugin/MigrationPluginManager.php index f5dc776..0df10e0 100644 --- a/core/modules/migrate/src/Plugin/MigrationPluginManager.php +++ b/core/modules/migrate/src/Plugin/MigrationPluginManager.php @@ -79,7 +79,7 @@ protected function getDiscovery() { public function createInstances($id, array $configuration = array()) { $factory = $this->getFactory(); $instances = []; - $plugin_ids = preg_grep('/^' . $id . ':/', array_keys($this->getDefinitions())); + $plugin_ids = preg_grep('/^' . preg_quote($id, '/') . ':/', array_keys($this->getDefinitions())); if ($this->hasDefinition($id)) { $plugin_ids[] = $id; } diff --git a/core/modules/migrate/src/Tests/MigrateTestBase.php b/core/modules/migrate/src/Tests/MigrateTestBase.php index 6210c40..20b6357 100644 --- a/core/modules/migrate/src/Tests/MigrateTestBase.php +++ b/core/modules/migrate/src/Tests/MigrateTestBase.php @@ -226,4 +226,11 @@ protected function mockFailure($migration, array $row, $status = MigrateIdMapInt $migration->getIdMap()->saveIdMapping($row, $destination, $status); } + /** + * @return \Drupal\migrate\Plugin\MigrationPluginManager + */ + protected function getMigration() { + return $this->container->get('plugin.manager.migration'); + } + } diff --git a/core/modules/migrate/tests/src/Kernel/Entity/MigrationTest.php b/core/modules/migrate/tests/src/Kernel/Entity/MigrationTest.php index 11e83b3..a8379f2 100644 --- a/core/modules/migrate/tests/src/Kernel/Entity/MigrationTest.php +++ b/core/modules/migrate/tests/src/Kernel/Entity/MigrationTest.php @@ -28,6 +28,7 @@ class MigrationTest extends KernelTestBase { * @-covers ::calculateDependencies */ public function testCalculateDependencies() { + // @TODO https://www.drupal.org/node/2666640 return; $fixture_migrations = [ 'd6_node__article' => 'd6_node', diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php b/core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php index 1f7d2a8..6883178 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/CckMigration.php @@ -7,7 +7,6 @@ namespace Drupal\migrate_drupal\Plugin\migrate; - use Drupal\Component\Plugin\PluginManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\migrate\Exception\RequirementsException; diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/D6NodeDeriver.php b/core/modules/migrate_drupal/src/Plugin/migrate/D6NodeDeriver.php index ae2e654..b52c2a7 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/D6NodeDeriver.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/D6NodeDeriver.php @@ -122,7 +122,7 @@ public function getDerivativeDefinitions($base_plugin_definition) { } } catch (\Exception $e) { - + // @TODO https://www.drupal.org/node/2666640 } return $this->derivatives; } diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php index 636cef9..32c6777 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php @@ -61,6 +61,7 @@ protected function migrateUsers($include_pictures = TRUE) { // we're not migrating user pictures. $manager = $this->container->get('plugin.manager.migration'); foreach (['d6_user_picture_file', 'user_picture_entity_display', 'user_picture_entity_form_display'] as $id) { + // @TODO https://www.drupal.org/node/2666648 #$manager->createInstance($id)->delete(); } } diff --git a/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php b/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php index 4bff4c6..a890a3a 100644 --- a/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php +++ b/core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php @@ -28,9 +28,9 @@ class MigrateDependenciesTest extends MigrateDrupal6TestBase { */ public function testMigrateDependenciesOrder() { $migration_items = array('d6_comment', 'd6_filter_format', 'd6_node:page'); - // @TODO: fix when dependencies are working again. + // @TODO https://www.drupal.org/node/2666640 return; - $migrations = $this->container->get('plugin.manager.migration')->createInstances($migration_items); + $migrations = $this->getMigration()->createInstances($migration_items); $expected_order = array('d6_filter_format', 'd6_node:page', 'd6_comment'); $this->assertIdentical(array_keys($migrations), $expected_order); $expected_requirements = array( @@ -71,7 +71,7 @@ public function testAggregatorMigrateDependencies() { // @TODO: fix when dependencies are working again. return; /** @var \Drupal\migrate\entity\Migration $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('d6_aggregator_item'); + $migration = $this->getMigration()->createInstance('d6_aggregator_item'); $executable = new MigrateExecutable($migration, $this); $this->startCollectingMessages(); $executable->import(); diff --git a/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTest.php b/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTest.php index 0d67e06..327655d 100644 --- a/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTest.php +++ b/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTest.php @@ -30,7 +30,7 @@ protected function setUp() { $this->installSchema('file', ['file_usage']); $this->executeMigrations(['d6_node:*']); // This is required for the second import below. - $migration_plugin_manager = $this->container->get('plugin.manager.migration'); + $migration_plugin_manager = $this->getMigration(); \Drupal::database()->truncate($migration_plugin_manager->createInstance('d6_node:story')->getIdMap()->mapTableName())->execute(); } @@ -90,7 +90,7 @@ public function testNode() { ->condition('delta', 1) ->execute(); - $migration = $this->container->get('plugin.manager.migration')->createInstance('d6_node:story'); + $migration = $this->getMigration()->createInstance('d6_node:story'); $this->executeMigration($migration); $node = Node::load(1); diff --git a/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTypeTest.php b/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTypeTest.php index fe55533..379f429 100644 --- a/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTypeTest.php +++ b/core/modules/node/src/Tests/Migrate/d6/MigrateNodeTypeTest.php @@ -32,7 +32,7 @@ protected function setUp() { * Tests Drupal 6 node type to Drupal 8 migration. */ public function testNodeType() { - $id_map = $this->container->get('plugin.manager.migration')->createInstance('d6_node_type')->getIdMap(); + $id_map = $this->getMigration()->createInstance('d6_node_type')->getIdMap(); // Test the test_page content type. $node_type_page = NodeType::load('test_page'); $this->assertIdentical('test_page', $node_type_page->id(), 'Node type test_page loaded'); diff --git a/core/modules/node/src/Tests/Migrate/d6/MigrateViewModesTest.php b/core/modules/node/src/Tests/Migrate/d6/MigrateViewModesTest.php index 3d36b72..b07fcc4 100644 --- a/core/modules/node/src/Tests/Migrate/d6/MigrateViewModesTest.php +++ b/core/modules/node/src/Tests/Migrate/d6/MigrateViewModesTest.php @@ -35,7 +35,7 @@ public function testViewModes() { $this->assertIdentical(FALSE, is_null($view_mode), 'Preview view mode loaded.'); $this->assertIdentical('Preview', $view_mode->label(), 'View mode has correct label.'); // Test the ID map. - $this->assertIdentical(array('node', 'preview'), $this->container->get('plugin.manager.migration')->createInstance('d6_view_modes')->getIdMap()->lookupDestinationID(array(1))); + $this->assertIdentical(array('node', 'preview'), $this->getMigration()->createInstance('d6_view_modes')->getIdMap()->lookupDestinationID(array(1))); } } diff --git a/core/modules/node/src/Tests/Migrate/d7/NodeBuilderTest.php b/core/modules/node/src/Tests/Migrate/d7/NodeBuilderTest.php index 33b11f8..940ccee 100644 --- a/core/modules/node/src/Tests/Migrate/d7/NodeBuilderTest.php +++ b/core/modules/node/src/Tests/Migrate/d7/NodeBuilderTest.php @@ -20,7 +20,7 @@ class NodeBuilderTest extends MigrateDrupal7TestBase { public static $modules = ['node']; public function testBuilder() { - $process = $this->container->get('plugin.manager.migration')->createInstance('d7_node:test_content_type')->getProcess(); + $process = $this->getMigration()->createInstance('d7_node:test_content_type')->getProcess(); $this->assertIdentical('field_boolean', $process['field_boolean'][0]['source']); $this->assertIdentical('field_email', $process['field_email'][0]['source']); $this->assertIdentical('field_phone', $process['field_phone'][0]['source']); diff --git a/core/modules/path/src/Tests/Migrate/d6/MigrateUrlAliasTest.php b/core/modules/path/src/Tests/Migrate/d6/MigrateUrlAliasTest.php index be3bc87..1fa68a9 100644 --- a/core/modules/path/src/Tests/Migrate/d6/MigrateUrlAliasTest.php +++ b/core/modules/path/src/Tests/Migrate/d6/MigrateUrlAliasTest.php @@ -36,7 +36,7 @@ protected function setUp() { * Test the url alias migration. */ public function testUrlAlias() { - $id_map = $this->container->get('plugin.manager.migration')->createInstance('d6_url_alias')->getIdMap(); + $id_map = $this->getMigration()->createInstance('d6_url_alias')->getIdMap(); // Test that the field exists. $conditions = array( 'source' => '/node/1', @@ -65,7 +65,7 @@ public function testUrlAlias() { ->update($id_map->mapTableName()) ->fields(array('source_row_status' => MigrateIdMapInterface::STATUS_NEEDS_UPDATE)) ->execute(); - $migration = $this->container->get('plugin.manager.migration')->createInstance('d6_url_alias'); + $migration = $this->getMigration()->createInstance('d6_url_alias'); $this->executeMigration($migration); $path = \Drupal::service('path.alias_storage')->load(array('pid' => $path['pid'])); diff --git a/core/modules/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php b/core/modules/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php index 670ba91..ff6f0d6 100644 --- a/core/modules/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php +++ b/core/modules/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php @@ -58,7 +58,7 @@ public function testSearchPage() { ->execute(); /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('search_page'); + $migration = $this->getMigration()->createInstance('search_page'); // Indicate we're rerunning a migration that's already run. $migration->getIdMap()->prepareUpdate(); $this->executeMigration($migration); diff --git a/core/modules/search/src/Tests/Migrate/d7/MigrateSearchPageTest.php b/core/modules/search/src/Tests/Migrate/d7/MigrateSearchPageTest.php index bb383d3..6d59e48 100644 --- a/core/modules/search/src/Tests/Migrate/d7/MigrateSearchPageTest.php +++ b/core/modules/search/src/Tests/Migrate/d7/MigrateSearchPageTest.php @@ -60,7 +60,7 @@ public function testSearchPage() { ->execute(); /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('search_page'); + $migration = $this->getMigration()->createInstance('search_page'); // Indicate we're rerunning a migration that's already run. $migration->getIdMap()->prepareUpdate(); $this->executeMigration($migration); diff --git a/core/modules/system/src/Tests/Migrate/MigrateMenuTest.php b/core/modules/system/src/Tests/Migrate/MigrateMenuTest.php index fb1b1eb..ed8f152 100644 --- a/core/modules/system/src/Tests/Migrate/MigrateMenuTest.php +++ b/core/modules/system/src/Tests/Migrate/MigrateMenuTest.php @@ -46,7 +46,7 @@ public function testMenu() { ->condition('menu_name', 'navigation') ->execute(); - $migration = $this->container->get('plugin.manager.migration')->createInstance('menu'); + $migration = $this->getMigration()->createInstance('menu'); \Drupal::database() ->truncate($migration->getIdMap()->mapTableName()) ->execute(); diff --git a/core/modules/system/src/Tests/Migrate/d6/MigrateDateFormatTest.php b/core/modules/system/src/Tests/Migrate/d6/MigrateDateFormatTest.php index 4a661f9..30247f0 100644 --- a/core/modules/system/src/Tests/Migrate/d6/MigrateDateFormatTest.php +++ b/core/modules/system/src/Tests/Migrate/d6/MigrateDateFormatTest.php @@ -46,7 +46,7 @@ public function testDateFormats() { ->condition('name', 'date_format_short') ->execute(); - $migration = $this->container->get('plugin.manager.migration') + $migration = $this->getMigration() ->createInstance('d6_date_formats'); \Drupal::database() ->truncate($migration->getIdMap()->mapTableName()) diff --git a/core/modules/taxonomy/src/Tests/Migrate/MigrateTaxonomyTermStubTest.php b/core/modules/taxonomy/src/Tests/Migrate/MigrateTaxonomyTermStubTest.php index f30b0d0..833b472 100644 --- a/core/modules/taxonomy/src/Tests/Migrate/MigrateTaxonomyTermStubTest.php +++ b/core/modules/taxonomy/src/Tests/Migrate/MigrateTaxonomyTermStubTest.php @@ -101,7 +101,7 @@ public function testStubWithWeightMapping() { 'destination' => ['plugin' => 'entity:taxonomy_term'], 'migration_dependencies' => ['required' => ['vocabularies']], ]; - $term_migration = MigrationConfigDeriver::save('terms', $config, $this->container->get('plugin.manager.migration'), $this->container->get('config.factory')); + $term_migration = MigrationConfigDeriver::save('terms', $config, $this->getMigration(), $this->container->get('config.factory')); $term_executable = new MigrateExecutable($term_migration, $this); $term_executable->import(); // Load the referenced term, which should exist as a stub. diff --git a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTaxonomyVocabularyTest.php b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTaxonomyVocabularyTest.php index 9c5b9b7..0006baf 100644 --- a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTaxonomyVocabularyTest.php +++ b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTaxonomyVocabularyTest.php @@ -38,7 +38,7 @@ public function testTaxonomyVocabulary() { for ($i = 0; $i < 3; $i++) { $j = $i + 1; $vocabulary = Vocabulary::load("vocabulary_{$j}_i_{$i}_"); - $this->assertIdentical($this->container->get('plugin.manager.migration')->createInstance('d6_taxonomy_vocabulary')->getIdMap()->lookupDestinationID(array($j)), array($vocabulary->id())); + $this->assertIdentical($this->getMigration()->createInstance('d6_taxonomy_vocabulary')->getIdMap()->lookupDestinationID(array($j)), array($vocabulary->id())); $this->assertIdentical("vocabulary $j (i=$i)", $vocabulary->label()); $this->assertIdentical("description of vocabulary $j (i=$i)", $vocabulary->getDescription()); $this->assertIdentical($i, $vocabulary->getHierarchy()); diff --git a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTermNodeTest.php b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTermNodeTest.php index 5a52a60..32bf196 100644 --- a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTermNodeTest.php +++ b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTermNodeTest.php @@ -64,7 +64,7 @@ public function testSkipNonExistentNode() { // d6_term_node__2 should skip over node 2 (a.k.a. revision 3) because, // according to the map table, it failed. - $migration = $this->container->get('plugin.manager.migration')->createInstance('d6_term_node:2'); + $migration = $this->getMigration()->createInstance('d6_term_node:2'); $this->executeMigration($migration); $this->assertNull($migration->getIdMap()->lookupDestinationId(['vid' => 3])[0]); } diff --git a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityDisplayTest.php b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityDisplayTest.php index de2464d..1a1c1d7 100644 --- a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityDisplayTest.php +++ b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityDisplayTest.php @@ -40,7 +40,7 @@ public function testVocabularyEntityDisplay() { $this->assertIdentical('entity_reference_label', $component['type']); $this->assertIdentical(20, $component['weight']); // Test the Id map. - $this->assertIdentical(array('node', 'article', 'default', 'tags'), $this->container->get('plugin.manager.migration')->createInstance('d6_vocabulary_entity_display')->getIdMap()->lookupDestinationID(array(4, 'article'))); + $this->assertIdentical(array('node', 'article', 'default', 'tags'), $this->getMigration()->createInstance('d6_vocabulary_entity_display')->getIdMap()->lookupDestinationID(array(4, 'article'))); } } diff --git a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityFormDisplayTest.php b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityFormDisplayTest.php index 8c47671..7dc5369 100644 --- a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityFormDisplayTest.php +++ b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityFormDisplayTest.php @@ -40,7 +40,7 @@ public function testVocabularyEntityFormDisplay() { $this->assertIdentical('options_select', $component['type']); $this->assertIdentical(20, $component['weight']); // Test the Id map. - $this->assertIdentical(array('node', 'article', 'default', 'tags'), $this->container->get('plugin.manager.migration')->createInstance('d6_vocabulary_entity_form_display')->getIdMap()->lookupDestinationID(array(4, 'article'))); + $this->assertIdentical(array('node', 'article', 'default', 'tags'), $this->getMigration()->createInstance('d6_vocabulary_entity_form_display')->getIdMap()->lookupDestinationID(array(4, 'article'))); // Test the term widget tags setting. $entity_form_display = EntityFormDisplay::load('node.story.default'); diff --git a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyFieldInstanceTest.php b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyFieldInstanceTest.php index 1cfaa1b..20e3acb 100644 --- a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyFieldInstanceTest.php +++ b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyFieldInstanceTest.php @@ -54,7 +54,7 @@ public function testVocabularyFieldInstance() { $this->assertIdentical(['tags'], $settings['handler_settings']['target_bundles'], 'The target_bundles handler setting is correct.'); $this->assertIdentical(TRUE, $settings['handler_settings']['auto_create'], 'The "auto_create" setting is correct.'); - $this->assertIdentical(array('node', 'article', 'tags'), $this->container->get('plugin.manager.migration')->createInstance('d6_vocabulary_field_instance')->getIdMap()->lookupDestinationID(array(4, 'article'))); + $this->assertIdentical(array('node', 'article', 'tags'), $this->getMigration()->createInstance('d6_vocabulary_field_instance')->getIdMap()->lookupDestinationID(array(4, 'article'))); // Test the the field vocabulary_1_i_0_ $field_id = 'node.story.vocabulary_1_i_0_'; diff --git a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyFieldTest.php b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyFieldTest.php index d1fbc16..89ebd64 100644 --- a/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyFieldTest.php +++ b/core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyFieldTest.php @@ -43,7 +43,7 @@ public function testVocabularyField() { $settings = $field_storage->getSettings(); $this->assertIdentical('taxonomy_term', $settings['target_type'], "Target type is correct."); - $this->assertIdentical(array('node', 'tags'), $this->container->get('plugin.manager.migration')->createInstance('d6_vocabulary_field')->getIdMap()->lookupDestinationID(array(4)), "Test IdMap"); + $this->assertIdentical(array('node', 'tags'), $this->getMigration()->createInstance('d6_vocabulary_field')->getIdMap()->lookupDestinationID(array(4)), "Test IdMap"); } } diff --git a/core/modules/user/src/Plugin/migrate/ProfileValues.php b/core/modules/user/src/Plugin/migrate/ProfileValues.php index ec97db3..554c0d4 100644 --- a/core/modules/user/src/Plugin/migrate/ProfileValues.php +++ b/core/modules/user/src/Plugin/migrate/ProfileValues.php @@ -41,6 +41,7 @@ public function getProcess() { } } catch (\Exception $e) { + // @TODO https://www.drupal.org/node/2666640 } } return parent::getProcess(); diff --git a/core/modules/user/src/Tests/Migrate/d6/MigrateUserConfigsTest.php b/core/modules/user/src/Tests/Migrate/d6/MigrateUserConfigsTest.php index f1b0a75..040c6e4 100644 --- a/core/modules/user/src/Tests/Migrate/d6/MigrateUserConfigsTest.php +++ b/core/modules/user/src/Tests/Migrate/d6/MigrateUserConfigsTest.php @@ -83,7 +83,7 @@ public function testUserSettings() { ->execute(); /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('d6_user_settings'); + $migration = $this->getMigration()->createInstance('d6_user_settings'); // Indicate we're rerunning a migration that's already run. $migration->getIdMap()->prepareUpdate(); $this->executeMigration($migration); diff --git a/core/modules/user/src/Tests/Migrate/d6/MigrateUserPictureFileTest.php b/core/modules/user/src/Tests/Migrate/d6/MigrateUserPictureFileTest.php index 0eed04e..84f7ffb 100644 --- a/core/modules/user/src/Tests/Migrate/d6/MigrateUserPictureFileTest.php +++ b/core/modules/user/src/Tests/Migrate/d6/MigrateUserPictureFileTest.php @@ -27,7 +27,7 @@ protected function setUp() { $this->installEntitySchema('file'); /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ - $migration = $this->container->get('plugin.manager.migration')->createInstance('d6_user_picture_file'); + $migration = $this->getMigration()->createInstance('d6_user_picture_file'); $source = $migration->get('source'); $source['site_path'] = 'core/modules/simpletest'; $migration->set('source', $source); diff --git a/core/modules/user/src/Tests/Migrate/d6/MigrateUserRoleTest.php b/core/modules/user/src/Tests/Migrate/d6/MigrateUserRoleTest.php index 8bf8159..4d20d84 100644 --- a/core/modules/user/src/Tests/Migrate/d6/MigrateUserRoleTest.php +++ b/core/modules/user/src/Tests/Migrate/d6/MigrateUserRoleTest.php @@ -31,7 +31,7 @@ protected function setUp() { */ public function testUserRole() { /** @var \Drupal\migrate\entity\Migration $migration */ - $id_map = $this->container->get('plugin.manager.migration')->createInstance('d6_user_role')->getIdMap(); + $id_map = $this->getMigration()->createInstance('d6_user_role')->getIdMap(); $rid = 'anonymous'; $anonymous = Role::load($rid); $this->assertIdentical($rid, $anonymous->id()); diff --git a/core/modules/user/src/Tests/Migrate/d6/MigrateUserTest.php b/core/modules/user/src/Tests/Migrate/d6/MigrateUserTest.php index 5034863..e0966a2 100644 --- a/core/modules/user/src/Tests/Migrate/d6/MigrateUserTest.php +++ b/core/modules/user/src/Tests/Migrate/d6/MigrateUserTest.php @@ -86,7 +86,7 @@ public function testUser() { ->execute() ->fetchCol(); $roles = array(RoleInterface::AUTHENTICATED_ID); - $id_map = $this->container->get('plugin.manager.migration')->createInstance('d6_user_role')->getIdMap(); + $id_map = $this->getMigration()->createInstance('d6_user_role')->getIdMap(); foreach ($rids as $rid) { $role = $id_map->lookupDestinationId(array($rid)); $roles[] = reset($role); diff --git a/core/modules/user/src/Tests/Migrate/d7/UserMigrationClassTest.php b/core/modules/user/src/Tests/Migrate/d7/UserMigrationClassTest.php index 1863d42..ac97596 100644 --- a/core/modules/user/src/Tests/Migrate/d7/UserMigrationClassTest.php +++ b/core/modules/user/src/Tests/Migrate/d7/UserMigrationClassTest.php @@ -21,7 +21,7 @@ class UserMigrationClassTest extends MigrateDrupal7TestBase { * process pipeline by the d6_profile_values builder. */ public function testClass() { - $migration = $this->container->get('plugin.manager.migration') + $migration = $this->getMigration() ->createInstance('d7_user'); /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ $this->assertIdentical('d7_user', $migration->id());