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 <a href="/api/drupal/core%21modules%21layout_builder%21src%21SectionStorage%21SectionStorageManager.php/class/SectionStorageManager/8.9.x" title="Provides the Section Storage type plugin manager." class="local">\Drupal\layout_builder\SectionStorage\SectionStorageManager</a>

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.