Drupal 8  8.0.2
RendererTestBase Class Reference
Inheritance diagram for RendererTestBase:

Protected Member Functions

 setUp ()
 randomContextValue ()
 setUpUnusedCache ()
 setupMemoryCache ()
 setUpRequest ($method= 'GET')
 assertRenderCacheItem ($cid, $data, $bin= 'render')
- Protected Member Functions inherited from UnitTestCase
 setUp ()
 getRandomGenerator ()
 assertArrayEquals (array $expected, array $actual, $message=NULL)
 getBlockMockWithMachineName ($machine_name)
 getContainerWithCacheTagsInvalidator (CacheTagsInvalidatorInterface $cache_tags_validator)
 getClassResolverStub ()

Protected Attributes

- Protected Attributes inherited from UnitTestCase

Additional Inherited Members

- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 getConfigFactoryStub (array $configs=array())
 getConfigStorageStub (array $configs)
 getStringTranslationStub ()

Detailed Description

Base class for the actual unit tests testing .

Member Function Documentation

assertRenderCacheItem (   $cid,
  $bin = 'render' 

Asserts a render cache item.

string$cidThe expected cache ID.
mixed$dataThe expected data for that cache ID.
string$binThe expected cache bin.

References Cache\mergeTags().

Referenced by RendererBubblingTest\testConditionalCacheContextBubblingSelfHealing(), RendererBubblingTest\testContextBubblingCustomCacheBin(), and RendererBubblingTest\testContextBubblingEdgeCases().

Here is the call graph for this function:

Here is the caller graph for this function:

randomContextValue ( )

Generates a random context value for the placeholder tests.

The #context array used by the placeholder #lazy_builder callback will generally be used to provide metadata like entity IDs, field machine names, paths, etc. for JavaScript replacement of content or assets. In this test, the #lazy_builder callback PlaceholdersTest::callback() renders the context inside test HTML, so using any random string would sometimes cause random test failures because the test output would be unparseable. Instead, we provide random tokens for replacement.

See Also

Referenced by RendererTest\assertAccess(), RendererPlaceholdersTest\generatePlaceholderElement(), RendererPlaceholdersTest\providerPlaceholders(), RendererTest\providerTestRenderBasic(), and RendererPlaceholdersTest\testRecursivePlaceholder().

Here is the caller graph for this function:

setUp ( )


References Drupal\requestStack(), and Drupal\setContainer().

Here is the call graph for this function:

setUpUnusedCache ( )

Sets up a render cache back-end that is asserted to be never used.

Referenced by RendererPlaceholdersTest\testCacheableParentWithPostRequest(), and RendererPlaceholdersTest\testUncacheableParent().

Here is the caller graph for this function:

Field Documentation

Initial value:
= [
'required_cache_contexts' => [

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