function MigrateVocabularyFieldInstanceTest::testSkipNonExistentNodeType
Same name in other branches
- 9 core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateVocabularyFieldInstanceTest::testSkipNonExistentNodeType()
- 8.9.x core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateVocabularyFieldInstanceTest::testSkipNonExistentNodeType()
- 10 core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateVocabularyFieldInstanceTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateVocabularyFieldInstanceTest::testSkipNonExistentNodeType()
Tests that vocabulary field instances are ignored appropriately.
Vocabulary field instances should be ignored when they belong to node types which were not migrated.
File
-
core/
modules/ taxonomy/ tests/ src/ Kernel/ Migrate/ d6/ MigrateVocabularyFieldInstanceTest.php, line 124
Class
- MigrateVocabularyFieldInstanceTest
- Vocabulary field instance migration.
Namespace
Drupal\Tests\taxonomy\Kernel\Migrate\d6Code
public function testSkipNonExistentNodeType() : void {
// The "story" node type is migrated by d6_node_type but we need to pretend
// that it didn't occur, so record that in the map table.
$this->mockFailure('d6_node_type', [
'type' => 'story',
]);
// d6_vocabulary_field_instance should skip over the "story" node type
// config because, according to the map table, it didn't occur.
$migration = $this->getMigration('d6_vocabulary_field_instance');
$this->executeMigration($migration);
$this->assertNull($migration->getIdMap()
->lookupDestinationIds([
'type' => 'story',
])[0][0]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.