You are here

protected function LayoutBuilderQuickEditTest::setUp in Drupal 9

Same name in this branch
  1. 9 core/modules/quickedit/tests/src/Functional/LayoutBuilderQuickEditTest.php \Drupal\Tests\quickedit\Functional\LayoutBuilderQuickEditTest::setUp()
  2. 9 core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php \Drupal\Tests\quickedit\FunctionalJavascript\LayoutBuilderQuickEditTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php, line 64

Class

LayoutBuilderQuickEditTest
Tests that Layout Builder functions with Quick Edit.

Namespace

Drupal\Tests\quickedit\FunctionalJavascript

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->drupalPlaceBlock('page_title_block');

  // Create the Article node type.
  $this
    ->drupalCreateContentType([
    'type' => 'article',
    'name' => 'Article',
  ]);
  $this->article = $this
    ->drupalCreateNode([
    'type' => 'article',
    'title' => t('My Test Node'),
    'body' => [
      'value' => 'Hello Layout Builder!',
      'format' => 'plain_text',
    ],
  ]);

  // Log in as a content author who can use Quick Edit and edit Articles.
  $this->contentAuthorUser = $this
    ->drupalCreateUser([
    'access contextual links',
    'access in-place editing',
    'access content',
    'edit any article content',
  ]);
  $this
    ->drupalLogin($this->contentAuthorUser);
}