function ManageFieldsTest::updateField in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/field_ui/src/Tests/ManageFieldsTest.php \Drupal\field_ui\Tests\ManageFieldsTest::updateField()
Tests editing an existing field.
1 call to ManageFieldsTest::updateField()
- ManageFieldsTest::testCRUDFields in core/
modules/ field_ui/ src/ Tests/ ManageFieldsTest.php - Runs the field CRUD tests.
File
- core/
modules/ field_ui/ src/ Tests/ ManageFieldsTest.php, line 194 - Contains \Drupal\field_ui\Tests\ManageFieldsTest.
Class
- ManageFieldsTest
- Tests the Field UI "Manage fields" screen.
Namespace
Drupal\field_ui\TestsCode
function updateField() {
$field_id = 'node.' . $this->contentType . '.' . $this->fieldName;
// Go to the field edit page.
$this
->drupalGet('admin/structure/types/manage/' . $this->contentType . '/fields/' . $field_id . '/storage');
$this
->assertEscaped($this->fieldLabel);
// Populate the field settings with new settings.
$string = 'updated dummy test string';
$edit = array(
'settings[test_field_storage_setting]' => $string,
);
$this
->drupalPostForm(NULL, $edit, t('Save field settings'));
// Go to the field edit page.
$this
->drupalGet('admin/structure/types/manage/' . $this->contentType . '/fields/' . $field_id);
$edit = array(
'settings[test_field_setting]' => $string,
);
$this
->assertText(t('Default value'), 'Default value heading is shown');
$this
->drupalPostForm(NULL, $edit, t('Save settings'));
// Assert the field settings are correct.
$this
->assertFieldSettings($this->contentType, $this->fieldName, $string);
// Assert redirection back to the "manage fields" page.
$this
->assertUrl('admin/structure/types/manage/' . $this->contentType . '/fields');
}