You are here

public function CkeditorCodeMirrorBasicTest::setUp in CKEditor CodeMirror 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/CkeditorCodeMirrorBasicTest.php \Drupal\Tests\ckeditor_codemirror\Functional\CkeditorCodeMirrorBasicTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/CkeditorCodeMirrorBasicTest.php, line 44

Class

CkeditorCodeMirrorBasicTest
Test enabling the module and adding source highlighting to a text format.

Namespace

Drupal\Tests\ckeditor_codemirror\Functional

Code

public function setUp() {
  parent::setUp();

  // Create text format, associate CKEditor.
  $full_html_format = FilterFormat::create([
    'format' => 'full_html',
    'name' => 'Full HTML',
    'weight' => 0,
    'filters' => [],
  ]);
  $full_html_format
    ->save();
  $editor = Editor::create([
    'format' => 'full_html',
    'editor' => 'ckeditor',
  ]);
  $editor
    ->save();

  // Create node type.
  $this
    ->drupalCreateContentType([
    'type' => 'article',
    'name' => 'Article',
  ]);
  $this->privilegedUser = $this
    ->drupalCreateUser([
    'administer site configuration',
    'administer filters',
    'create article content',
    'edit any article content',
    'use text format full_html',
  ]);
  $this
    ->drupalLogin($this->privilegedUser);
}