function LayoutBuilderNestedFormUiTest::testAddingFormBlocksToOverrides
Same name in other branches
- 8.9.x core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderNestedFormUiTest::testAddingFormBlocksToOverrides()
- 10 core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderNestedFormUiTest::testAddingFormBlocksToOverrides()
- 11.x core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderNestedFormUiTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\LayoutBuilderNestedFormUiTest::testAddingFormBlocksToOverrides()
Tests blocks containing forms can be successfully saved editing overrides.
File
-
core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ LayoutBuilderNestedFormUiTest.php, line 102
Class
- LayoutBuilderNestedFormUiTest
- Tests placing blocks containing forms in theLayout Builder UI.
Namespace
Drupal\Tests\layout_builder\FunctionalJavascriptCode
public function testAddingFormBlocksToOverrides() {
$this->drupalLogin($this->drupalCreateUser([
'configure any layout',
'administer node display',
]));
// From the manage display page, enable Layout Builder.
$field_ui_prefix = 'admin/structure/types/manage/bundle_with_section_field';
$this->drupalGet("{$field_ui_prefix}/display/default");
$this->submitForm([
'layout[enabled]' => TRUE,
], 'Save');
$this->submitForm([
'layout[allow_custom]' => TRUE,
], 'Save');
$expected_save_message = 'The layout override has been saved.';
$nid = 1;
foreach (static::FORM_BLOCK_LABELS as $label) {
$this->addFormBlock($label, "node/{$nid}", $expected_save_message);
$nid++;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.