only in patch2: unchanged: --- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php @@ -641,6 +641,28 @@ public function testLookupSourceIDMapping($num_source_fields, $num_destination_f } /** + * Tests currentDestination() and currentSource(). + */ + public function testCurrentDestinationAndSource() { + // Simple map with one source and one destination ID. + $id_map = $this->setupRows(['nid'], ['nid'], [ + [1, 101], + [2, 102], + [3, 103], + ]); + + $id_map->rewind(); + $this->assertEquals(['nid' => 101], $id_map->currentDestination()); + $this->assertEquals(['nid' => 1], $id_map->currentSource()); + $id_map->next(); + $this->assertEquals(['nid' => 102], $id_map->currentDestination()); + $this->assertEquals(['nid' => 2], $id_map->currentSource()); + $id_map->next(); + $this->assertEquals(['nid' => 103], $id_map->currentDestination()); + $this->assertEquals(['nid' => 3], $id_map->currentSource()); + } + + /** * Tests the imported count method. * * Scenarios to test for: