$translation->
set('translatable_test_field',
$values['de'
][$i]['translatable_test_field'
]);
$translation->
save();
} // Check that the fields and properties contain new content.
// Verify that the revision ID changed.
$this->
assertGreaterThan($legacy_revision_id,
$entity->revision_id->value
);
$this->
assertNotEquals($legacy_name,
$entity->name->value,
new FormattableMarkup('%entity_type: Name changed.',
['%entity_type' =>
$entity_type]));
$this->
assertNotEquals($legacy_text,
$entity->translatable_test_field->value,
new FormattableMarkup('%entity_type: Text changed.',
['%entity_type' =>
$entity_type]));
} $revisions =
$storage->
loadMultipleRevisions($revision_ids);
for ($i = 0;
$i <
$revision_count;
$i++
) { // Load specific revision.
$entity_revision =
$revisions[$revision_ids[$i]];
// Check if properties and fields contain the revision specific content.
$this->
assertEquals($revision_ids[$i],
$entity_revision->revision_id->value,
new FormattableMarkup('%entity_type: Revision ID matches.',
['%entity_type' =>
$entity_type]));
$this->
assertEquals($values['en'
][$i]['name'
],
$entity_revision->name->value,
new FormattableMarkup('%entity_type: Name matches.',
['%entity_type' =>
$entity_type]));
$this->
assertEquals($values['en'
][$i]['translatable_test_field'
][0
],
$entity_revision->translatable_test_field
[0
]->value,
new FormattableMarkup('%entity_type: Text matches.',
['%entity_type' =>
$entity_type]));
$this->
assertEquals($values['en'
][$i]['translatable_test_field'
][1
],
$entity_revision->translatable_test_field
[1
]->value,
new FormattableMarkup('%entity_type: Text matches.',
['%entity_type' =>
$entity_type]));
// Check the translated values.