You are here

public function EditorAdminTest::testAddEditorToExistingFormat in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/editor/tests/src/Functional/EditorAdminTest.php \Drupal\Tests\editor\Functional\EditorAdminTest::testAddEditorToExistingFormat()
  2. 9 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 80

Class

EditorAdminTest
Tests administration of text editors.

Namespace

Drupal\Tests\editor\Functional

Code

public function testAddEditorToExistingFormat() {
  $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]');
}