function EditIntegrationTest::setUp

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

Overrides EditTestBase::setUp

File

drupal/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php, line 67
Contains \Drupal\editor\Tests\EditorIntegrationTest.

Class

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

Namespace

Drupal\editor\Tests

Code

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

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

  // Enable the Text Editor and Text Editor Test module.
  $this
    ->enableModules(array(
    'editor',
    'editor_test',
  ));

  // Create a field.
  $this->field_name = 'field_textarea';
  $this
    ->createFieldWithInstance($this->field_name, 'text', 1, 'Long text field', array(
    'text_processing' => 1,
  ), '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->format,
    'editor' => 'unicorn',
  ));
  $editor
    ->save();
}