$this->
installConfig(['content_translation_test'
]);
$entity = EntityTestWithBundle::
create([ 'type' => 'test',
'langcode' =>
$this->sourceLangcode,
]);
$entity->
save();
// Add a translation with some translation metadata.
$translation =
$entity->
addTranslation($this->translationLangcode
);
$translation_metadata =
$this->contentTranslationManager->
getTranslationMetadata($translation);
$translation_metadata->
setSource($this->sourceLangcode
)->
setOutdated(TRUE
);
$translation->
save();
// Make sure the translation metadata has been saved correctly.
$entity = EntityTestWithBundle::
load($entity->
id());
$translation =
$entity->
getTranslation($this->translationLangcode
);
$translation_metadata =
$this->contentTranslationManager->
getTranslationMetadata($translation);
$this->
assertSame($this->sourceLangcode,
$translation_metadata->
getSource());
$this->
assertTrue($translation_metadata->
isOutdated());
}}