@@ -271,34 +271,41 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
271
271
);
272
272
273
273
// test non cached store + currency header in USD not cached
274
- $ headerMap = ['Store ' => 'default ' , 'Content-Currency ' => 'USD ' ];
274
+ $ headerMap = ['Store ' => 'default ' , 'Content-Currency ' => 'EUR ' ];
275
275
$ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
276
276
$ this ->assertEquals (
277
277
'Simple Product ' ,
278
278
$ response ['products ' ]['items ' ][0 ]['name ' ],
279
279
'Product name in fixture store is invalid. '
280
280
);
281
281
$ this ->assertEquals (
282
- 'USD ' ,
282
+ 'EUR ' ,
283
283
$ response ['products ' ]['items ' ][0 ]['price ' ]['minimalPrice ' ]['amount ' ]['currency ' ],
284
- 'Currency code USD in fixture store default is unexpected '
284
+ 'Currency code EUR in fixture store default is unexpected '
285
285
);
286
286
287
+ // test cached response store + currency header with non existing currency, and no valid response, no cache
288
+ $ headerMap = ['Store ' => $ storeCodeFromFixture , 'Content-Currency ' => 'SOMECURRENCY ' ];
289
+ $ this ->expectExceptionMessage (
290
+ 'GraphQL response contains errors: Please correct the target currency '
291
+ );
292
+ $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
293
+
287
294
// test non cached store + currency header in USD not cached
288
- $ headerMap = ['Store ' => 'default ' , 'Content-Currency ' => 'EUR ' ];
295
+ $ headerMap = ['Store ' => 'default ' , 'Content-Currency ' => 'USD ' ];
289
296
$ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
290
297
$ this ->assertEquals (
291
298
'Simple Product ' ,
292
299
$ response ['products ' ]['items ' ][0 ]['name ' ],
293
300
'Product name in fixture store is invalid. '
294
301
);
295
302
$ this ->assertEquals (
296
- 'EUR ' ,
303
+ 'USD ' ,
297
304
$ response ['products ' ]['items ' ][0 ]['price ' ]['minimalPrice ' ]['amount ' ]['currency ' ],
298
- 'Currency code EUR in fixture store default is unexpected '
305
+ 'Currency code USD in fixture store default is unexpected '
299
306
);
300
307
301
- // test non cached store + currency header in USD cached
308
+ // test non cached store + currency header in USD cached
302
309
$ headerMap = ['Store ' => 'default ' ];
303
310
$ response = $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
304
311
$ this ->assertEquals (
@@ -311,12 +318,5 @@ public function testProductFromSpecificAndDefaultStoreWithMultiCurrency()
311
318
$ response ['products ' ]['items ' ][0 ]['price ' ]['minimalPrice ' ]['amount ' ]['currency ' ],
312
319
'Currency code USD in fixture store default is unexpected '
313
320
);
314
-
315
- // test cached response store + currency header with non existing currency, and no valid response, no cache
316
- $ headerMap = ['Store ' => $ storeCodeFromFixture , 'Content-Currency ' => 'SOMECURRENCY ' ];
317
- $ this ->expectExceptionMessage (
318
- 'GraphQL response contains errors: Please correct the target currency '
319
- );
320
- $ this ->graphQlQuery ($ query , [], '' , $ headerMap );
321
321
}
322
322
}
0 commit comments