You are here

protected function LayoutBuilderQuickEditTest::setUp in Drupal 8

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

Overrides BrowserTestBase::setUp

File

core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php, line 65

Class

LayoutBuilderQuickEditTest
Tests that Layout Builder functions with Quick Edit.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function setUp() {
  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);
}