function LayoutBuilderNestedFormUiTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderNestedFormUiTest::setUp()
  2. 8.9.x core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderNestedFormUiTest::setUp()
  3. 11.x core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderNestedFormUiTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php, line 46

Class

LayoutBuilderNestedFormUiTest
Tests placing blocks containing forms in theLayout Builder UI.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function setUp() : void {
  parent::setUp();
  $this->drupalPlaceBlock('local_tasks_block');
  // Create a separate node to add a form block to, respectively.
  // - Block with form api form will be added to first node layout.
  // - Block with inline template with <form> tag added to second node layout.
  // - Views block exposed form added to third node layout.
  $this->createContentType([
    'type' => 'bundle_with_section_field',
    'name' => 'Bundle with section field',
  ]);
  for ($i = 1; $i <= count(static::FORM_BLOCK_LABELS); $i++) {
    $this->createNode([
      'type' => 'bundle_with_section_field',
      'title' => "Node {$i} title",
    ]);
  }
}

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