You are here

protected function CKEditorLoadingTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php \Drupal\ckeditor\Tests\CKEditorLoadingTest::setUp()

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides WebTestBase::setUp

File

core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php, line 40
Contains \Drupal\ckeditor\Tests\CKEditorLoadingTest.

Class

CKEditorLoadingTest
Tests loading of CKEditor.

Namespace

Drupal\ckeditor\Tests

Code

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

  // Create text format, associate CKEditor.
  $filtered_html_format = entity_create('filter_format', array(
    'format' => 'filtered_html',
    'name' => 'Filtered HTML',
    'weight' => 0,
    'filters' => array(),
  ));
  $filtered_html_format
    ->save();
  $editor = entity_create('editor', array(
    'format' => 'filtered_html',
    'editor' => 'ckeditor',
  ));
  $editor
    ->save();

  // Create a second format without an associated editor so a drop down select
  // list is created when selecting formats.
  $full_html_format = entity_create('filter_format', array(
    'format' => 'full_html',
    'name' => 'Full HTML',
    'weight' => 1,
    'filters' => array(),
  ));
  $full_html_format
    ->save();

  // Create node type.
  $this
    ->drupalCreateContentType(array(
    'type' => 'article',
    'name' => 'Article',
  ));
  $this->untrustedUser = $this
    ->drupalCreateUser(array(
    'create article content',
    'edit any article content',
  ));
  $this->normalUser = $this
    ->drupalCreateUser(array(
    'create article content',
    'edit any article content',
    'use text format filtered_html',
    'use text format full_html',
  ));
}