You are here

public function DefaultsSectionStorageTest::testSetSectionList in Drupal 8

@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/DefaultsSectionStorageTest.php, line 194

Class

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

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