// outside the layout, the configurable field is not shown at all, and the
// layout itself is rendered (but empty).
$new_expected_fields =
[ 'field field--name-name field--type-string field--label-hidden field__item',
'clearfix text-formatted field field--name-test-display-non-configurable field--type-text field--label-above',
'clearfix text-formatted field field--name-test-display-multiple field--type-text field--label-above',
];
$this->
assertFieldAttributes($this->entity,
$new_expected_fields);
$this->
assertNotEmpty($this->
cssSelect('.layout--onecol'
));
// Removing the layout restores the original rendering of the entity.
$this->entity->
get(OverridesSectionStorage::FIELD_NAME
)->
removeAllSections();
$this->entity->
save();
$this->
assertFieldAttributes($this->entity,
$expected_fields);
// Test that adding a new field after Layout Builder has been installed will
// add the new field to the default region of the first section.
$field_storage = FieldStorageConfig::
create([ 'entity_type' => 'entity_test_base_field_display',
'field_name' => 'test_field_display_post_install',
'type' => 'text',
]);
$field_storage->
save();