function DefaultsSectionStorageTest::testConfigInstall

Same name and namespace 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 <a href="/api/drupal/core%21modules%21layout_builder%21src%21Plugin%21SectionStorage%21DefaultsSectionStorage.php/class/DefaultsSectionStorage/8.9.x" title="Defines the &#039;defaults&#039; section storage type." class="local">\Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage</a>

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.