protected function LayoutBuilderTest::setUp in Block Style Plugins 8.2
Overrides BrowserTestBase::setUp
File
- tests/
src/ FunctionalJavascript/ LayoutBuilderTest.php, line 37
Class
- LayoutBuilderTest
- Layout Builder tests.
Namespace
Drupal\Tests\block_style_plugins\FunctionalJavascriptCode
protected function setUp() : void {
parent::setUp();
$user = $this
->drupalCreateUser([
'configure any layout',
'administer node display',
'administer node fields',
'access contextual links',
]);
$user
->save();
$this
->drupalLogin($user);
$this
->createContentType([
'type' => 'bundle_with_section_field',
]);
// The Layout Builder UI relies on local tasks.
$this
->drupalPlaceBlock('local_tasks_block');
// Enable layout builder.
$field_ui_prefix = 'admin/structure/types/manage/bundle_with_section_field';
$this
->drupalGet("{$field_ui_prefix}/display/default");
$this
->submitForm([
'layout[enabled]' => TRUE,
'layout[allow_custom]' => TRUE,
], 'Save');
// Start by creating a node.
$node = $this
->createNode([
'type' => 'bundle_with_section_field',
'body' => [
[
'value' => 'The node body',
],
],
]);
$node
->save();
}