You are here

public function SectionStorageManagerTest::testLoadFromRouteNull 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 148

Class

SectionStorageManagerTest
@coversDefaultClass \Drupal\layout_builder\SectionStorage\SectionStorageManager

Namespace

Drupal\Tests\layout_builder\Unit

Code

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