$display_repository->
getFormDisplay('node', 'page'
) ->
setComponent($field_name,
$widget_settings) ->
save();
$display_repository->
getViewDisplay('node', 'page'
) ->
setComponent($field_name) ->
save();
// Confirm the defaults are present on the article field storage settings
// form.
$field_id =
$field->
id();
$this->
drupalGet("admin/structure/types/manage/article/fields/
$field_id/storage"
);
$this->
assertSession()->
hiddenFieldValueEquals('settings[default_image][uuid][fids]',
$default_images['field_storage'
]->
id());
// Confirm the defaults are present on the article field edit form.
$this->
drupalGet("admin/structure/types/manage/article/fields/
$field_id"
);
$this->
assertSession()->
hiddenFieldValueEquals('settings[default_image][uuid][fids]',
$default_images['field'
]->
id());
// Confirm the defaults are present on the page field storage settings form.
$this->
drupalGet("admin/structure/types/manage/page/fields/
$field_id/storage"
);
$this->
assertSession()->
hiddenFieldValueEquals('settings[default_image][uuid][fids]',
$default_images['field_storage'
]->
id());
// Confirm the defaults are present on the page field edit form.
$field2_id =
$field2->
id();
$this->
drupalGet("admin/structure/types/manage/page/fields/
$field2_id"
);
$this->
assertSession()->
hiddenFieldValueEquals('settings[default_image][uuid][fids]',
$default_images['field2'
]->
id());