You are here

protected function EditorIntegrationLoadingTest::setUp in Drupal 9

Overrides BrowserTestBase::setUp

File

core/modules/quickedit/tests/src/Functional/EditorIntegrationLoadingTest.php, line 36

Class

EditorIntegrationLoadingTest
Tests Quick Edit module integration endpoints.

Namespace

Drupal\Tests\quickedit\Functional

Code

protected function setUp() : void {
  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',
      ],
    ],
  ]);
}