function SectionStorageManagerTest::setUp
Overrides UnitTestCase::setUp
File
- 
              core/modules/ layout_builder/ tests/ src/ Unit/ SectionStorageManagerTest.php, line 66 
Class
- SectionStorageManagerTest
- @coversDefaultClass \Drupal\layout_builder\SectionStorage\SectionStorageManager[[api-linebreak]]
Namespace
Drupal\Tests\layout_builder\UnitCode
protected function setUp() : void {
  parent::setUp();
  $cache = $this->prophesize(CacheBackendInterface::class);
  $module_handler = $this->prophesize(ModuleHandlerInterface::class);
  $this->contextHandler = $this->prophesize(ContextHandlerInterface::class);
  $this->manager = new SectionStorageManager(new \ArrayObject(), $cache->reveal(), $module_handler->reveal(), $this->contextHandler
    ->reveal());
  $this->discovery = $this->prophesize(DiscoveryInterface::class);
  $reflection_property = new \ReflectionProperty($this->manager, 'discovery');
  $reflection_property->setAccessible(TRUE);
  $reflection_property->setValue($this->manager, $this->discovery
    ->reveal());
  $this->plugin = $this->prophesize(SectionStorageInterface::class);
  $this->factory = $this->prophesize(FactoryInterface::class);
  $this->factory
    ->createInstance('the_plugin_id', [])
    ->willReturn($this->plugin
    ->reveal());
  $reflection_property = new \ReflectionProperty($this->manager, 'factory');
  $reflection_property->setAccessible(TRUE);
  $reflection_property->setValue($this->manager, $this->factory
    ->reveal());
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
