@@ -83,8 +83,6 @@ public function testCacheInvalidationForCategoriesWithProduct()
8383 // cache-debug header value should be a MISS when category is loaded first time
8484 $ responseMissOnCategoryQuery = $ this ->graphQlQueryWithResponseHeaders ($ categoryQuery );
8585 $ cacheIdOfCategoryQuery = $ responseMissOnCategoryQuery ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
86- print_r ("CacheId of CategoryQuery \n" );
87- print_r ($ cacheIdOfCategoryQuery );
8886 // Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
8987 $ this ->assertCacheMissAndReturnResponse (
9088 $ categoryQuery ,
@@ -114,39 +112,24 @@ public function testCacheInvalidationForCategoriesWithProduct()
114112 $ productRepository ->save ($ firstProduct );
115113
116114 // cache-debug header value should be MISS after updating product1 and reloading the Category
117- $ responseMissCategoryAfterProductUpdate = $ this ->graphQlQueryWithResponseHeaders ($ categoryQuery );
118- $ this ->assertArrayHasKey (
119- CacheIdCalculator::CACHE_ID_HEADER ,
120- $ responseMissCategoryAfterProductUpdate ['headers ' ]
121- );
122- $ cacheIdOfCategoryAfterProductUpdate =
123- $ responseMissCategoryAfterProductUpdate ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
124- print_r ("CacheId of CategoryQuery After update \n" );
125- print_r ($ cacheIdOfCategoryAfterProductUpdate );
126115 // Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
127116 $ this ->assertCacheMissAndReturnResponse (
128117 $ categoryQuery ,
129- [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfCategoryAfterProductUpdate ]
118+ [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfCategoryQuery ]
130119 );
131120
132121 // cache-debug should be a MISS for product 1 after it is updated - cache invalidation
133- $ responseMissFirstProductAfterProductUpdate = $ this ->graphQlQueryWithResponseHeaders ($ product1Query );
134- $ cacheIdOfFirstProductAfterProductUpdate =
135- $ responseMissFirstProductAfterProductUpdate ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
136122 // Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
137123 $ this ->assertCacheMissAndReturnResponse (
138124 $ product1Query ,
139- [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfFirstProductAfterProductUpdate ]
125+ [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfFirstProduct ]
140126 );
141127
142128 // Cache-debug header responses for product 2 and should be a HIT for product 2
143- $ responseHitSecondProduct = $ this ->graphQlQueryWithResponseHeaders ($ product2Query );
144- $ cacheIdOfSecondProductOnHit =
145- $ responseHitSecondProduct ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
146129 // Verify we obtain a cache HIT the second time around for this X-Magento-Cache-Id
147130 $ this ->assertCacheHitAndReturnResponse (
148131 $ product2Query ,
149- [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfSecondProductOnHit ]
132+ [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfSecondProduct ]
150133 );
151134 }
152135
0 commit comments