// New translation.
['id' => 2, 'langcode' => 'en', 'action' => MigrateIdMapInterface::ROLLBACK_DELETE
],
// Existing non-default translation.
['id' => 3, 'langcode' => 'fr', 'action' => MigrateIdMapInterface::ROLLBACK_PRESERVE
],
// Brand new row.
['id' => 4, 'langcode' => 'fr', 'action' => MigrateIdMapInterface::ROLLBACK_DELETE
],
];
$rollback_actions =
[];
// Import some rows.
foreach ($destination_rows as $idx =>
$destination_row) { $row =
new Row();
foreach ($destination_row as $key =>
$value) { $row->
setDestinationProperty($key,
$value);
} $this->destination->
import($row);
// Check that the rollback action is correct, and save it.
$this->
assertEquals($destination_row['action'
],
$this->destination->
rollbackAction());
$rollback_actions[$idx] =
$this->destination->
rollbackAction();
} $this->
assertTranslations(1, 'en'
);