Tests editing an existing field.
function updateField() {
$instance_id = 'node.' . $this->type . '.' . $this->field_name;
// Go to the field edit page.
$this
->drupalGet('admin/structure/types/manage/' . $this->type . '/fields/' . $instance_id . '/field');
// Populate the field settings with new settings.
$string = 'updated dummy test string';
$edit = array(
'field[settings][test_field_setting]' => $string,
);
$this
->drupalPost(NULL, $edit, t('Save field settings'));
// Go to the field instance edit page.
$this
->drupalGet('admin/structure/types/manage/' . $this->type . '/fields/' . $instance_id);
$edit = array(
'instance[settings][test_instance_setting]' => $string,
'instance[widget][settings][test_widget_setting]' => $string,
);
$this
->drupalPost(NULL, $edit, t('Save settings'));
// Assert the field settings are correct.
$this
->assertFieldSettings($this->type, $this->field_name, $string);
// Assert redirection back to the "manage fields" page.
$this
->assertUrl('admin/structure/types/manage/' . $this->type . '/fields');
}