/**
* Tests the getRowBySource method.
*/
public function testGetRowBySource() { $this->
getDatabase([]);
$row =
[ 'sourceid1' => 'source_id_value_1',
'sourceid2' => 'source_id_value_2',
'source_ids_hash' =>
$this->
getIdMap()->
getSourceIdsHash(['source_id_property' => 'source_id_value_1'
]),
'destid1' => 'destination_id_value_1',
] +
$this->
idMapDefaults();
$this->
saveMap($row);
$row =
[ 'sourceid1' => 'source_id_value_3',
'sourceid2' => 'source_id_value_4',
'source_ids_hash' =>
$this->
getIdMap()->
getSourceIdsHash(['source_id_property' => 'source_id_value_3', 'sourceid2' => 'source_id_value_4'
]),
'destid1' => 'destination_id_value_2',
] +
$this->
idMapDefaults();
$this->
saveMap($row);
$source_id_values =
['source_id_property' =>
$row['sourceid1'
], 'sourceid2' =>
$row['sourceid2'
]];
$id_map =
$this->
getIdMap();
$result_row =
$id_map->
getRowBySource($source_id_values);
$this->
assertSame($row,
$result_row);