function LayoutBuilderQuickEditTest::setUp

Same name in this branch
  1. 8.9.x core/modules/layout_builder/tests/src/Functional/LayoutBuilderQuickEditTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderQuickEditTest::setUp()
Same name and namespace in other branches
  1. 9 core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php \Drupal\Tests\quickedit\FunctionalJavascript\LayoutBuilderQuickEditTest::setUp()
  2. 9 core/modules/quickedit/tests/src/Functional/LayoutBuilderQuickEditTest.php \Drupal\Tests\quickedit\Functional\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);
}

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