You are here

public function MigrateVocabularyEntityDisplayTest::testVocabularyEntityDisplay in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityDisplayTest.php \Drupal\taxonomy\Tests\Migrate\d6\MigrateVocabularyEntityDisplayTest::testVocabularyEntityDisplay()

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

File

core/modules/taxonomy/src/Tests/Migrate/d6/MigrateVocabularyEntityDisplayTest.php, line 37
Contains \Drupal\taxonomy\Tests\Migrate\d6\MigrateVocabularyEntityDisplayTest.

Class

MigrateVocabularyEntityDisplayTest
Vocabulary entity display migration.

Namespace

Drupal\taxonomy\Tests\Migrate\d6

Code

public function testVocabularyEntityDisplay() {

  // Test that the field exists.
  $component = EntityViewDisplay::load('node.page.default')
    ->getComponent('tags');
  $this
    ->assertIdentical('entity_reference_label', $component['type']);
  $this
    ->assertIdentical(20, $component['weight']);

  // Test the Id map.
  $this
    ->assertIdentical(array(
    'node',
    'article',
    'default',
    'tags',
  ), Migration::load('d6_vocabulary_entity_display')
    ->getIdMap()
    ->lookupDestinationID(array(
    4,
    'article',
  )));
}