@@ -199,7 +199,7 @@ public function testCartPromotionsMultipleCartRules()
199
199
* @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_calculation_price_and_cart_display_settings.php
200
200
* @magentoApiDataFixture Magento/SalesRule/_files/rules_category.php
201
201
*/
202
- public function testCartPromotionsSingleCartRulesWithTaxes ()
202
+ public function testCartPromotionsCartRulesWithTaxes ()
203
203
{
204
204
$ objectManager = Bootstrap::getObjectManager ();
205
205
/** @var ProductRepositoryInterface $productRepository */
@@ -303,7 +303,7 @@ public function testCartPromotionsWithCoupons()
303
303
$ couponCode = '2?ds5!2d ' ;
304
304
$ cartId = $ this ->createEmptyCart ();
305
305
$ this ->addMultipleSimpleProductsToCart ($ cartId , $ qty , $ skus [0 ], $ skus [1 ]);
306
- $ this ->applyCouponToCart ($ cartId , $ couponCode );
306
+ $ this ->applyCouponsToCart ($ cartId , $ couponCode );
307
307
$ query = $ this ->getCartItemPricesQuery ($ cartId );
308
308
$ response = $ this ->graphQlMutation ($ query );
309
309
$ this ->assertCount (2 , $ response ['cart ' ]['items ' ]);
@@ -349,7 +349,6 @@ public function testCartPromotionsWhenNoDiscountIsAvailable()
349
349
/** @var Product $prod2 */
350
350
$ prod1 = $ productRepository ->get ('simple1 ' );
351
351
$ prod2 = $ productRepository ->get ('simple2 ' );
352
- $ productsInCart = [$ prod1 , $ prod2 ];
353
352
$ prod2 ->setVisibility (Visibility::VISIBILITY_BOTH );
354
353
$ productRepository ->save ($ prod2 );
355
354
$ skus =['simple1 ' , 'simple2 ' ];
@@ -393,13 +392,13 @@ public function testCartPromotionsWithNoRuleLabels()
393
392
* @param string $cartId
394
393
* @param string $couponCode
395
394
*/
396
- private function applyCouponToCart (string $ cartId , string $ couponCode )
395
+ private function applyCouponsToCart (string $ cartId , string $ couponCode )
397
396
{
398
397
$ query = <<<QUERY
399
398
mutation {
400
399
applyCouponToCart(input: {cart_id: " $ cartId", coupon_code: " $ couponCode"}) {
401
400
cart {
402
- applied_coupon {
401
+ applied_coupons {
403
402
code
404
403
}
405
404
}
@@ -409,7 +408,7 @@ private function applyCouponToCart(string $cartId, string $couponCode)
409
408
$ response = $ this ->graphQlMutation ($ query );
410
409
411
410
self ::assertArrayHasKey ('applyCouponToCart ' , $ response );
412
- self ::assertEquals ($ couponCode , $ response ['applyCouponToCart ' ]['cart ' ]['applied_coupon ' ]['code ' ]);
411
+ self ::assertEquals ($ couponCode , $ response ['applyCouponToCart ' ]['cart ' ]['applied_coupons ' ][ 0 ]['code ' ]);
413
412
}
414
413
415
414
/**
0 commit comments