function EditorAdminTest::testAddEditorToExistingFormat

Same name and namespace in other branches
  1. 9 core/modules/editor/tests/src/Functional/EditorAdminTest.php \Drupal\Tests\editor\Functional\EditorAdminTest::testAddEditorToExistingFormat()
  2. 8.9.x core/modules/editor/tests/src/Functional/EditorAdminTest.php \Drupal\Tests\editor\Functional\EditorAdminTest::testAddEditorToExistingFormat()
  3. 11.x core/modules/editor/tests/src/Functional/EditorAdminTest.php \Drupal\Tests\editor\Functional\EditorAdminTest::testAddEditorToExistingFormat()

Tests adding a text editor to an existing text format.

File

core/modules/editor/tests/src/Functional/EditorAdminTest.php, line 83

Class

EditorAdminTest
Tests administration of text editors.

Namespace

Drupal\Tests\editor\Functional

Code

public function testAddEditorToExistingFormat() : void {
  $this->enableUnicornEditor();
  $this->drupalLogin($this->adminUser);
  $this->drupalGet('admin/config/content/formats/manage/filtered_html');
  $edit = $this->selectUnicornEditor();
  // Configure Unicorn Editor's setting to another value.
  $edit['editor[settings][ponies_too]'] = FALSE;
  $this->submitForm($edit, 'Save configuration');
  $this->verifyUnicornEditorConfiguration('filtered_html', FALSE);
  // Switch back to 'None' and check the Unicorn Editor's settings are gone.
  $edit = [
    'editor[editor]' => '',
  ];
  $this->submitForm($edit, 'Configure');
  $this->assertSession()
    ->fieldNotExists('editor[settings][ponies_too]');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.