@@ -83,8 +83,6 @@ public function testCacheInvalidationForCategoriesWithProduct()
83
83
// cache-debug header value should be a MISS when category is loaded first time
84
84
$ responseMissOnCategoryQuery = $ this ->graphQlQueryWithResponseHeaders ($ categoryQuery );
85
85
$ cacheIdOfCategoryQuery = $ responseMissOnCategoryQuery ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
86
- print_r ("CacheId of CategoryQuery \n" );
87
- print_r ($ cacheIdOfCategoryQuery );
88
86
// Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
89
87
$ this ->assertCacheMissAndReturnResponse (
90
88
$ categoryQuery ,
@@ -114,39 +112,24 @@ public function testCacheInvalidationForCategoriesWithProduct()
114
112
$ productRepository ->save ($ firstProduct );
115
113
116
114
// 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 );
126
115
// Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
127
116
$ this ->assertCacheMissAndReturnResponse (
128
117
$ categoryQuery ,
129
- [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfCategoryAfterProductUpdate ]
118
+ [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfCategoryQuery ]
130
119
);
131
120
132
121
// 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 ];
136
122
// Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
137
123
$ this ->assertCacheMissAndReturnResponse (
138
124
$ product1Query ,
139
- [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfFirstProductAfterProductUpdate ]
125
+ [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfFirstProduct ]
140
126
);
141
127
142
128
// 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 ];
146
129
// Verify we obtain a cache HIT the second time around for this X-Magento-Cache-Id
147
130
$ this ->assertCacheHitAndReturnResponse (
148
131
$ product2Query ,
149
- [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfSecondProductOnHit ]
132
+ [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfSecondProduct ]
150
133
);
151
134
}
152
135
0 commit comments