diff --git a/core/modules/views/tests/src/Kernel/CachableMetadataCalculationTest.php b/core/modules/views/tests/src/Kernel/CachableMetadataCalculationTest.php index 92a2fb1a41..1befb03bd4 100644 --- a/core/modules/views/tests/src/Kernel/CachableMetadataCalculationTest.php +++ b/core/modules/views/tests/src/Kernel/CachableMetadataCalculationTest.php @@ -80,6 +80,7 @@ public function testCacheableMetadataCalculation() { $view = $this->entityTypeManager->getStorage('view')->load(self::TEST_VIEW_ID); $view->save(); $this->assertCachebleMetadataHasBeenCalculated(TRUE); + $this->resetState(); // When a view is being saved due to config being synchronized, the // cacheability metadata doesn't change so it should not be recalculated. @@ -98,8 +99,12 @@ public function testCacheableMetadataCalculation() { protected function assertCachebleMetadataHasBeenCalculated($expected_result) { $this->state->resetCache(); $this->assertEquals($expected_result, $this->state->get('views_test_cacheable_metadata_has_been_accessed')); + } - // Reset the state so we are ready for the next test. + /** + * Resets the state so we are ready for a new test. + */ + protected function resetState() { $this->state->set('views_test_cacheable_metadata_has_been_accessed', FALSE); }