You are here

protected function QuickEditIntegrationTest::setUp in Drupal 8

Same name in this branch
  1. 8 core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditIntegrationTest::setUp()
  2. 8 core/modules/settings_tray/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php \Drupal\Tests\settings_tray\FunctionalJavascript\QuickEditIntegrationTest::setUp()
  3. 8 core/modules/editor/tests/src/Kernel/QuickEditIntegrationTest.php \Drupal\Tests\editor\Kernel\QuickEditIntegrationTest::setUp()

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

Overrides QuickEditTestBase::setUp

File

core/modules/editor/tests/src/Kernel/QuickEditIntegrationTest.php, line 66

Class

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

Namespace

Drupal\Tests\editor\Kernel

Code

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

  // Install the Filter module.
  // Create a field.
  $this->fieldName = 'field_textarea';
  $this
    ->createFieldWithStorage($this->fieldName, 'text', 1, 'Long text field', [], 'text_textarea', [
    'size' => 42,
  ], 'text_default', []);

  // Create text format.
  $full_html_format = FilterFormat::create([
    'format' => 'full_html',
    'name' => 'Full HTML',
    'weight' => 1,
    'filters' => [],
  ]);
  $full_html_format
    ->save();

  // Associate text editor with text format.
  $editor = Editor::create([
    'format' => $full_html_format
      ->id(),
    'editor' => 'unicorn',
  ]);
  $editor
    ->save();

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