@@ -33,9 +33,9 @@ public function testCacheIsUsedOnSecondRequest()
3333 $ response = $ this ->graphQlQueryWithResponseHeaders ($ query );
3434 $ this ->assertArrayHasKey (CacheIdCalculator::CACHE_ID_HEADER , $ response ['headers ' ]);
3535 $ 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
3737 $ 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
3939 $ responseHit = $ this ->assertCacheHitAndReturnResponse (
4040 $ query ,
4141 [CacheIdCalculator::CACHE_ID_HEADER => $ cacheId ]
@@ -94,27 +94,26 @@ public function testCacheIsInvalidatedOnBlockUpdate()
9494 [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfEnabledBlock ]
9595 );
9696
97+ //cache-debug should be a MISS after updating content on fixture block
9798 $ newBlockContent = 'New block content!!! ' ;
9899 $ this ->updateBlockContent ($ fixtureBlockIdentifier , $ newBlockContent );
99100
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 (
103103 $ fixtureBlockQuery ,
104104 [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfFixtureBlock ]
105105 );
106106
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 (
110109 $ enabledBlockQuery ,
111110 [CacheIdCalculator::CACHE_ID_HEADER => $ cacheIdOfEnabledBlock ]
112111 );
113112
113+ $ this ->assertNotEmpty ($ enabledBlockHitResponse ['body ' ]);
114114 //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 ' ]);
118117 $ this ->assertEquals ($ fixtureBlockIdentifier , $ blocks [0 ]['identifier ' ]);
119118 $ this ->assertEquals ('CMS Block Title ' , $ blocks [0 ]['title ' ]);
120119 $ this ->assertEquals ($ newBlockContent , $ blocks [0 ]['content ' ]);
0 commit comments