$this->
drupalGet('/admin/structure/types/manage/article/fields/node.article.field_test'
);
$this->
assertSession()->
fieldValueEquals('default_value_input[field_test][0][value]',
$default_value);
// Set a different field value to the field directly, instead of an array.
$default_value =
$this->
randomString();
$field_config->
setDefaultValue($default_value)->
save();
$this->
drupalGet('/admin/structure/types/manage/article/fields/node.article.field_test'
);
$this->
assertSession()->
fieldValueEquals('default_value_input[field_test][0][value]',
$default_value);
// Set a default value callback instead, and the default field form should
// not be visible.
$field_config->
setDefaultValueCallback('\Drupal\field_test\FieldDefaultValueCallbackProvider::calculateDefaultValue'
)->
save();
$this->
drupalGet('/admin/structure/types/manage/article/fields/node.article.field_test'
);
$this->
assertSession()->
fieldNotExists('default_value_input[field_test][0][value]'
);
}}