function SectionStorageManagerTest::testConstructNoContextHandler

@covers ::__construct

@expectedDeprecation The context.handler service must be passed to \Drupal\layout_builder\SectionStorage\SectionStorageManager::__construct(); it was added in Drupal 8.7.0 and will be required before Drupal 9.0.0.

@group legacy

File

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

Class

SectionStorageManagerTest
@coversDefaultClass \Drupal\layout_builder\SectionStorage\SectionStorageManager

Namespace

Drupal\Tests\layout_builder\Unit

Code

public function testConstructNoContextHandler() {
    $cache = $this->prophesize(CacheBackendInterface::class);
    $module_handler = $this->prophesize(ModuleHandlerInterface::class);
    $container = $this->prophesize(ContainerInterface::class);
    $container->get('context.handler')
        ->shouldBeCalled();
    \Drupal::setContainer($container->reveal());
    new SectionStorageManager(new \ArrayObject(), $cache->reveal(), $module_handler->reveal());
}

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