function BlockViewBuilderTest::getBlockRenderArray

Same name in other branches
  1. 8.9.x core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php \Drupal\Tests\block\Kernel\BlockViewBuilderTest::getBlockRenderArray()
  2. 10 core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php \Drupal\Tests\block\Kernel\BlockViewBuilderTest::getBlockRenderArray()
  3. 11.x core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php \Drupal\Tests\block\Kernel\BlockViewBuilderTest::getBlockRenderArray()

Get a fully built render array for a block.

Return value

array The render array.

4 calls to BlockViewBuilderTest::getBlockRenderArray()
BlockViewBuilderTest::assertBlockRenderedWithExpectedCacheability in core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
Asserts that a block is built/rendered/cached with expected cacheability.
BlockViewBuilderTest::testBlockViewBuilderBuildAlter in core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
Tests block build altering.
BlockViewBuilderTest::testBlockViewBuilderViewAlter in core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
Tests block view altering.
BlockViewBuilderTest::verifyRenderCacheHandling in core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php
Verifies render cache handling of the block being tested.

File

core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php, line 326

Class

BlockViewBuilderTest
Tests the block view builder.

Namespace

Drupal\Tests\block\Kernel

Code

protected function getBlockRenderArray() {
    return $this->container
        ->get('entity_type.manager')
        ->getViewBuilder('block')
        ->view($this->block, 'block');
}

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