->
addContextDefinition('display', EntityContextDefinition::
fromEntityTypeId('entity_view_display'
)) ->
addContextDefinition('view_mode',
new ContextDefinition('string'
));
$this->plugin = DefaultsSectionStorage::
create($this->container,
[], 'defaults',
$definition);
} /**
* Tests installing defaults via config install.
*/
public function testConfigInstall() { /** @var \Drupal\layout_builder\Entity\LayoutEntityDisplayInterface $display */
$display = LayoutBuilderEntityViewDisplay::
load('entity_test.bundle_with_extra_fields.default'
);
$section =
$display->
getSection(0
);
$this->
assertInstanceOf(Section::
class,
$section);
$this->
assertEquals('layout_twocol_section',
$section->
getLayoutId());
$this->
assertEquals([ 'column_widths' => '50-50',
'label' => '',
],
$section->
getLayoutSettings());
} /**
* @covers ::access
* @dataProvider providerTestAccess
*
* @param bool $expected
* The expected outcome of ::access().
* @param string $operation
* The operation to pass to ::access().
* @param bool $is_enabled
* Whether Layout Builder is enabled for this display.
* @param array $section_data
* Data to store as the sections value for Layout Builder.
*/