@@ -33,9 +33,9 @@ public function testCacheIsUsedOnSecondRequest()
33
33
$ response = $ this ->graphQlQueryWithResponseHeaders ($ query );
34
34
$ this ->assertArrayHasKey (CacheIdCalculator::CACHE_ID_HEADER , $ response ['headers ' ]);
35
35
$ cacheId = $ response ['headers ' ][CacheIdCalculator::CACHE_ID_HEADER ];
36
- // Verify we obtain a cache MISS the first time we search the cache using this X-Magento-Cache-Id
36
+ // Verify we obtain a cache MISS the first time
37
37
$ this ->assertCacheMissAndReturnResponse ($ query , [CacheIdCalculator::CACHE_ID_HEADER => $ cacheId ]);
38
- // Verify we obtain a cache HIT the second time we search the cache using this X-Magento-Cache-Id
38
+ // Verify we obtain a cache HIT the second time
39
39
$ responseHit = $ this ->assertCacheHitAndReturnResponse (
40
40
$ query ,
41
41
[CacheIdCalculator::CACHE_ID_HEADER => $ cacheId ]
@@ -94,27 +94,26 @@ public function testCacheIsInvalidatedOnBlockUpdate()
94
94
[CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfEnabledBlock ]
95
95
);
96
96
97
+ //cache-debug should be a MISS after updating content on fixture block
97
98
$ newBlockContent = 'New block content!!! ' ;
98
99
$ this ->updateBlockContent ($ fixtureBlockIdentifier , $ newBlockContent );
99
100
100
- //cache-debug should be a MISS after update the block on fixture block query
101
- // Verify we obtain a cache MISS the first time after update on the fixture block
102
- $ fixtureBlockHitResponse = $ this ->assertCacheMissAndReturnResponse (
101
+ // Verify we obtain a cache MISS update on the fixture block
102
+ $ fixtureBlockMissResponse = $ this ->assertCacheMissAndReturnResponse (
103
103
$ fixtureBlockQuery ,
104
104
[CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfFixtureBlock ]
105
105
);
106
106
107
- //cache-debug should be a HIT after update the block on enabled block query
108
- // Verify we obtain a cache HIT on the updated enabled block
109
- $ this ->assertCacheHitAndReturnResponse (
107
+ //Verify we obtain a cache HIT on the enabled block query after the fixture block is updated
108
+ $ enabledBlockHitResponse = $ this ->assertCacheHitAndReturnResponse (
110
109
$ enabledBlockQuery ,
111
110
[CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfEnabledBlock ]
112
111
);
113
112
113
+ $ this ->assertNotEmpty ($ enabledBlockHitResponse ['body ' ]);
114
114
//updated block data should be correct on fixture block
115
- $ this ->assertNotEmpty ($ fixtureBlockHitResponse ['body ' ]);
116
- $ blocks = $ fixtureBlockHitResponse ['body ' ]['cmsBlocks ' ]['items ' ];
117
- $ this ->assertArrayNotHasKey ('errors ' , $ fixtureBlockHitResponse ['body ' ]);
115
+ $ blocks = $ fixtureBlockMissResponse ['body ' ]['cmsBlocks ' ]['items ' ];
116
+ $ this ->assertArrayNotHasKey ('errors ' , $ fixtureBlockMissResponse ['body ' ]);
118
117
$ this ->assertEquals ($ fixtureBlockIdentifier , $ blocks [0 ]['identifier ' ]);
119
118
$ this ->assertEquals ('CMS Block Title ' , $ blocks [0 ]['title ' ]);
120
119
$ this ->assertEquals ($ newBlockContent , $ blocks [0 ]['content ' ]);
0 commit comments