Newer
Older
<?php
/**
* @file
Alex Pott
committed
* Contains \Drupal\taxonomy\Tests\Migrate\d6\MigrateVocabularyEntityFormDisplayTest.
*/
Alex Pott
committed
namespace Drupal\taxonomy\Tests\Migrate\d6;
Angie Byron
committed
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\migrate\Entity\Migration;
Alex Pott
committed
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
/**
* Vocabulary entity form display migration.
*
* @group migrate_drupal_6
*/
class MigrateVocabularyEntityFormDisplayTest extends MigrateDrupal6TestBase {
/**
Angie Byron
committed
* {@inheritdoc}
*/
Angie Byron
committed
public static $modules = ['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 testVocabularyEntityFormDisplay() {
// Test that the field exists.
Angie Byron
committed
$component = EntityFormDisplay::load('node.page.default')->getComponent('tags');
$this->assertIdentical('options_select', $component['type']);
$this->assertIdentical(20, $component['weight']);
// Test the Id map.
Angie Byron
committed
$this->assertIdentical(array('node', 'article', 'default', 'tags'), Migration::load('d6_vocabulary_entity_form_display')->getIdMap()->lookupDestinationID(array(4, 'article')));
catch
committed
// Test the term widget tags setting.
$entity_form_display = EntityFormDisplay::load('node.story.default');
$this->assertIdentical($entity_form_display->getComponent('vocabulary_1_i_0_')['type'], 'options_select');
$this->assertIdentical($entity_form_display->getComponent('vocabulary_2_i_1_')['type'], 'entity_reference_autocomplete_tags');