You are here

protected function QuickEditIntegrationTest::setUp in Zircon Profile 8

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

Sets the default field storage backend for fields created during tests.

Overrides QuickEditTestBase::setUp

File

core/modules/editor/src/Tests/QuickEditIntegrationTest.php, line 68
Contains \Drupal\editor\Tests\QuickEditIntegrationTest.

Class

QuickEditIntegrationTest
Tests Edit module integration (Editor module's inline editing support).

Namespace

Drupal\editor\Tests

Code

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

  // Install the Filter module.
  $this
    ->installSchema('system', 'url_alias');

  // Create a field.
  $this->fieldName = 'field_textarea';
  $this
    ->createFieldWithStorage($this->fieldName, 'text', 1, 'Long text field', array(), 'text_textarea', array(
    'size' => 42,
  ), 'text_default', array());

  // Create text format.
  $full_html_format = entity_create('filter_format', array(
    'format' => 'full_html',
    'name' => 'Full HTML',
    'weight' => 1,
    'filters' => array(),
  ));
  $full_html_format
    ->save();

  // Associate text editor with text format.
  $editor = entity_create('editor', array(
    'format' => $full_html_format
      ->id(),
    'editor' => 'unicorn',
  ));
  $editor
    ->save();

  // Also create a text format without an associated text editor.
  entity_create('filter_format', array(
    'format' => 'no_editor',
    'name' => 'No Text Editor',
    'weight' => 2,
    'filters' => array(),
  ))
    ->save();
}