You are here

public function SectionStorageManagerTest::testLoadFromRoute in Drupal 8

@covers ::loadFromRoute

@expectedDeprecation \Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface::loadFromRoute() is deprecated in Drupal 8.7.0 and will be removed before Drupal 9.0.0. \Drupal\layout_builder\SectionStorageInterface::deriveContextsFromRoute() and \Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface::load() should be used instead. See https://www.drupal.org/node/3012353.

@group legacy

File

core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php, line 135

Class

SectionStorageManagerTest
@coversDefaultClass \Drupal\layout_builder\SectionStorage\SectionStorageManager

Namespace

Drupal\Tests\layout_builder\Unit

Code

public function testLoadFromRoute() {
  $this->plugin
    ->deriveContextsFromRoute('the_value', [], 'the_parameter_name', [])
    ->willReturn([]);
  $result = $this->manager
    ->loadFromRoute('the_plugin_id', 'the_value', [], 'the_parameter_name', []);
  $this
    ->assertInstanceOf(SectionStorageInterface::class, $result);
}