function CacheableMetadataCalculationTest::cacheableMetadataHasBeenAccessed

Same name and namespace in other branches
  1. 9 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()
  2. 8.9.x 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()
  3. 10 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 101

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);
}

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