Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / taxonomy / tests / src / Kernel / Migrate / d6 / MigrateVocabularyEntityFormDisplayTest.php
index 93ac64369fac60af09867efe81b1f07133a05757..2c96e51760084502714fecc75a7e8a30cb910167 100644 (file)
@@ -41,16 +41,21 @@ class MigrateVocabularyEntityFormDisplayTest extends MigrateDrupal6TestBase {
     $this->executeMigration('d6_vocabulary_entity_form_display');
 
     // Test that the field exists.
-    $component = EntityFormDisplay::load('node.page.default')->getComponent('tags');
-    $this->assertIdentical('options_select', $component['type']);
-    $this->assertIdentical(20, $component['weight']);
+    $component = EntityFormDisplay::load('node.page.default')->getComponent('field_tags');
+    $this->assertSame('options_select', $component['type']);
+    $this->assertSame(20, $component['weight']);
     // Test the Id map.
-    $this->assertIdentical(['node', 'article', 'default', 'tags'], $this->getMigration('d6_vocabulary_entity_form_display')->getIdMap()->lookupDestinationID([4, 'article']));
+    $this->assertSame(['node', 'article', 'default', 'field_tags'], $this->getMigration('d6_vocabulary_entity_form_display')->getIdMap()->lookupDestinationID([4, 'article']));
 
     // 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');
+    $this->assertSame($entity_form_display->getComponent('field_vocabulary_1_i_0_')['type'], 'options_select');
+    $this->assertSame($entity_form_display->getComponent('field_vocabulary_2_i_1_')['type'], 'entity_reference_autocomplete_tags');
+
+    // Tests that a vocabulary named like a D8 base field will be migrated and
+    // prefixed with 'field_' to avoid conflicts.
+    $field_type = EntityFormDisplay::load('node.sponsor.default')->getComponent('field_type');
+    $this->assertTrue(is_array($field_type));
   }
 
   /**