function MigrateTaxonomyVocabularyTest::testTaxonomyVocabulary
Tests the Drupal 6 taxonomy vocabularies to Drupal 8 migration.
1 method overrides MigrateTaxonomyVocabularyTest::testTaxonomyVocabulary()
- MigrateTaxonomyVocabularyTest::testTaxonomyVocabulary in core/modules/ forum/ tests/ src/ Kernel/ Migrate/ d6/ MigrateTaxonomyVocabularyTest.php 
- Tests the Drupal 6 taxonomy vocabularies migration.
File
- 
              core/modules/ taxonomy/ tests/ src/ Kernel/ Migrate/ d6/ MigrateTaxonomyVocabularyTest.php, line 33 
Class
- MigrateTaxonomyVocabularyTest
- Migrate taxonomy vocabularies to taxonomy.vocabulary.*.yml.
Namespace
Drupal\Tests\taxonomy\Kernel\Migrate\d6Code
public function testTaxonomyVocabulary() : void {
  for ($i = 0; $i < 3; $i++) {
    $j = $i + 1;
    $vocabulary = Vocabulary::load("vocabulary_{$j}_i_{$i}_");
    $this->assertSame($this->getMigration('d6_taxonomy_vocabulary')
      ->getIdMap()
      ->lookupDestinationIds([
      $j,
    ]), [
      [
        $vocabulary->id(),
      ],
    ]);
    $this->assertSame("vocabulary {$j} (i={$i})", $vocabulary->label());
    $this->assertSame("description of vocabulary {$j} (i={$i})", $vocabulary->getDescription());
    $this->assertSame(4 + $i, $vocabulary->get('weight'));
  }
  $vocabulary = Vocabulary::load('vocabulary_name_much_longer_th');
  $this->assertSame('vocabulary name much longer than thirty two characters', $vocabulary->label());
  $this->assertSame('description of vocabulary name much longer than thirty two characters', $vocabulary->getDescription());
  $this->assertSame(7, $vocabulary->get('weight'));
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
