// Check that the display can be properly saved and read back.
$display->
save();
$display = EntityViewDisplay::
load($display->
id());
foreach (['component_1', 'component_2', 'component_3'
] as $name) { $expected[$name]['region'
] = 'content';
$this->
assertEquals($expected[$name],
$display->
getComponent($name));
} // Ensure that third party settings were added to the config entity.
// These are added by entity_test_entity_presave() implemented in
// entity_test module.
$this->
assertEquals('bar',
$display->
getThirdPartySetting('entity_test', 'foo'
), 'Third party settings were added to the entity view display.'
);
// Check that getComponents() returns options for all components.
$expected['name'
] =
[ 'label' => 'hidden',
'type' => 'string',
'weight' => -5,
'settings' =>
[ 'link_to_entity' => FALSE,
],
'third_party_settings' =>
[],
'region' => 'content',
];