$date_formatter =
$this->container->
get('date.formatter'
);
$edit =
[ 'uid[0][target_id]' =>
$user->
getAccountName(),
'created[0][value][date]' =>
$date_formatter->
format($values[$langcode]['created'
], 'custom', 'Y-m-d'
),
'created[0][value][time]' =>
$date_formatter->
format($values[$langcode]['created'
], 'custom', 'H:i:s'
),
'sticky[value]' =>
$values[$langcode]['sticky'
],
'promote[value]' =>
$values[$langcode]['promote'
],
];
$options =
['language' =>
$languages[$langcode]];
$url =
$entity->
toUrl('edit-form',
$options);
$this->
drupalGet($url,
$options);
$this->
submitForm($edit,
$this->
getFormSubmitAction($entity,
$langcode));
} $storage->
resetCache([$this->entityId
]);
$entity =
$storage->
load($this->entityId
);
foreach ($this->langcodes
as $langcode) { $translation =
$entity->
getTranslation($langcode);
$metadata =
$this->manager->
getTranslationMetadata($translation);
$this->
assertEquals($values[$langcode]['uid'
],
$metadata->
getAuthor()->
id(), 'Translation author correctly stored.'
);
$this->
assertEquals($values[$langcode]['created'
],
$metadata->
getCreatedTime(), 'Translation date correctly stored.'
);
$this->
assertEquals($values[$langcode]['sticky'
],
$translation->
isSticky(), 'Sticky of Translation correctly stored.'
);
$this->
assertEquals($values[$langcode]['promote'
],
$translation->
isPromoted(), 'Promoted of Translation correctly stored.'
);
}