Newer
Older
<?php
Alex Pott
committed
namespace Drupal\Tests\taxonomy\Kernel\Migrate\d6;
Alex Pott
committed
Angie Byron
committed
use Drupal\Core\Entity\Entity\EntityViewDisplay;
Alex Pott
committed
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
/**
* Vocabulary entity display migration.
*
* @group migrate_drupal_6
*/
class MigrateVocabularyEntityDisplayTest extends MigrateDrupal6TestBase {
/**
Angie Byron
committed
* {@inheritdoc}
*/
Angie Byron
committed
public static $modules = ['field', 'taxonomy'];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
Angie Byron
committed
$this->migrateTaxonomy();
}
/**
* Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration.
*/
public function testVocabularyEntityDisplay() {
// Test that the field exists.
Angie Byron
committed
$component = EntityViewDisplay::load('node.page.default')->getComponent('tags');
Angie Byron
committed
$this->assertIdentical('entity_reference_label', $component['type']);
$this->assertIdentical(20, $component['weight']);
// Test the Id map.
$this->assertIdentical(['node', 'article', 'default', 'tags'], $this->getMigration('d6_vocabulary_entity_display')->getIdMap()->lookupDestinationID([4, 'article']));