only in patch2: unchanged: --- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php @@ -115,6 +115,7 @@ function testCRUDFields() { $this->manageFieldsPage(); $this->createField(); $this->updateField(); + $this->updateFieldPrevious(); $this->addExistingField(); $this->cardinalitySettings(); $this->fieldListAdminPage(); @@ -215,6 +216,37 @@ function updateField() { } /** + * Tests editing an existing field and submitting via the Previous button. + */ + function updateFieldPrevious() { + $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 previous'; + $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 . '?destinations=1'); + $edit = array( + 'settings[test_field_setting]' => $string, + ); + $this->assertText(t('Default value'), 'Default value heading is shown'); + $this->drupalPostForm(NULL, $edit, t('Previous')); + + // Assert the field settings are correct. + $this->assertFieldSettings($this->contentType, $this->fieldName, $string); + + // Assert redirection back to the edit page. + $this->assertUrl('admin/structure/types/manage/' . $this->contentType . '/fields/' . $field_id . '/storage'); + } + + /** * Tests adding an existing field in another content type. */ function addExistingField() {