protected function assertEntity(string
$id, string
$expected_label, string
$expected_description, int
$expected_weight): void
{ /** @var \Drupal\taxonomy\VocabularyInterface $entity */
$entity = Vocabulary::
load($id);
$this->
assertInstanceOf(VocabularyInterface::
class,
$entity);
$this->
assertSame($expected_label,
$entity->
label());
$this->
assertSame($expected_description,
$entity->
getDescription());
$this->
assertSame($expected_weight,
(int) $entity->
get('weight'
));
} /**
* Tests the Drupal 7 taxonomy vocabularies to Drupal 8 migration.
*/
public function testTaxonomyVocabulary() { $this->
assertEntity('tags', 'Tags', 'Use tags to group articles on similar topics into categories.', 0
);
$this->
assertEntity('forums', 'Sujet de discussion', 'Forum navigation vocabulary', -10
);
$this->
assertEntity('test_vocabulary', 'Test Vocabulary', 'This is the vocabulary description', 0
);
$this->
assertEntity('vocabulary_name_much_longer_th', 'vocabulary name clearly different than machine name and much longer than thirty two characters', 'description of vocabulary name much longer than thirty two characters', 0
);
}