X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FTests%2FCache%2FAssertPageCacheContextsAndTagsTrait.php;fp=web%2Fcore%2Fmodules%2Fsystem%2Fsrc%2FTests%2FCache%2FAssertPageCacheContextsAndTagsTrait.php;h=b115a61ee2f31eddddea84572108537fd8b56162;hp=6bea791e910b9f0640ae9cec52aa5b306ff5882a;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php b/web/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php index 6bea791e9..b115a61ee 100644 --- a/web/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php +++ b/web/core/modules/system/src/Tests/Cache/AssertPageCacheContextsAndTagsTrait.php @@ -9,6 +9,12 @@ use Drupal\Core\Url; * Provides test assertions for testing page-level cache contexts & tags. * * Can be used by test classes that extend \Drupal\simpletest\WebTestBase. + * + * @deprecated Scheduled for removal in Drupal 9.0.0. Use + * \Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait + * instead. + * + * @see https://www.drupal.org/node/2896632 */ trait AssertPageCacheContextsAndTagsTrait { @@ -91,7 +97,7 @@ trait AssertPageCacheContextsAndTagsTrait { // Assert page cache item + expected cache tags. $cid_parts = [$url->setAbsolute()->toString(), 'html']; $cid = implode(':', $cid_parts); - $cache_entry = \Drupal::cache('render')->get($cid); + $cache_entry = \Drupal::cache('page')->get($cid); sort($cache_entry->tags); $this->assertEqual($cache_entry->tags, $expected_tags); $this->debugCacheTags($cache_entry->tags, $expected_tags);