function MigrateVocabularyEntityDisplayTest::testVocabularyEntityDisplay

Same name in this branch
  1. 10 core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateVocabularyEntityDisplayTest::testVocabularyEntityDisplay()
Same name in other branches
  1. 9 core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateVocabularyEntityDisplayTest::testVocabularyEntityDisplay()
  2. 8.9.x core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateVocabularyEntityDisplayTest::testVocabularyEntityDisplay()
  3. 11.x core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateVocabularyEntityDisplayTest::testVocabularyEntityDisplay()
  4. 11.x core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateVocabularyEntityDisplayTest::testVocabularyEntityDisplay()

Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration.

File

core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyEntityDisplayTest.php, line 42

Class

MigrateVocabularyEntityDisplayTest
Vocabulary entity display migration.

Namespace

Drupal\Tests\taxonomy\Kernel\Migrate\d6

Code

public function testVocabularyEntityDisplay() : void {
    $this->executeMigration('d6_vocabulary_entity_display');
    // Test that the field exists.
    $component = EntityViewDisplay::load('node.page.default')->getComponent('field_tags');
    $this->assertSame('entity_reference_label', $component['type']);
    $this->assertSame(20, $component['weight']);
    // Test the Id map.
    $this->assertSame([
        [
            'node',
            'article',
            'default',
            'field_tags',
        ],
    ], $this->getMigration('d6_vocabulary_entity_display')
        ->getIdMap()
        ->lookupDestinationIds([
        4,
        'article',
    ]));
    // Tests that a vocabulary named like a D8 base field will be migrated and
    // prefixed with 'field_' to avoid conflicts.
    $field_type = EntityViewDisplay::load('node.sponsor.default')->getComponent('field_type');
    $this->assertIsArray($field_type);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.