public function SectionStorageManagerTest::testConstructNoContextHandler in Drupal 8
@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\UnitCode
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());
}