You are here

protected function EditorAdminTest::addEditorToNewFormat 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::addEditorToNewFormat()
  2. 9 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.

File

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

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
    ->submitForm($edit, 'Save configuration');
}