} // Assert that test values exist.
$this->
queryResultTest($this->
getIdMapContents(),
$expected_results);
// Assert a single row needs an update.
$row_needing_update =
$id_map->
getRowsNeedingUpdate(1
);
$this->
assertCount(1,
$row_needing_update);
// Assert the row matches its original source.
$source_id =
$expected_results[MigrateIdMapInterface::STATUS_NEEDS_UPDATE
]['sourceid1'
];
$test_row =
$id_map->
getRowBySource(['source_id_property' =>
$source_id]);
// $row_needing_update is an array of objects returned from the database,
// but $test_row is an array, so the cast is necessary.
$this->
assertSame($test_row,
(array) $row_needing_update[0
]);
// Add additional row that needs an update.
$source =
['source_id_property' => 'source_value_multiple'
];
$row =
new Row($source,
['source_id_property' =>
[]]);
$destination =
['destination_id_property' => 'destination_value_multiple'
];
$id_map->
saveIdMapping($row,
$destination, MigrateIdMapInterface::STATUS_NEEDS_UPDATE
);
// Assert multiple rows need an update.