function MigrateTermNodeTest::testSkipNonExistentNode

Same name in other branches
  1. 9 core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateTermNodeTest::testSkipNonExistentNode()
  2. 10 core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateTermNodeTest::testSkipNonExistentNode()
  3. 11.x core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php \Drupal\Tests\taxonomy\Kernel\Migrate\d6\MigrateTermNodeTest::testSkipNonExistentNode()

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

File

core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTermNodeTest.php, line 55

Class

MigrateTermNodeTest
Upgrade taxonomy term node associations.

Namespace

Drupal\Tests\taxonomy\Kernel\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,
        'language' => 'en',
    ]);
    // d6_term_node__2 should skip over node 2 (a.k.a. revision 3) because,
    // according to the map table, it failed.
    $migration = $this->getMigration('d6_term_node:2');
    $this->executeMigration($migration);
    $this->assertNull($migration->getIdMap()
        ->lookupDestinationIds([
        'vid' => 3,
    ])[0][0]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.