3 namespace Drupal\Tests\taxonomy\Kernel\Migrate\d6;
5 use Drupal\field\Entity\FieldStorageConfig;
6 use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
9 * Vocabulary field migration.
11 * @group migrate_drupal_6
13 class MigrateVocabularyFieldTest extends MigrateDrupal6TestBase {
18 public static $modules = ['taxonomy', 'menu_ui'];
23 protected function setUp() {
25 $this->migrateTaxonomy();
29 * Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration.
31 public function testVocabularyField() {
32 // Test that the field exists.
33 $field_storage_id = 'node.tags';
34 /** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
35 $field_storage = FieldStorageConfig::load($field_storage_id);
36 $this->assertIdentical($field_storage_id, $field_storage->id());
38 $settings = $field_storage->getSettings();
39 $this->assertIdentical('taxonomy_term', $settings['target_type'], "Target type is correct.");
40 $this->assertIdentical(1, $field_storage->getCardinality(), "Field cardinality in 1.");
42 $this->assertIdentical(['node', 'tags'], $this->getMigration('d6_vocabulary_field')->getIdMap()->lookupDestinationID([4]), "Test IdMap");