Loading core/modules/big_pipe/tests/src/Functional/BigPipeTest.php +2 −2 Changes for core/modules/big_pipe/tests/src/Functional/BigPipeTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ protected function assertBigPipeResponseHeadersPresent() { * markup. */ protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_placeholders) { $this->assertSetsEqual(array_keys($expected_big_pipe_nojs_placeholders), array_map('rawurldecode', explode(' ', $this->drupalGetHeader('BigPipe-Test-No-Js-Placeholders')))); $this->assertSetsEqual(array_keys($expected_big_pipe_nojs_placeholders), array_map('rawurldecode', explode(' ', $this->getSession()->getResponseHeader('BigPipe-Test-No-Js-Placeholders')))); foreach ($expected_big_pipe_nojs_placeholders as $big_pipe_nojs_placeholder => $expected_replacement) { // Checking whether the replacement for the BigPipe no-JS placeholder // $big_pipe_nojs_placeholder is present. Loading @@ -362,7 +362,7 @@ protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_p * defined in the order that they are expected to be rendered & streamed. */ protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholders, array $expected_big_pipe_placeholder_stream_order) { $this->assertSetsEqual(array_keys($expected_big_pipe_placeholders), explode(' ', $this->drupalGetHeader('BigPipe-Test-Placeholders'))); $this->assertSetsEqual(array_keys($expected_big_pipe_placeholders), explode(' ', $this->getSession()->getResponseHeader('BigPipe-Test-Placeholders'))); $placeholder_positions = []; $placeholder_replacement_positions = []; foreach ($expected_big_pipe_placeholders as $big_pipe_placeholder_id => $expected_ajax_response) { Loading core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php +1 −1 Changes for core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ protected function verifyPageCacheContainsTags(Url $url, $hit_or_miss, $tags = F $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', $hit_or_miss); if ($hit_or_miss === 'HIT' && is_array($tags)) { $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags')); $cache_tags = explode(' ', $this->getSession()->getResponseHeader('X-Drupal-Cache-Tags')); $tags = array_unique($tags); $this->assertEmpty(array_diff($tags, $cache_tags), 'Page cache tags contains all expected tags.'); } Loading core/modules/page_cache/tests/src/Functional/PageCacheTest.php +2 −2 Changes for core/modules/page_cache/tests/src/Functional/PageCacheTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -204,8 +204,8 @@ public function testConditionalRequests() { $this->drupalGet(''); $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'HIT'); $etag = $this->drupalGetHeader('ETag'); $last_modified = $this->drupalGetHeader('Last-Modified'); $etag = $this->getSession()->getResponseHeader('ETag'); $last_modified = $this->getSession()->getResponseHeader('Last-Modified'); // Ensure a conditional request returns 304 Not Modified. $this->drupalGet('', [], ['If-Modified-Since' => $last_modified, 'If-None-Match' => $etag]); Loading core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php +4 −9 Changes for core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php: 4 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -31,13 +31,8 @@ protected function enablePageCaching() { * The header value, potentially exploded by spaces. */ protected function getCacheHeaderValues($header_name) { $header_value = $this->drupalGetHeader($header_name); if (empty($header_value)) { return []; } else { return explode(' ', $header_value); } $header_value = $this->getSession()->getResponseHeader($header_name); return empty($header_value) ? [] : explode(' ', $header_value); } /** Loading @@ -47,7 +42,7 @@ protected function getCacheHeaderValues($header_name) { * The expected cache context. */ protected function assertCacheContext($expected_cache_context) { $cache_contexts = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Contexts')); $cache_contexts = explode(' ', $this->getSession()->getResponseHeader('X-Drupal-Cache-Contexts')); $this->assertContains($expected_cache_context, $cache_contexts, "'" . $expected_cache_context . "' is present in the X-Drupal-Cache-Contexts header."); } Loading @@ -58,7 +53,7 @@ protected function assertCacheContext($expected_cache_context) { * The expected cache context. */ protected function assertNoCacheContext($not_expected_cache_context) { $cache_contexts = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Contexts')); $cache_contexts = explode(' ', $this->getSession()->getResponseHeader('X-Drupal-Cache-Contexts')); $this->assertNotContains($not_expected_cache_context, $cache_contexts, "'" . $not_expected_cache_context . "' is not present in the X-Drupal-Cache-Contexts header."); } Loading core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php +2 −2 Changes for core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -426,7 +426,7 @@ public function testReferencedEntity() { // Verify a cache hit, but also the presence of the correct cache tags. $this->verifyPageCache($empty_entity_listing_url, 'HIT', $empty_entity_listing_cache_tags); // Verify the entity type's list cache contexts are present. $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $contexts_in_header = $this->getSession()->getResponseHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); // Prime the page cache for the listing containing the referenced entity. Loading @@ -434,7 +434,7 @@ public function testReferencedEntity() { // Verify a cache hit, but also the presence of the correct cache tags. $this->verifyPageCache($nonempty_entity_listing_url, 'HIT', $nonempty_entity_listing_cache_tags); // Verify the entity type's list cache contexts are present. $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $contexts_in_header = $this->getSession()->getResponseHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); // Verify that after modifying the referenced entity, there is a cache miss Loading Loading
core/modules/big_pipe/tests/src/Functional/BigPipeTest.php +2 −2 Changes for core/modules/big_pipe/tests/src/Functional/BigPipeTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ protected function assertBigPipeResponseHeadersPresent() { * markup. */ protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_placeholders) { $this->assertSetsEqual(array_keys($expected_big_pipe_nojs_placeholders), array_map('rawurldecode', explode(' ', $this->drupalGetHeader('BigPipe-Test-No-Js-Placeholders')))); $this->assertSetsEqual(array_keys($expected_big_pipe_nojs_placeholders), array_map('rawurldecode', explode(' ', $this->getSession()->getResponseHeader('BigPipe-Test-No-Js-Placeholders')))); foreach ($expected_big_pipe_nojs_placeholders as $big_pipe_nojs_placeholder => $expected_replacement) { // Checking whether the replacement for the BigPipe no-JS placeholder // $big_pipe_nojs_placeholder is present. Loading @@ -362,7 +362,7 @@ protected function assertBigPipeNoJsPlaceholders(array $expected_big_pipe_nojs_p * defined in the order that they are expected to be rendered & streamed. */ protected function assertBigPipePlaceholders(array $expected_big_pipe_placeholders, array $expected_big_pipe_placeholder_stream_order) { $this->assertSetsEqual(array_keys($expected_big_pipe_placeholders), explode(' ', $this->drupalGetHeader('BigPipe-Test-Placeholders'))); $this->assertSetsEqual(array_keys($expected_big_pipe_placeholders), explode(' ', $this->getSession()->getResponseHeader('BigPipe-Test-Placeholders'))); $placeholder_positions = []; $placeholder_replacement_positions = []; foreach ($expected_big_pipe_placeholders as $big_pipe_placeholder_id => $expected_ajax_response) { Loading
core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php +1 −1 Changes for core/modules/layout_builder/tests/src/Functional/LayoutBuilderFieldBlockEntityReferenceCacheTagsTest.php: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ protected function verifyPageCacheContainsTags(Url $url, $hit_or_miss, $tags = F $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', $hit_or_miss); if ($hit_or_miss === 'HIT' && is_array($tags)) { $cache_tags = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags')); $cache_tags = explode(' ', $this->getSession()->getResponseHeader('X-Drupal-Cache-Tags')); $tags = array_unique($tags); $this->assertEmpty(array_diff($tags, $cache_tags), 'Page cache tags contains all expected tags.'); } Loading
core/modules/page_cache/tests/src/Functional/PageCacheTest.php +2 −2 Changes for core/modules/page_cache/tests/src/Functional/PageCacheTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -204,8 +204,8 @@ public function testConditionalRequests() { $this->drupalGet(''); $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'HIT'); $etag = $this->drupalGetHeader('ETag'); $last_modified = $this->drupalGetHeader('Last-Modified'); $etag = $this->getSession()->getResponseHeader('ETag'); $last_modified = $this->getSession()->getResponseHeader('Last-Modified'); // Ensure a conditional request returns 304 Not Modified. $this->drupalGet('', [], ['If-Modified-Since' => $last_modified, 'If-None-Match' => $etag]); Loading
core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php +4 −9 Changes for core/modules/system/tests/src/Functional/Cache/AssertPageCacheContextsAndTagsTrait.php: 4 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -31,13 +31,8 @@ protected function enablePageCaching() { * The header value, potentially exploded by spaces. */ protected function getCacheHeaderValues($header_name) { $header_value = $this->drupalGetHeader($header_name); if (empty($header_value)) { return []; } else { return explode(' ', $header_value); } $header_value = $this->getSession()->getResponseHeader($header_name); return empty($header_value) ? [] : explode(' ', $header_value); } /** Loading @@ -47,7 +42,7 @@ protected function getCacheHeaderValues($header_name) { * The expected cache context. */ protected function assertCacheContext($expected_cache_context) { $cache_contexts = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Contexts')); $cache_contexts = explode(' ', $this->getSession()->getResponseHeader('X-Drupal-Cache-Contexts')); $this->assertContains($expected_cache_context, $cache_contexts, "'" . $expected_cache_context . "' is present in the X-Drupal-Cache-Contexts header."); } Loading @@ -58,7 +53,7 @@ protected function assertCacheContext($expected_cache_context) { * The expected cache context. */ protected function assertNoCacheContext($not_expected_cache_context) { $cache_contexts = explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Contexts')); $cache_contexts = explode(' ', $this->getSession()->getResponseHeader('X-Drupal-Cache-Contexts')); $this->assertNotContains($not_expected_cache_context, $cache_contexts, "'" . $not_expected_cache_context . "' is not present in the X-Drupal-Cache-Contexts header."); } Loading
core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php +2 −2 Changes for core/modules/system/tests/src/Functional/Entity/EntityCacheTagsTestBase.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -426,7 +426,7 @@ public function testReferencedEntity() { // Verify a cache hit, but also the presence of the correct cache tags. $this->verifyPageCache($empty_entity_listing_url, 'HIT', $empty_entity_listing_cache_tags); // Verify the entity type's list cache contexts are present. $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $contexts_in_header = $this->getSession()->getResponseHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); // Prime the page cache for the listing containing the referenced entity. Loading @@ -434,7 +434,7 @@ public function testReferencedEntity() { // Verify a cache hit, but also the presence of the correct cache tags. $this->verifyPageCache($nonempty_entity_listing_url, 'HIT', $nonempty_entity_listing_cache_tags); // Verify the entity type's list cache contexts are present. $contexts_in_header = $this->drupalGetHeader('X-Drupal-Cache-Contexts'); $contexts_in_header = $this->getSession()->getResponseHeader('X-Drupal-Cache-Contexts'); $this->assertEqual(Cache::mergeContexts($page_cache_contexts, $this->getAdditionalCacheContextsForEntityListing()), empty($contexts_in_header) ? [] : explode(' ', $contexts_in_header)); // Verify that after modifying the referenced entity, there is a cache miss Loading