'content_translation',
'language',
'menu_ui',
+ // Required for translation migrations.
+ 'migrate_drupal_multilingual',
'node',
'taxonomy',
];
$this->assertInstanceOf(TermInterface::class, $entity);
$this->assertSame($expected_language, $entity->language()->getId());
$this->assertSame($expected_label, $entity->label());
- $this->assertSame($expected_vid, $entity->getVocabularyId());
+ $this->assertSame($expected_vid, $entity->bundle());
$this->assertSame($expected_description, $entity->getDescription());
$this->assertSame($expected_format, $entity->getFormat());
$this->assertSame($expected_weight, $entity->getWeight());
$this->assertArrayHasKey($tid, $this->treeData[$vid], "Term $tid exists in taxonomy tree");
$term = $this->treeData[$vid][$tid];
- $this->assertEquals($parent_ids, array_filter($term->parents), "Term $tid has correct parents in taxonomy tree");
+ // PostgreSQL, MySQL and SQLite may not return the parent terms in the same
+ // order so sort before testing.
+ sort($parent_ids);
+ $actual_terms = array_filter($term->parents);
+ sort($actual_terms);
+ $this->assertEquals($parent_ids, $actual_terms, "Term $tid has correct parents in taxonomy tree");
}
/**