diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php index 53a935f..5b8db03 100644 --- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php @@ -404,8 +404,13 @@ public function testReferencedEntity() { $this->pass("Test referencing entity.", 'Debug'); $this->verifyPageCache($referencing_entity_url, 'MISS'); + // Verify a cache hit, but also the presence of the correct cache tags. - $this->verifyPageCache($referencing_entity_url, 'HIT', Cache::mergeTags($referencing_entity_cache_tags, $page_cache_tags, $page_cache_tags_referencing_entity)); + $expectedTags = []; + $expectedTags = Cache::mergeTags($referencing_entity_cache_tags, $page_cache_tags); + $expectedTags = Cache::mergeTags($expectedTags, $page_cache_tags_referencing_entity); + $this->verifyPageCache($referencing_entity_url, 'HIT', $expectedTags); + // Also verify the existence of an entity render cache entry. $cache_keys = ['entity_view', 'entity_test', $this->referencingEntity->id(), 'full']; $cid = $this->createCacheId($cache_keys, $entity_cache_contexts); @@ -429,9 +434,12 @@ public function testReferencedEntity() { $this->pass("Test listing of referencing entities.", 'Debug'); // Prime the page cache for the listing of referencing entities. $this->verifyPageCache($listing_url, 'MISS'); - // Verify a cache hit, but also the presence of the correct cache tags. - $this->verifyPageCache($listing_url, 'HIT', Cache::mergeTags($referencing_entity_cache_tags, $page_cache_tags, $page_cache_tags_referencing_entity)); + // Verify a cache hit, but also the presence of the correct cache tags. + $expectedTags = []; + $expectedTags = Cache::mergeTags($referencing_entity_cache_tags, $page_cache_tags); + $expectedTags = Cache::mergeTags($expectedTags, $page_cache_tags_referencing_entity); + $this->verifyPageCache($listing_url, 'HIT', $expectedTags); $this->pass("Test empty listing.", 'Debug'); // Prime the page cache for the empty listing.