diff --git a/core/modules/taxonomy/migration_templates/d7_taxonomy_term.yml b/core/modules/taxonomy/migration_templates/d7_taxonomy_term.yml index 7546660c003dac17906ac712b6bd2007d56e92e7..3b6f7bf9db074e7e2a05f623774632b471d2b947 100644 --- a/core/modules/taxonomy/migration_templates/d7_taxonomy_term.yml +++ b/core/modules/taxonomy/migration_templates/d7_taxonomy_term.yml @@ -11,7 +11,8 @@ process: migration: d7_taxonomy_vocabulary source: vid name: name - description: description + 'description/value': description + 'description/format': format weight: weight parent: plugin: migration diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php index 8a2ea1142cfe52f6c52323a93ae5ce6a7906b7f8..37e56aa4bc07dd43b8d016119cb540885c8c8afb 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php @@ -35,18 +35,21 @@ protected function setUp() { * The parent vocabulary the migrated entity should have. * @param string $expected_description * The description the migrated entity should have. + * @param string $expected_format + * The format the migrated entity should have. * @param int $expected_weight * The weight the migrated entity should have. * @param array $expected_parents * The parent terms the migrated entity should have. */ - protected function assertEntity($id, $expected_label, $expected_vid, $expected_description = '', $expected_weight = 0, $expected_parents = []) { + protected function assertEntity($id, $expected_label, $expected_vid, $expected_description = '', $expected_format = NULL, $expected_weight = 0, $expected_parents = []) { /** @var \Drupal\taxonomy\TermInterface $entity */ $entity = Term::load($id); $this->assertTrue($entity instanceof TermInterface); $this->assertIdentical($expected_label, $entity->label()); $this->assertIdentical($expected_vid, $entity->getVocabularyId()); $this->assertEqual($expected_description, $entity->getDescription()); + $this->assertEquals($expected_format, $entity->getFormat()); $this->assertEqual($expected_weight, $entity->getWeight()); $this->assertIdentical($expected_parents, $this->getParentIDs($id)); } @@ -55,14 +58,14 @@ protected function assertEntity($id, $expected_label, $expected_vid, $expected_d * Tests the Drupal 7 taxonomy term to Drupal 8 migration. */ public function testTaxonomyTerms() { - $this->assertEntity(1, 'General discussion', 'forums', '', 2); - $this->assertEntity(2, 'Term1', 'test_vocabulary', 'The first term.'); - $this->assertEntity(3, 'Term2', 'test_vocabulary', 'The second term.'); - $this->assertEntity(4, 'Term3', 'test_vocabulary', 'The third term.', 0, [3]); - $this->assertEntity(5, 'Custom Forum', 'forums', 'Where the cool kids are.', 3); - $this->assertEntity(6, 'Games', 'forums', '', 4); - $this->assertEntity(7, 'Minecraft', 'forums', '', 1, [6]); - $this->assertEntity(8, 'Half Life 3', 'forums', '', 0, [6]); + $this->assertEntity(1, 'General discussion', 'forums', '', NULL, 2); + $this->assertEntity(2, 'Term1', 'test_vocabulary', 'The first term.', 'filtered_html'); + $this->assertEntity(3, 'Term2', 'test_vocabulary', 'The second term.', 'filtered_html'); + $this->assertEntity(4, 'Term3', 'test_vocabulary', 'The third term.', 'full_html', 0, [3]); + $this->assertEntity(5, 'Custom Forum', 'forums', 'Where the cool kids are.', NULL, 3); + $this->assertEntity(6, 'Games', 'forums', '', NULL, 4); + $this->assertEntity(7, 'Minecraft', 'forums', '', NULL, 1, [6]); + $this->assertEntity(8, 'Half Life 3', 'forums', '', NULL, 0, [6]); } /**