function BlockComponentRenderArrayTest::setUp

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php \Drupal\Tests\layout_builder\Unit\BlockComponentRenderArrayTest::setUp()
  2. 8.9.x core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php \Drupal\Tests\layout_builder\Unit\BlockComponentRenderArrayTest::setUp()
  3. 11.x core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php \Drupal\Tests\layout_builder\Unit\BlockComponentRenderArrayTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/layout_builder/tests/src/Unit/BlockComponentRenderArrayTest.php, line 60

Class

BlockComponentRenderArrayTest
@coversDefaultClass \Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray[[api-linebreak]] @group layout_builder

Namespace

Drupal\Tests\layout_builder\Unit

Code

protected function setUp() : void {
  parent::setUp();
  $this->blockManager = $this->prophesize(BlockManagerInterface::class);
  $this->account = $this->prophesize(AccountInterface::class);
  $container = new ContainerBuilder();
  $container->set('plugin.manager.block', $this->blockManager
    ->reveal());
  $container->set('context.handler', $this->prophesize(ContextHandlerInterface::class));
  \Drupal::setContainer($container);
}

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