diff --git a/core/modules/node/src/Tests/Views/FrontPageTest.php b/core/modules/node/src/Tests/Views/FrontPageTest.php index 83882bd..934eed3 100644 --- a/core/modules/node/src/Tests/Views/FrontPageTest.php +++ b/core/modules/node/src/Tests/Views/FrontPageTest.php @@ -316,7 +316,7 @@ protected function assertFrontPageViewCacheTags($do_assert_views_caches) { $view->setCurrentPage(0, TRUE); $this->assertViewsCacheTags( $view, - $first_page_result_cache_tags, + NULL, $do_assert_views_caches, $first_page_output_cache_tags ); diff --git a/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php b/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php index 511f8ac..b13f87e 100644 --- a/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php +++ b/core/modules/views/src/Tests/AssertViewsCacheTagsTrait.php @@ -46,7 +46,10 @@ protected function assertViewsCacheTags(ViewExecutable $view, $expected_results_ // active for direct rendering of views, just like for actual requests. /** @var \Symfony\Component\HttpFoundation\RequestStack $request_stack */ $request_stack = \Drupal::service('request_stack'); - $request_stack->push(new Request()); + $request = new Request(); + $request->server->set('REQUEST_TIME', REQUEST_TIME); + $view->setRequest($request); + $request_stack->push($request); $renderer->renderRoot($build); // Render array cache tags. @@ -61,7 +64,7 @@ protected function assertViewsCacheTags(ViewExecutable $view, $expected_results_ $cache_plugin = $view->display_handler->getPlugin('cache'); // Results cache. - $view->execute(); + $results_cache_item = \Drupal::cache('data')->get($cache_plugin->generateResultsKey()); if (is_array($expected_results_cache)) { $this->assertTrue($results_cache_item, 'Results cache item found.');