$this->
submitForm($edit, 'Save'
);
// Check that the new revision has the expected values.
$storage->
resetCache([$id]);
$entity =
$storage->
load($id);
$this->
assertEquals(99,
$entity->
{$field_name_no_access}->value, 'New revision has the expected value for the field with no edit access.'
);
$this->
assertEquals(2,
$entity->
{$field_name}->value, 'New revision has the expected value for the field with edit access.'
);
// Check that the revision is also saved in the revisions table.
$entity =
$this->container->
get('entity_type.manager'
) ->
getStorage($entity_type) ->
loadRevision($entity->
getRevisionId());
$this->
assertEquals(99,
$entity->
{$field_name_no_access}->value, 'New revision has the expected value for the field with no edit access.'
);
$this->
assertEquals(2,
$entity->
{$field_name}->value, 'New revision has the expected value for the field with edit access.'
);
} /**
* Tests hiding a field in a form.
*/
public function testHiddenField() { $entity_type = 'entity_test_rev';
$field_storage =
$this->fieldStorageSingle;
$field_storage['entity_type'
] =
$entity_type;