function OverridesSectionStorageTest::testSetSectionList

@covers ::setSectionList

@expectedDeprecation \Drupal\layout_builder\SectionStorageInterface::setSectionList() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. This method should no longer be used. The section list should be derived from context. See https://www.drupal.org/node/3016262. @group legacy

File

core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php, line 217

Class

OverridesSectionStorageTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21layout_builder%21src%21Plugin%21SectionStorage%21OverridesSectionStorage.php/class/OverridesSectionStorage/8.9.x" title="Defines the &#039;overrides&#039; section storage type." class="local">\Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage</a>

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testSetSectionList() {
    $section_list = $this->prophesize(SectionListInterface::class);
    $this->expectException(\Exception::class);
    $this->expectExceptionMessage('\\Drupal\\layout_builder\\SectionStorageInterface::setSectionList() must no longer be called. The section list should be derived from context. See https://www.drupal.org/node/3016262.');
    $this->plugin
        ->setSectionList($section_list->reveal());
}

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