7
7
8
8
namespace Magento \GraphQl \PageCache ;
9
9
10
- use Magento \PageCache \Model \Cache \Type as PageCache ;
11
10
use Magento \TestFramework \ObjectManager ;
12
11
use Magento \TestFramework \TestCase \GraphQlAbstract ;
13
12
@@ -243,8 +242,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
243
242
'Currency code EUR in fixture ' . $ storeCodeFromFixture . ' is unexpected '
244
243
);
245
244
246
- $ this ->flushPageCache ();
247
-
248
245
// test cached store + currency header in Euros
249
246
$ headerMap = ['Store ' => $ storeCodeFromFixture , 'Content-Currency ' => 'EUR ' ];
250
247
$ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
@@ -259,8 +256,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
259
256
'Currency code EUR in fixture ' . $ storeCodeFromFixture . ' is unexpected '
260
257
);
261
258
262
- $ this ->flushPageCache ();
263
-
264
259
// test non cached store + currency header in USD
265
260
$ headerMap = ['Store ' => $ storeCodeFromFixture , 'Content-Currency ' => 'USD ' ];
266
261
$ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
@@ -275,8 +270,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
275
270
'Currency code USD in fixture ' . $ storeCodeFromFixture . ' is unexpected '
276
271
);
277
272
278
- $ this ->flushPageCache ();
279
-
280
273
// test non cached store + currency header in USD not cached
281
274
$ headerMap = ['Store ' => 'default ' , 'Content-Currency ' => 'USD ' ];
282
275
$ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
@@ -291,8 +284,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
291
284
'Currency code USD in fixture store default is unexpected '
292
285
);
293
286
294
- $ this ->flushPageCache ();
295
-
296
287
// test non cached store + currency header in USD not cached
297
288
$ headerMap = ['Store ' => 'default ' , 'Content-Currency ' => 'EUR ' ];
298
289
$ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
@@ -307,8 +298,6 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
307
298
'Currency code EUR in fixture store default is unexpected '
308
299
);
309
300
310
- $ this ->flushPageCache ();
311
-
312
301
// test non cached store + currency header in USD cached
313
302
$ headerMap = ['Store ' => 'default ' ];
314
303
$ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
@@ -323,21 +312,12 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
323
312
'Currency code USD in fixture store default is unexpected '
324
313
);
325
314
326
- $ this ->flushPageCache ();
327
-
328
315
// test cached response store + currency header with non existing currency, and no valid response, no cache
329
316
$ headerMap = ['Store ' => $ storeCodeFromFixture , 'Content-Currency ' => 'SOMECURRENCY ' ];
330
317
$ this ->expectExceptionMessage (
331
318
'GraphQL response contains errors: Please correct the target currency '
332
319
);
333
-
334
320
$ this ->graphQlQuery ($ query , [], '' , $ headerMap );
335
321
}
336
322
337
- protected function flushPageCache (): void
338
- {
339
- /** @var PageCache $fullPageCache */
340
- $ fullPageCache = ObjectManager::getInstance ()->get (PageCache::class);
341
- $ fullPageCache ->clean ();
342
- }
343
323
}
0 commit comments