public function LayoutBuilderTest::testLayoutBuilderChooseBlocksAlter in Drupal 10
Same name and namespace in other branches
- 8 core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::testLayoutBuilderChooseBlocksAlter()
- 9 core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::testLayoutBuilderChooseBlocksAlter()
File
- core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php, line 942
Class
- LayoutBuilderTest
- Tests the Layout Builder UI.
Namespace
Drupal\Tests\layout_builder\Functional
Code
public function testLayoutBuilderChooseBlocksAlter() {
$assert_session = $this
->assertSession();
$this
->drupalLogin($this
->drupalCreateUser([
'configure any layout',
'administer node display',
'administer node fields',
]));
$this
->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');
$this
->submitForm([
'layout[enabled]' => TRUE,
], 'Save');
$assert_session
->linkExists('Manage layout');
$this
->clickLink('Manage layout');
$this
->clickLink('Add block');
$assert_session
->linkExists('Powered by Drupal');
$assert_session
->linkExists('Default revision');
$assert_session
->linkNotExists('Help');
$assert_session
->linkNotExists('Sticky at top of lists');
$assert_session
->linkNotExists('Main page content');
$assert_session
->linkNotExists('Page title');
$assert_session
->linkNotExists('Changed');
$this
->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');
$this
->clickLink('Manage layout');
$this
->clickLink('Add section', 1);
$assert_session
->linkExists('Two column');
$this
->clickLink('Two column');
$assert_session
->buttonExists('Add section');
$this
->getSession()
->getPage()
->pressButton('Add section');
$this
->clickLink('Add block', 1);
$assert_session
->linkExists('Changed');
}