You are here

protected function EditorAdminTest::addEditorToNewFormat in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/editor/tests/src/Functional/EditorAdminTest.php \Drupal\Tests\editor\Functional\EditorAdminTest::addEditorToNewFormat()
  2. 10 core/modules/editor/tests/src/Functional/EditorAdminTest.php \Drupal\Tests\editor\Functional\EditorAdminTest::addEditorToNewFormat()

Adds an editor to a new format using the UI.

Parameters

string $format_id: The format id.

string $format_name: The format name.

2 calls to EditorAdminTest::addEditorToNewFormat()
EditorAdminTest::testAddEditorToNewFormat in core/modules/editor/tests/src/Functional/EditorAdminTest.php
Tests adding a text editor to a new text format.
EditorAdminTest::testDisableFormatWithEditor in core/modules/editor/tests/src/Functional/EditorAdminTest.php
Tests format disabling.

File

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

Class

EditorAdminTest
Tests administration of text editors.

Namespace

Drupal\Tests\editor\Functional

Code

protected function addEditorToNewFormat($format_id, $format_name) {
  $this
    ->enableUnicornEditor();
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->drupalGet('admin/config/content/formats/add');

  // Configure the text format name.
  $edit = [
    'name' => $format_name,
    'format' => $format_id,
  ];
  $edit += $this
    ->selectUnicornEditor();
  $this
    ->drupalPostForm(NULL, $edit, t('Save configuration'));
}