LayoutBuilderQuickEditTest.php in Drupal 9
File
core/modules/quickedit/tests/src/Functional/LayoutBuilderQuickEditTest.php
View source
<?php
namespace Drupal\Tests\quickedit\Functional;
use Drupal\Tests\BrowserTestBase;
class LayoutBuilderQuickEditTest extends BrowserTestBase {
protected static $modules = [
'layout_builder',
'node',
'quickedit',
];
protected $defaultTheme = 'stark';
protected function setUp() : void {
parent::setUp();
$this
->createContentType([
'type' => 'bundle_with_section_field',
'name' => 'Bundle with section field',
]);
$this
->createNode([
'type' => 'bundle_with_section_field',
]);
}
public function testPlaceFieldBlockFromDifferentEntityType() {
$page = $this
->getSession()
->getPage();
$this
->drupalLogin($this
->drupalCreateUser([
'configure any layout',
'administer node display',
'access in-place editing',
]));
$this
->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');
$this
->submitForm([
'layout[enabled]' => TRUE,
], 'Save');
$this
->submitForm([
'layout[allow_custom]' => TRUE,
], 'Save');
$this
->drupalGet('node/1/layout');
$page
->clickLink('Add block');
$page
->clickLink('Name');
$page
->pressButton('Add block');
$page
->pressButton('Save layout');
$this
->drupalGet('node/1');
$this
->assertSession()
->statusCodeEquals(200);
}
}