Drupal 8  8.0.2
CacheableMetadataTest Class Reference
Inheritance diagram for CacheableMetadataTest:

Public Member Functions

 testMerge (CacheableMetadata $a, CacheableMetadata $b, CacheableMetadata $expected)
 
 testAddCacheableDependency (CacheableMetadata $a, CacheableMetadata $b, CacheableMetadata $expected)
 
 providerTestMerge ()
 
 testAddCacheTags ()
 
 testSetCacheMaxAge ($data, $expect_exception)
 
 providerSetCacheMaxAge ()
 
 testCreateFromRenderArray (array $render_array, CacheableMetadata $expected)
 
 providerTestCreateFromRenderArray ()
 
 testCreateFromObject ($object, CacheableMetadata $expected)
 
 providerTestCreateFromObject ()
 
- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 
 getConfigFactoryStub (array $configs=array())
 
 getConfigStorageStub (array $configs)
 
 getStringTranslationStub ()
 

Additional Inherited Members

- 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 inherited from UnitTestCase
 $randomGenerator
 
 $root
 

Detailed Description

Cache

Member Function Documentation

providerSetCacheMaxAge ( )

Data provider for testSetCacheMaxAge.

providerTestCreateFromObject ( )

Provides test data for createFromObject().

Returns
array

References Cache\PERMANENT.

providerTestCreateFromRenderArray ( )

Provides test data for createFromRenderArray().

Returns
array

References Cache\PERMANENT.

providerTestMerge ( )

Provides test data for testMerge().

Returns
array

References Cache\PERMANENT.

testAddCacheableDependency ( CacheableMetadata  $a,
CacheableMetadata  $b,
CacheableMetadata  $expected 
)

::addCacheableDependency providerTestMerge

This only tests at a high level, because it reuses existing logic. Detailed tests exist for the existing logic:

See Also
::testMergeTags()
::testMergeMaxAges()

References RefinableCacheableDependencyInterface\addCacheableDependency(), and Drupal\setContainer().

Here is the call graph for this function:

testAddCacheTags ( )

This delegates to Cache::mergeTags(), so just a basic test.

::addCacheTags

testCreateFromObject (   $object,
CacheableMetadata  $expected 
)

::createFromObject providerTestCreateFromObject

References CacheableMetadata\createFromObject().

Here is the call graph for this function:

testCreateFromRenderArray ( array  $render_array,
CacheableMetadata  $expected 
)

::createFromRenderArray providerTestCreateFromRenderArray

References CacheableMetadata\createFromRenderArray().

Here is the call graph for this function:

testMerge ( CacheableMetadata  $a,
CacheableMetadata  $b,
CacheableMetadata  $expected 
)

::merge providerTestMerge

This only tests at a high level, because it reuses existing logic. Detailed tests exist for the existing logic:

See Also
::testMergeTags()
::testMergeMaxAges()

References CacheableMetadata\merge(), and Drupal\setContainer().

Here is the call graph for this function:

testSetCacheMaxAge (   $data,
  $expect_exception 
)

Test valid and invalid values as max age.

::setCacheMaxAge providerSetCacheMaxAge


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