Unverified Commit 9b28e1f7 authored by larowlan's avatar larowlan

Issue #2977054 by msankhala, ilya.no, veerasekar.r89: Edit text format form...

Issue #2977054 by msankhala, ilya.no, veerasekar.r89: Edit text format form should not redirect a user to text format listing
parent 1b317fd5
......@@ -24,6 +24,8 @@ public function form(array $form, FormStateInterface $form_state) {
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$this->messenger()->addStatus($this->t('Added text format %format.', ['%format' => $this->entity->label()]));
$form_state->setRedirect('filter.admin_overview');
return $this->entity;
}
......
......@@ -220,8 +220,6 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
}
}
$form_state->setRedirect('filter.admin_overview');
return $this->entity;
}
......
......@@ -203,7 +203,7 @@ public function testFilterAdmin() {
$edit = [];
$edit['filters[filter_html][settings][allowed_html]'] = "<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>\r\n<quote>";
$this->drupalPostForm('admin/config/content/formats/manage/' . $restricted, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->assertUrl('admin/config/content/formats/manage/' . $restricted);
$this->drupalGet('admin/config/content/formats/manage/' . $restricted);
$this->assertFieldByName('filters[filter_html][settings][allowed_html]', "<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <quote>", 'Allowed HTML tag added.');
......@@ -218,7 +218,7 @@ public function testFilterAdmin() {
$edit['filters[' . $second_filter . '][weight]'] = 1;
$edit['filters[' . $first_filter . '][weight]'] = 2;
$this->drupalPostForm(NULL, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->assertUrl('admin/config/content/formats/manage/' . $restricted);
$this->drupalGet('admin/config/content/formats/manage/' . $restricted);
$this->assertFieldByName('filters[' . $second_filter . '][weight]', 1, 'Order saved successfully.');
$this->assertFieldByName('filters[' . $first_filter . '][weight]', 2, 'Order saved successfully.');
......@@ -268,7 +268,7 @@ public function testFilterAdmin() {
$edit['roles[' . RoleInterface::ANONYMOUS_ID . ']'] = 0;
$edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'] = 1;
$this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->assertUrl('admin/config/content/formats/manage/' . $full);
$this->assertRaw(t('The text format %format has been updated.', ['%format' => $format->label()]), 'Full HTML format successfully updated.');
// Switch user.
......@@ -322,7 +322,7 @@ public function testFilterAdmin() {
$edit = [];
$edit['filters[filter_html][settings][allowed_html]'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>';
$this->drupalPostForm('admin/config/content/formats/manage/' . $basic, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->assertUrl('admin/config/content/formats/manage/' . $basic);
$this->drupalGet('admin/config/content/formats/manage/' . $basic);
$this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Changes reverted.');
......@@ -330,7 +330,7 @@ public function testFilterAdmin() {
$edit = [];
$edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'] = FALSE;
$this->drupalPostForm('admin/config/content/formats/manage/' . $full, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->assertUrl('admin/config/content/formats/manage/' . $full);
$this->assertRaw(t('The text format %format has been updated.', ['%format' => $format->label()]), 'Full HTML format successfully reverted.');
$this->drupalGet('admin/config/content/formats/manage/' . $full);
$this->assertFieldByName('roles[' . RoleInterface::AUTHENTICATED_ID . ']', $edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'], 'Changes reverted.');
......@@ -340,7 +340,7 @@ public function testFilterAdmin() {
$edit['filters[' . $second_filter . '][weight]'] = 2;
$edit['filters[' . $first_filter . '][weight]'] = 1;
$this->drupalPostForm('admin/config/content/formats/manage/' . $basic, $edit, t('Save configuration'));
$this->assertUrl('admin/config/content/formats');
$this->assertUrl('admin/config/content/formats/manage/' . $basic);
$this->drupalGet('admin/config/content/formats/manage/' . $basic);
$this->assertFieldByName('filters[' . $second_filter . '][weight]', $edit['filters[' . $second_filter . '][weight]'], 'Changes reverted.');
$this->assertFieldByName('filters[' . $first_filter . '][weight]', $edit['filters[' . $first_filter . '][weight]'], 'Changes reverted.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment