function LayoutBuilderTest::testFormAlter
Same name in other branches
- 9 core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::testFormAlter()
- 10 core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::testFormAlter()
- 11.x core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::testFormAlter()
Tests that hook_form_alter() has access to the Layout Builder info.
File
-
core/
modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderTest.php, line 965
Class
- LayoutBuilderTest
- Tests the Layout Builder UI.
Namespace
Drupal\Tests\layout_builder\FunctionalCode
public function testFormAlter() {
$assert_session = $this->assertSession();
$page = $this->getSession()
->getPage();
$this->drupalLogin($this->drupalCreateUser([
'configure any layout',
'administer node display',
'administer node fields',
]));
$field_ui_prefix = 'admin/structure/types/manage/bundle_with_section_field';
$this->drupalGet("{$field_ui_prefix}/display/default");
$page->checkField('layout[enabled]');
$page->pressButton('Save');
$page->clickLink('Manage layout');
$page->clickLink('Add block');
$page->clickLink('Powered by Drupal');
$assert_session->pageTextContains('Layout Builder Storage: node.bundle_with_section_field.default');
$assert_session->pageTextContains('Layout Builder Section: layout_onecol');
$assert_session->pageTextContains('Layout Builder Component: system_powered_by_block');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.