diff -u b/core/modules/block_content/migration_templates/d7_block_content_body_field.yml b/core/modules/block_content/migration_templates/d7_block_content_body_field.yml --- b/core/modules/block_content/migration_templates/d7_block_content_body_field.yml +++ b/core/modules/block_content/migration_templates/d7_block_content_body_field.yml @@ -1,23 +1,29 @@ id: d7_block_content_body_field -label: Drupal 7 block content body field configuration +label: Block content body field configuration migration_tags: - Drupal 7 source: - # We do an empty source and a proper destination to have an idmap for - # migration_dependencies. - plugin: empty - constants: - entity_type: block_content - bundle: basic - name: body - label: Body - display_summary: false + plugin: embedded_data + data_rows: + - + entity_type: block_content + bundle: basic + field_name: body + label: Body + display_summary: false + ids: + entity_type: + type: string + bundle: + type: string + field_name: + type: string process: - entity_type: 'constants/entity_type' - bundle: 'constants/bundle' - field_name: 'constants/name' - label: 'constants/label' - 'settings/display_summary': 'constants/display_summary' + entity_type: entity_type + bundle: bundle + field_name: field_name + label: label + 'settings/display_summary': display_summary destination: plugin: entity:field_config migration_dependencies: diff -u b/core/modules/block_content/migration_templates/d7_block_content_type.yml b/core/modules/block_content/migration_templates/d7_block_content_type.yml --- b/core/modules/block_content/migration_templates/d7_block_content_type.yml +++ b/core/modules/block_content/migration_templates/d7_block_content_type.yml @@ -1,16 +1,18 @@ id: d7_block_content_type -label: Drupal 7 block content type +label: Block content type migration_tags: - Drupal 7 source: - # We do an empty source and a proper destination to have an idmap for - # migration_dependencies. - plugin: empty - constants: - id: basic - label: Basic + plugin: embedded_data + data_rows: + - + id: basic + label: Basic + ids: + id: + type: string process: - id: 'constants/id' - label: 'constants/label' + id: id + label: label destination: plugin: entity:block_content_type diff -u b/core/modules/block_content/src/Tests/Migrate/d7/MigrateBlockContentBodyFieldTest.php b/core/modules/block_content/src/Tests/Migrate/d7/MigrateBlockContentBodyFieldTest.php --- b/core/modules/block_content/src/Tests/Migrate/d7/MigrateBlockContentBodyFieldTest.php +++ b/core/modules/block_content/src/Tests/Migrate/d7/MigrateBlockContentBodyFieldTest.php @@ -11,15 +11,12 @@ use Drupal\field\Entity\FieldStorageConfig; use Drupal\field\FieldConfigInterface; use Drupal\field\FieldStorageConfigInterface; -use Drupal\migrate\MigrateExecutable; use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase; /** * Attaches a body field to the custom block type. * * @group block_content - * @migration d7_block_content_type - * @migration d7_block_content_body_field */ class MigrateBlockContentBodyFieldTest extends MigrateDrupal7TestBase { @@ -30,16 +27,10 @@ */ protected function setUp() { parent::setUp(); - $this->installConfig(array('block_content')); + $this->installConfig(['block_content']); $this->installEntitySchema('block_content'); - - $migration = entity_load('migration', 'd7_block_content_type'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); - - $migration = entity_load('migration', 'd7_block_content_body_field'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d7_block_content_type'); + $this->executeMigration('d7_block_content_body_field'); } /** diff -u b/core/modules/block_content/src/Tests/Migrate/d7/MigrateBlockContentTypeTest.php b/core/modules/block_content/src/Tests/Migrate/d7/MigrateBlockContentTypeTest.php --- b/core/modules/block_content/src/Tests/Migrate/d7/MigrateBlockContentTypeTest.php +++ b/core/modules/block_content/src/Tests/Migrate/d7/MigrateBlockContentTypeTest.php @@ -9,14 +9,12 @@ use Drupal\block_content\BlockContentTypeInterface; use Drupal\block_content\Entity\BlockContentType; -use Drupal\migrate\MigrateExecutable; use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase; /** - * Creates the custom block content type. + * Tests migration of the basic block content type. * * @group block_content - * @migration d7_block_content_type */ class MigrateBlockContentTypeTest extends MigrateDrupal7TestBase { @@ -27,18 +25,15 @@ */ protected function setUp() { parent::setUp(); - $this->installConfig(array('block_content')); + $this->installConfig(['block_content']); $this->installEntitySchema('block_content'); - - $migration = entity_load('migration', 'd7_block_content_type'); - $executable = new MigrateExecutable($migration, $this); - $executable->import(); + $this->executeMigration('d7_block_content_type'); } /** * Tests the block content type migration. */ - public function testBlockMigration() { + public function testBlockContentTypeMigration() { /** @var \Drupal\block_content\BlockContentTypeInterface $entity */ $entity = BlockContentType::load('basic'); $this->assertTrue($entity instanceof BlockContentTypeInterface);