function CacheableMetadataCalculationTest::resetState

Same name in other branches
  1. 9 core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php \Drupal\Tests\views\Kernel\CacheableMetadataCalculationTest::resetState()
  2. 8.9.x core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php \Drupal\Tests\views\Kernel\CacheableMetadataCalculationTest::resetState()
  3. 11.x core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php \Drupal\Tests\views\Kernel\CacheableMetadataCalculationTest::resetState()

Resets the state so we are ready for a new test.

1 call to CacheableMetadataCalculationTest::resetState()
CacheableMetadataCalculationTest::testCacheableMetadataCalculation in core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php
Tests that cacheability metadata is only calculated when needed.

File

core/modules/views/tests/src/Kernel/CacheableMetadataCalculationTest.php, line 111

Class

CacheableMetadataCalculationTest
Tests that cacheability metadata is only calculated when needed.

Namespace

Drupal\Tests\views\Kernel

Code

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

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