You are here

public function MigrateUploadEntityFormDisplayTest::testSkipNonExistentNodeType in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityFormDisplayTest.php \Drupal\Tests\file\Kernel\Migrate\d6\MigrateUploadEntityFormDisplayTest::testSkipNonExistentNodeType()

Tests that entity displays are ignored appropriately.

Entity displays should be ignored when they belong to node types which were not migrated.

File

core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityFormDisplayTest.php, line 56

Class

MigrateUploadEntityFormDisplayTest
Upload form entity display.

Namespace

Drupal\Tests\file\Kernel\Migrate\d6

Code

public function testSkipNonExistentNodeType() {

  // 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_upload_entity_form_display should skip over the "story" node type
  // config because according to the map table, it didn't occur.
  $migration = $this
    ->getMigration('d6_upload_entity_form_display');
  $this
    ->executeMigration($migration);
  $this
    ->assertNull($migration
    ->getIdMap()
    ->lookupDestinationIds([
    'node_type' => 'story',
  ])[0][0]);
}