public function LayoutBuilderTest::testCustomSectionAttributes 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::testCustomSectionAttributes()
- 9 core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php \Drupal\Tests\layout_builder\Functional\LayoutBuilderTest::testCustomSectionAttributes()
Tests that sections can provide custom attributes.
File
- core/
modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderTest.php, line 1200
Class
- LayoutBuilderTest
- Tests the Layout Builder UI.
Namespace
Drupal\Tests\layout_builder\FunctionalCode
public function testCustomSectionAttributes() {
$assert_session = $this
->assertSession();
$page = $this
->getSession()
->getPage();
$this
->drupalLogin($this
->drupalCreateUser([
'configure any layout',
'administer node display',
]));
$this
->drupalGet('admin/structure/types/manage/bundle_with_section_field/display/default');
$this
->submitForm([
'layout[enabled]' => TRUE,
], 'Save');
$page
->clickLink('Manage layout');
$page
->clickLink('Add section');
$page
->clickLink('Layout Builder Test Plugin');
$page
->pressButton('Add section');
// See \Drupal\layout_builder_test\Plugin\Layout\LayoutBuilderTestPlugin::build().
$assert_session
->elementExists('css', '.go-birds');
}