You are here

protected function CacheableMetadataCalculationTest::cacheableMetadataHasBeenAccessed in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/modules/views_test_cacheable_metadata_calculation/src/Plugin/views/access/CacheableMetadataCalculationTest.php \Drupal\views_test_cacheable_metadata_calculation\Plugin\views\access\CacheableMetadataCalculationTest::cacheableMetadataHasBeenAccessed()

Sets a flag to inform tests that cacheable metadata has been accessed.

3 calls to CacheableMetadataCalculationTest::cacheableMetadataHasBeenAccessed()
CacheableMetadataCalculationTest::getCacheContexts in core/modules/views/tests/modules/views_test_cacheable_metadata_calculation/src/Plugin/views/access/CacheableMetadataCalculationTest.php
The cache contexts associated with this object.
CacheableMetadataCalculationTest::getCacheMaxAge in core/modules/views/tests/modules/views_test_cacheable_metadata_calculation/src/Plugin/views/access/CacheableMetadataCalculationTest.php
The maximum age for which this object may be cached.
CacheableMetadataCalculationTest::getCacheTags in core/modules/views/tests/modules/views_test_cacheable_metadata_calculation/src/Plugin/views/access/CacheableMetadataCalculationTest.php
The cache tags associated with this object.

File

core/modules/views/tests/modules/views_test_cacheable_metadata_calculation/src/Plugin/views/access/CacheableMetadataCalculationTest.php, line 100

Class

CacheableMetadataCalculationTest
Tests plugin that reports when cacheable metadata is being calculated.

Namespace

Drupal\views_test_cacheable_metadata_calculation\Plugin\views\access

Code

protected function cacheableMetadataHasBeenAccessed() {
  $this->state
    ->set('views_test_cacheable_metadata_has_been_accessed', TRUE);
}