// Create a destination.
$this->
createDestination(['translations' => TRUE
]);
// Create some pre-existing entities.
$this->storage->
create(['id' => 1, 'langcode' => 'en'
])->
save();
$this->storage->
create(['id' => 2, 'langcode' => 'fr'
])->
save();
$translated =
$this->storage->
create(['id' => 3, 'langcode' => 'en'
]);
$translated->
save();
$translated->
addTranslation('fr'
)->
save();
// Pre-assert that things are as expected.
$this->
assertTranslations(1, 'en'
);
$this->
assertTranslations(2, 'fr'
);
$this->
assertTranslations(3, 'en',
['fr'
]);
$this->
assertNull($this->storage->
load(4
));
$destination_rows =
[ // Existing default translation.
['id' => 1, 'langcode' => 'en', 'action' => MigrateIdMapInterface::ROLLBACK_PRESERVE
],
// New translation.
['id' => 2, 'langcode' => 'en', 'action' => MigrateIdMapInterface::ROLLBACK_DELETE
],
// Existing non-default translation.
['id' => 3, 'langcode' => 'fr', 'action' => MigrateIdMapInterface::ROLLBACK_PRESERVE
],