diff -u b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php --- b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php @@ -649,9 +649,15 @@ [1, 101], [2, 102], [3, 103], + // Mock a failed row by setting the destination ID to NULL. + [4, NULL], ]); + // The rows are ordered by destination ID so the failed row should be first. $id_map->rewind(); + $this->assertEquals([], $id_map->currentDestination()); + $this->assertEquals(['nid' => 4], $id_map->currentSource()); + $id_map->next(); $this->assertEquals(['nid' => 101], $id_map->currentDestination()); $this->assertEquals(['nid' => 1], $id_map->currentSource()); $id_map->next(); @@ -660,6 +666,7 @@ $id_map->next(); $this->assertEquals(['nid' => 103], $id_map->currentDestination()); $this->assertEquals(['nid' => 3], $id_map->currentSource()); + $id_map->next(); } /**