// Assert a different message is shown when the user is allowed to
// administer the fields.
$user =
$this->
drupalCreateUser([ 'access administration pages',
'access content',
'create basic_page content',
'view media',
'administer node fields',
]);
$this->
drupalLogin($user);
$route_bundle_params = FieldUI::
getRouteBundleParameter(\Drupal::
entityTypeManager()->
getDefinition('node'
), 'basic_page'
);
$field_twin_url =
new Url('entity.field_config.node_field_edit_form',
[ 'field_config' => 'node.basic_page.field_twin_media',
] +
$route_bundle_params);
$field_twin_message = 'There are no allowed media types configured for this field. <a href="' .
$field_twin_url->
toString() . '">Edit the field settings</a> to select the allowed media types.';
$field_empty_types_url =
new Url('entity.field_config.node_field_edit_form',
[ 'field_config' => 'node.basic_page.field_empty_types_media',
] +
$route_bundle_params);
$field_empty_types_message = 'There are no allowed media types configured for this field. <a href="' .
$field_empty_types_url->
toString() . '">Edit the field settings</a> to select the allowed media types.';