X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Ftaxonomy%2Ftests%2Fsrc%2FKernel%2FMigrate%2Fd6%2FMigrateVocabularyFieldTest.php;fp=web%2Fcore%2Fmodules%2Ftaxonomy%2Ftests%2Fsrc%2FKernel%2FMigrate%2Fd6%2FMigrateVocabularyFieldTest.php;h=d294ec481d63622e4782c4e8d89d477accc6f973;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=784da4a951491b6ee2ad4ac2001264c755c37d5e;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldTest.php b/web/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldTest.php index 784da4a95..d294ec481 100644 --- a/web/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldTest.php +++ b/web/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldTest.php @@ -30,16 +30,21 @@ class MigrateVocabularyFieldTest extends MigrateDrupal6TestBase { */ public function testVocabularyField() { // Test that the field exists. - $field_storage_id = 'node.tags'; + $field_storage_id = 'node.field_tags'; /** @var \Drupal\field\FieldStorageConfigInterface $field_storage */ $field_storage = FieldStorageConfig::load($field_storage_id); - $this->assertIdentical($field_storage_id, $field_storage->id()); + $this->assertSame($field_storage_id, $field_storage->id()); $settings = $field_storage->getSettings(); - $this->assertIdentical('taxonomy_term', $settings['target_type'], "Target type is correct."); - $this->assertIdentical(1, $field_storage->getCardinality(), "Field cardinality in 1."); + $this->assertSame('taxonomy_term', $settings['target_type'], "Target type is correct."); + $this->assertSame(1, $field_storage->getCardinality(), "Field cardinality in 1."); - $this->assertIdentical(['node', 'tags'], $this->getMigration('d6_vocabulary_field')->getIdMap()->lookupDestinationID([4]), "Test IdMap"); + $this->assertSame(['node', 'field_tags'], $this->getMigration('d6_vocabulary_field')->getIdMap()->lookupDestinationID([4]), "Test IdMap"); + + // Tests that a vocabulary named like a D8 base field will be migrated and + // prefixed with 'field_' to avoid conflicts. + $field_type = FieldStorageConfig::load('node.field_type'); + $this->assertInstanceOf(FieldStorageConfig::class, $field_type); } }