You are here

protected function BlockViewBuilderTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/block/src/Tests/BlockViewBuilderTest.php \Drupal\block\Tests\BlockViewBuilderTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

core/modules/block/src/Tests/BlockViewBuilderTest.php, line 54
Contains \Drupal\block\Tests\BlockViewBuilderTest.

Class

BlockViewBuilderTest
Tests the block view builder.

Namespace

Drupal\block\Tests

Code

protected function setUp() {
  parent::setUp();
  $this->controller = $this->container
    ->get('entity.manager')
    ->getStorage('block');
  \Drupal::state()
    ->set('block_test.content', 'Llamas > unicorns!');

  // Create a block with only required values.
  $this->block = $this->controller
    ->create(array(
    'id' => 'test_block',
    'theme' => 'stark',
    'plugin' => 'test_cache',
  ));
  $this->block
    ->save();
  $this->container
    ->get('cache.render')
    ->deleteAll();
  $this->renderer = $this->container
    ->get('renderer');
}