'label' => 'Reference',
'translatable' => FALSE,
])->
save();
$this->container->
get('entity_display.repository'
) ->
getViewDisplay($this->entityTypeId,
$this->entityTypeId, 'default'
) ->
setComponent('field_reference',
[ 'type' => 'entity_reference_entity_view',
]) ->
save();
$this->
setupEntity();
// Create a second entity that references the first to test how the
// translation can be viewed through an entity reference field.
$this->referencingEntity = EntityTestMulRevPub::
create([ 'name' => 'referencing',
'field_reference' =>
$this->entity->
id(),
]);
$this->referencingEntity->
addTranslation($this->langcodes
[2
],
$this->referencingEntity->
toArray());
$this->referencingEntity->
save();
}