.../src/Functional/EntityResource/EntityResourceTestBase.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index aad9313..0ae7b22 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -435,15 +435,23 @@ public function testGet() { ':pattern' => '%[route]=rest.%', ]) ->fetchAllAssoc('cid'); - $this->assertSame(2, count($cache_items)); + $this->assertCount(2, $cache_items); + $found_cache_redirect = FALSE; + $found_cached_response = FALSE; foreach ($cache_items as $cid => $cache_item) { $cached_data = unserialize($cache_item->data); if (!isset($cached_data['#cache_redirect'])) { + $found_cached_response = TRUE; $cached_response = $cached_data['#response']; $this->assertNotInstanceOf(ResourceResponseInterface::class, $cached_response); $this->assertInstanceOf(CacheableResponseInterface::class, $cached_response); } + else { + $found_cache_redirect = TRUE; + } } + $this->assertTrue($found_cache_redirect); + $this->assertTrue($found_cached_response); } } else {