Drupal 8  8.0.2
BlockViewBuilderTest Class Reference
Inheritance diagram for BlockViewBuilderTest:

Public Member Functions

 testBasicRendering ()
 
 testBlockViewBuilderCache ()
 
 testBlockViewBuilderViewAlter ()
 
 testBlockViewBuilderBuildAlter ()
 

Static Public Attributes

static $modules = array('block', 'block_test', 'system', 'user')
 

Protected Member Functions

 setUp ()
 
 verifyRenderCacheHandling ()
 
 assertBlockRenderedWithExpectedCacheability (array $expected_keys, array $expected_contexts, array $expected_tags, $expected_max_age)
 
 getBlockRenderArray ()
 

Protected Attributes

 $block
 
 $controller
 
 $renderer
 

Detailed Description

Tests the block view builder.

block

Member Function Documentation

assertBlockRenderedWithExpectedCacheability ( array  $expected_keys,
array  $expected_contexts,
array  $expected_tags,
  $expected_max_age 
)
protected

Asserts that a block is built/rendered/cached with expected cacheability.

Parameters
string[]$expected_keys The expected cache keys.
string[]$expected_contexts The expected cache contexts.
string[]$expected_tags The expected cache tags.
int$expected_max_ageThe expected max-age.

References BlockViewBuilderTest\getBlockRenderArray(), Cache\mergeContexts(), Cache\mergeTags(), Drupal\service(), and LanguageInterface\TYPE_INTERFACE.

Referenced by BlockViewBuilderTest\testBlockViewBuilderBuildAlter().

Here is the call graph for this function:

Here is the caller graph for this function:

getBlockRenderArray ( )
protected

Get a fully built render array for a block.

Returns
array The render array.

Referenced by BlockViewBuilderTest\assertBlockRenderedWithExpectedCacheability(), BlockViewBuilderTest\testBlockViewBuilderBuildAlter(), BlockViewBuilderTest\testBlockViewBuilderViewAlter(), and BlockViewBuilderTest\verifyRenderCacheHandling().

Here is the caller graph for this function:

setUp ( )
protected

{}

References Drupal\state().

Here is the call graph for this function:

testBasicRendering ( )

Tests the rendering of blocks.

References Entity\load(), Html\resetSeenIds(), and Drupal\state().

Here is the call graph for this function:

testBlockViewBuilderBuildAlter ( )

Tests block build altering.

See Also
hook_block_build_alter()
hook_block_build_BASE_BLOCK_ID_alter()

References BlockViewBuilderTest\assertBlockRenderedWithExpectedCacheability(), BlockViewBuilderTest\getBlockRenderArray(), Cache\mergeContexts(), Cache\mergeTags(), Cache\PERMANENT, Drupal\request(), and Drupal\state().

Here is the call graph for this function:

testBlockViewBuilderCache ( )

Tests block render cache handling.

References Drupal\state(), and BlockViewBuilderTest\verifyRenderCacheHandling().

Here is the call graph for this function:

testBlockViewBuilderViewAlter ( )

Tests block view altering.

See Also
hook_block_view_alter()
hook_block_view_BASE_BLOCK_ID_alter()

References BlockViewBuilderTest\getBlockRenderArray(), Cache\invalidateTags(), and Drupal\state().

Here is the call graph for this function:

verifyRenderCacheHandling ( )
protected

Verifies render cache handling of the block being tested.

See Also
::testBlockViewBuilderCache()

References BlockViewBuilderTest\getBlockRenderArray(), Drupal\request(), Drupal\service(), and LanguageInterface\TYPE_INTERFACE.

Referenced by BlockViewBuilderTest\testBlockViewBuilderCache().

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following file: