@@ -31,10 +31,10 @@ public function testCacheResultForGuest()
3131 $ cacheId = $ response ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
3232
3333 // Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
34- $ this ->assertCacheMiss ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ cacheId ]);
34+ $ this ->assertCacheMissAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ cacheId ]);
3535
3636 // Verify we obtain a cache HIT the second time around for this X-Magento-Cache-Id
37- $ this ->assertCacheHit ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ cacheId ]);
37+ $ this ->assertCacheHitAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ cacheId ]);
3838 }
3939
4040 /**
@@ -55,9 +55,9 @@ public function testCacheResultForGuestWithStoreHeader()
5555 $ defaultStoreCacheId = $ response ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
5656
5757 // Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
58- $ this ->assertCacheMiss ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultStoreCacheId ]);
58+ $ this ->assertCacheMissAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultStoreCacheId ]);
5959 // Verify we obtain a cache HIT the second time we search the cache using this X-Magento-Cache-Id
60- $ this ->assertCacheHit ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultStoreCacheId ]);
60+ $ this ->assertCacheHitAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultStoreCacheId ]);
6161
6262 // Obtain a new X-Magento-Cache-Id using after updating the Store header
6363 $ secondStoreResponse = $ this ->graphQlQueryWithResponseHeaders (
@@ -72,19 +72,19 @@ public function testCacheResultForGuestWithStoreHeader()
7272 $ secondStoreCacheId = $ secondStoreResponse ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
7373
7474 // Verify we obtain a cache MISS the first time we search by this X-Magento-Cache-Id
75- $ this ->assertCacheMiss ($ query , [
75+ $ this ->assertCacheMissAndReturnResponse ($ query , [
7676 CacheIdCalculator::CACHE_ID_HEADER => $ secondStoreCacheId ,
7777 'Store ' => 'fixture_second_store '
7878 ]);
7979
8080 // Verify we obtain a cache HIT the second time around with the Store header
81- $ this ->assertCacheHit ($ query , [
81+ $ this ->assertCacheHitAndReturnResponse ($ query , [
8282 CacheIdCalculator::CACHE_ID_HEADER => $ secondStoreCacheId ,
8383 'Store ' => 'fixture_second_store '
8484 ]);
8585
8686 // Verify we still obtain a cache HIT for the default store
87- $ this ->assertCacheHit ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultStoreCacheId ]);
87+ $ this ->assertCacheHitAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultStoreCacheId ]);
8888 }
8989
9090 /**
@@ -105,9 +105,9 @@ public function testCacheResultForGuestWithCurrencyHeader()
105105 $ defaultCurrencyCacheId = $ response ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
106106
107107 // Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
108- $ this ->assertCacheMiss ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCurrencyCacheId ]);
108+ $ this ->assertCacheMissAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCurrencyCacheId ]);
109109 // Verify we obtain a cache HIT the second time we search the cache using this X-Magento-Cache-Id
110- $ this ->assertCacheHit ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCurrencyCacheId ]);
110+ $ this ->assertCacheHitAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCurrencyCacheId ]);
111111
112112 // Obtain a new X-Magento-Cache-Id using after updating the Content-Currency header
113113 $ secondCurrencyResponse = $ this ->graphQlQueryWithResponseHeaders (
@@ -122,19 +122,19 @@ public function testCacheResultForGuestWithCurrencyHeader()
122122 $ secondCurrencyCacheId = $ secondCurrencyResponse ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
123123
124124 // Verify we obtain a cache MISS the first time we search by this X-Magento-Cache-Id
125- $ this ->assertCacheMiss ($ query , [
125+ $ this ->assertCacheMissAndReturnResponse ($ query , [
126126 CacheIdCalculator::CACHE_ID_HEADER => $ secondCurrencyCacheId ,
127127 'Content-Currency ' => 'EUR '
128128 ]);
129129
130130 // Verify we obtain a cache HIT the second time around with the changed currency header
131- $ this ->assertCacheHit ($ query , [
131+ $ this ->assertCacheHitAndReturnResponse ($ query , [
132132 CacheIdCalculator::CACHE_ID_HEADER => $ secondCurrencyCacheId ,
133133 'Content-Currency ' => 'EUR '
134134 ]);
135135
136136 // Verify we still obtain a cache HIT for the default currency ( no Content-Currency header)
137- $ this ->assertCacheHit ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCurrencyCacheId ]);
137+ $ this ->assertCacheHitAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCurrencyCacheId ]);
138138 }
139139
140140 /**
@@ -153,8 +153,8 @@ public function testCacheResultForGuestWithOutdatedCacheId()
153153 $ response = $ this ->graphQlQueryWithResponseHeaders ($ query );
154154 $ this ->assertArrayHasKey (CacheIdCalculator::CACHE_ID_HEADER , $ response ['headers ' ]);
155155 $ defaultCacheId = $ response ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
156- $ this ->assertCacheMiss ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCacheId ]);
157- $ this ->assertCacheHit ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCacheId ]);
156+ $ this ->assertCacheMissAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCacheId ]);
157+ $ this ->assertCacheHitAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ defaultCacheId ]);
158158
159159 // Obtain a new X-Magento-Cache-Id using after updating the request with Store header
160160 $ responseWithStore = $ this ->graphQlQueryWithResponseHeaders (
@@ -169,19 +169,19 @@ public function testCacheResultForGuestWithOutdatedCacheId()
169169 $ storeCacheId = $ responseWithStore ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
170170
171171 // Verify we still get a cache MISS since the cache id in the request doesn't match the cache id from response
172- $ this ->assertCacheMiss ($ query , [
172+ $ this ->assertCacheMissAndReturnResponse ($ query , [
173173 CacheIdCalculator::CACHE_ID_HEADER => $ defaultCacheId ,
174174 'Store ' => 'fixture_second_store '
175175 ]);
176176
177177 // Verify we get a cache MISS first time with the updated cache id
178- $ this ->assertCacheMiss ($ query , [
178+ $ this ->assertCacheMissAndReturnResponse ($ query , [
179179 CacheIdCalculator::CACHE_ID_HEADER => $ storeCacheId ,
180180 'Store ' => 'fixture_second_store '
181181 ]);
182182
183183 // Verify we obtain a cache HIT second time around with the updated cache id
184- $ this ->assertCacheHit ($ query , [
184+ $ this ->assertCacheHitAndReturnResponse ($ query , [
185185 CacheIdCalculator::CACHE_ID_HEADER => $ storeCacheId ,
186186 'Store ' => 'fixture_second_store '
187187 ]);
@@ -210,13 +210,13 @@ public function testCacheResultForCustomer()
210210 $ customerToken = $ tokenResponse ['body ' ]['generateCustomerToken ' ]['token ' ];
211211
212212 // Verify we obtain cache MISS the first time we search by this X-Magento-Cache-Id
213- $ this ->assertCacheMiss ($ query , [
213+ $ this ->assertCacheMissAndReturnResponse ($ query , [
214214 CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdCustomer ,
215215 'Authorization ' => 'Bearer ' . $ customerToken
216216 ]);
217217
218218 // Verify we obtain cache HIT second time using the same X-Magento-Cache-Id
219- $ this ->assertCacheHit ($ query , [
219+ $ this ->assertCacheHitAndReturnResponse ($ query , [
220220 CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdCustomer ,
221221 'Authorization ' => 'Bearer ' . $ customerToken
222222 ]);
@@ -237,8 +237,8 @@ public function testCacheResultForCustomer()
237237 $ this ->assertNotEquals ($ cacheIdCustomer , $ cacheIdGuest );
238238
239239 //Verify that omitting the Auth token doesn't send cached content for a logged-in customer
240- $ this ->assertCacheMiss ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdCustomer ]);
241- $ this ->assertCacheMiss ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdCustomer ]);
240+ $ this ->assertCacheMissAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdCustomer ]);
241+ $ this ->assertCacheMissAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdCustomer ]);
242242 }
243243
244244 /**
0 commit comments