You are here

public function MigrateTermNodeTest::testSkipNonExistentNode in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTermNodeTest.php \Drupal\taxonomy\Tests\Migrate\d6\MigrateTermNodeTest::testSkipNonExistentNode()

Tests that term associations are ignored when they belong to nodes which were not migrated.

File

core/modules/taxonomy/src/Tests/Migrate/d6/MigrateTermNodeTest.php, line 62
Contains \Drupal\taxonomy\Tests\Migrate\d6\MigrateTermNodeTest.

Class

MigrateTermNodeTest
Upgrade taxonomy term node associations.

Namespace

Drupal\taxonomy\Tests\Migrate\d6

Code

public function testSkipNonExistentNode() {

  // Node 2 is migrated by d6_node__story, but we need to pretend that it
  // failed, so record that in the map table.
  $this
    ->mockFailure('d6_node__story', [
    'nid' => 2,
  ]);

  // d6_term_node__2 should skip over node 2 (a.k.a. revision 3) because,
  // according to the map table, it failed.
  $migration = Migration::load('d6_term_node__2');
  $this
    ->executeMigration($migration);
  $this
    ->assertNull($migration
    ->getIdMap()
    ->lookupDestinationId([
    'vid' => 3,
  ])[0]);
}