function QuickEditIntegrationLoadingTest::setUp

Overrides BrowserTestBase::setUp

File

core/modules/editor/tests/src/Functional/QuickEditIntegrationLoadingTest.php, line 36

Class

QuickEditIntegrationLoadingTest
Tests Quick Edit module integration endpoints.

Namespace

Drupal\Tests\editor\Functional

Code

protected function setUp() {
    parent::setUp();
    // Create a text format.
    $filtered_html_format = FilterFormat::create([
        'format' => 'filtered_html',
        'name' => 'Filtered HTML',
        'weight' => 0,
        'filters' => [
            'filter_caption' => [
                'status' => 1,
            ],
        ],
    ]);
    $filtered_html_format->save();
    // Create a node type.
    $this->drupalCreateContentType([
        'type' => 'article',
        'name' => 'Article',
    ]);
    // Create one node of the above node type using the above text format.
    $this->drupalCreateNode([
        'type' => 'article',
        'body' => [
            0 => [
                'value' => '<p>Do you also love Drupal?</p><img src="druplicon.png" data-caption="Druplicon" />',
                'format' => 'filtered_html',
            ],
        ],
    ]);
}

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