function LayoutBuilderDefaultValuesTest::testDefaultValues
Tests display of default field values.
File
-
core/
modules/ layout_builder/ tests/ src/ Functional/ LayoutBuilderDefaultValuesTest.php, line 102
Class
- LayoutBuilderDefaultValuesTest
- Tests rendering default field values in Layout Builder.
Namespace
Drupal\Tests\layout_builder\FunctionalCode
public function testDefaultValues() : void {
// Begin by viewing nodes with Layout Builder disabled.
$this->assertNodeWithValues();
$this->assertNodeWithDefaultValues();
// Enable layout builder.
LayoutBuilderEntityViewDisplay::load('node.test_node_type.default')->enableLayoutBuilder()
->save();
// Confirm that default values are handled consistently by Layout Builder.
$this->assertNodeWithValues();
$this->assertNodeWithDefaultValues();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.