Skip to content

Commit e88d25d

Browse files
committed
B2B-2258: Add caching capability to the storeConfig GraphQl
1 parent b851a42 commit e88d25d

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigCacheTest.php

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,17 @@ public function testGetStoreConfig(): void
8383

8484
// Query test store config
8585
$testStoreCode = 'test';
86-
$headerMap['Store'] = $testStoreCode;
87-
$responseTestStore = $this->graphQlQueryWithResponseHeaders($query, [], '', $headerMap);
86+
$responseTestStore = $this->graphQlQueryWithResponseHeaders($query, [], '', ['Store' => $testStoreCode]);
8887
$this->assertArrayHasKey(CacheIdCalculator::CACHE_ID_HEADER, $responseTestStore['headers']);
8988
$testStoreCacheId = $responseTestStore['headers'][CacheIdCalculator::CACHE_ID_HEADER];
9089
$this->assertNotEquals($testStoreCacheId, $defaultStoreCacheId);
9190
// Verify we obtain a cache MISS the first time
9291
$testStoreResponse = $this->assertCacheMissAndReturnResponse(
9392
$query,
94-
[CacheIdCalculator::CACHE_ID_HEADER => $testStoreCacheId]
93+
[
94+
CacheIdCalculator::CACHE_ID_HEADER => $testStoreCacheId,
95+
'Store' => $testStoreCode
96+
]
9597
);
9698
$this->assertArrayHasKey('storeConfig', $testStoreResponse['body']);
9799
$testStoreResponseResult = $testStoreResponse['body']['storeConfig'];
@@ -100,7 +102,10 @@ public function testGetStoreConfig(): void
100102
// Verify we obtain a cache HIT the second time
101103
$testStoreResponseHit = $this->assertCacheHitAndReturnResponse(
102104
$query,
103-
[CacheIdCalculator::CACHE_ID_HEADER => $testStoreCacheId]
105+
[
106+
CacheIdCalculator::CACHE_ID_HEADER => $testStoreCacheId,
107+
'Store' => $testStoreCode
108+
]
104109
);
105110
$this->assertArrayHasKey('storeConfig', $testStoreResponseHit['body']);
106111
$testStoreResponseHitResult = $testStoreResponseHit['body']['storeConfig'];
@@ -127,7 +132,10 @@ public function testGetStoreConfig(): void
127132
// Verify we obtain a cache MISS the 3rd time
128133
$testStoreResponseMiss = $this->assertCacheMissAndReturnResponse(
129134
$query,
130-
[CacheIdCalculator::CACHE_ID_HEADER => $testStoreCacheId]
135+
[
136+
CacheIdCalculator::CACHE_ID_HEADER => $testStoreCacheId,
137+
'Store' => $testStoreCode
138+
]
131139
);
132140
$this->assertArrayHasKey('storeConfig', $testStoreResponseMiss['body']);
133141
$testStoreResponseMissResult = $testStoreResponseMiss['body']['storeConfig'];
@@ -136,7 +144,10 @@ public function testGetStoreConfig(): void
136144
// Verify we obtain a cache HIT the 4th time
137145
$testStoreResponseHit2 = $this->assertCacheHitAndReturnResponse(
138146
$query,
139-
[CacheIdCalculator::CACHE_ID_HEADER => $testStoreCacheId]
147+
[
148+
CacheIdCalculator::CACHE_ID_HEADER => $testStoreCacheId,
149+
'Store' => $testStoreCode
150+
]
140151
);
141152
$this->assertArrayHasKey('storeConfig', $testStoreResponseHit2['body']);
142153
$testStoreResponseHit2Result = $testStoreResponseHit2['body']['storeConfig'];

0 commit comments

Comments
 (0)