function DefaultsSectionStorageTest::testConfigInstall

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php \Drupal\Tests\layout_builder\Kernel\DefaultsSectionStorageTest::testConfigInstall()
  2. 10 core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php \Drupal\Tests\layout_builder\Kernel\DefaultsSectionStorageTest::testConfigInstall()
  3. 11.x core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php \Drupal\Tests\layout_builder\Kernel\DefaultsSectionStorageTest::testConfigInstall()

Tests installing defaults via config install.

File

core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php, line 66

Class

DefaultsSectionStorageTest
@coversDefaultClass \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage

Namespace

Drupal\Tests\layout_builder\Kernel

Code

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());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.