protected function LayoutBuilderLockTest::setUp in Layout Builder Lock 8
Overrides BrowserTestBase::setUp
File
- tests/
src/ Functional/ LayoutBuilderLockTest.php, line 132
Class
- LayoutBuilderLockTest
- Tests Layout Builder Lock.
Namespace
Drupal\Tests\layout_builder_lock\FunctionalCode
protected function setUp() {
parent::setUp();
// Enable Layout Builder for landing page.
$this
->createContentType([
'type' => 'landing_page',
]);
$bundle = BlockContentType::create([
'id' => 'basic',
'label' => 'Basic',
'revision' => FALSE,
]);
$bundle
->save();
block_content_add_body_field($bundle
->id());
LayoutBuilderEntityViewDisplay::load('node.landing_page.default')
->enableLayoutBuilder()
->setOverridable()
->save();
try {
$this->adminUser = $this
->createUser([], 'administrator', TRUE);
} catch (EntityStorageException $ignored) {
}
try {
$this->adminUserNoBypass = $this
->createUser($this->adminUserNoBypassPermissions, 'administratorNoByPass');
} catch (EntityStorageException $ignored) {
}
try {
$this->editor = $this
->createUser($this->editorPermissions, 'editor');
} catch (EntityStorageException $ignored) {
}
try {
$this->editorOverride = $this
->createUser($this->editorOverridePermissions, 'editorOverride');
} catch (EntityStorageException $ignored) {
}
}