File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
dev/tests/api-functional/testsuite/Magento/GraphQl/PageCache Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -215,13 +215,20 @@ public function testCacheResultForCustomer()
215
215
);
216
216
$ customerToken = $ tokenResponse ['body ' ]['generateCustomerToken ' ]['token ' ];
217
217
218
+ // Obtain the X-Magento-Cache-Id from the response
219
+ $ productResponse = $ this ->graphQlQueryWithResponseHeaders ($ query );
220
+ $ this ->assertArrayHasKey (CacheIdCalculator::CACHE_ID_HEADER , $ productResponse ['headers ' ]);
221
+ $ cacheIdForProducts = $ productResponse ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
222
+
218
223
// Verify we obtain cache MISS the first time we search by this X-Magento-Cache-Id
219
224
$ this ->assertCacheMissAndReturnResponse ($ query , [
225
+ CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdForProducts ,
220
226
'Authorization ' => 'Bearer ' . $ customerToken
221
227
]);
222
228
223
229
// Verify we obtain cache HIT second time using the same X-Magento-Cache-Id
224
230
$ this ->assertCacheHitAndReturnResponse ($ query , [
231
+ CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdForProducts ,
225
232
'Authorization ' => 'Bearer ' . $ customerToken
226
233
]);
227
234
$ revokeTokenQuery = $ this ->revokeCustomerToken ();
You can’t perform that action at this time.
0 commit comments