function QuickEditIntegrationTest::setUp

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

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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.