Skip to content
Snippets Groups Projects
Commit 327f8e38 authored by catch's avatar catch
Browse files

Issue #2691641 by Jo Fitzgerald, benjy: D7 taxonomy description format not migrating

parent dd70b2f6
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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]);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment