From 095d7075a9f2c7267233f0f1ecbce2abb559eab1 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Wed, 18 Sep 2019 16:17:45 +0300 Subject: [PATCH 1/7] graphQl-903: deprecated use_for_shipping in billing address schema --- .../Model/Cart/AssignBillingAddressToCart.php | 6 +++--- .../Model/Cart/SetBillingAddressOnCart.php | 10 +++++----- app/code/Magento/QuoteGraphQl/etc/schema.graphqls | 3 ++- .../Quote/Customer/SetBillingAddressOnCartTest.php | 12 ++++++------ .../Quote/Guest/SetBillingAddressOnCartTest.php | 12 ++++++------ 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/AssignBillingAddressToCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/AssignBillingAddressToCart.php index dd6478b4873c6..64a5a16cb84a2 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/AssignBillingAddressToCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/AssignBillingAddressToCart.php @@ -39,17 +39,17 @@ public function __construct( * * @param CartInterface $cart * @param AddressInterface $billingAddress - * @param bool $useForShipping + * @param bool $sameAsShipping * @throws GraphQlInputException * @throws GraphQlNoSuchEntityException */ public function execute( CartInterface $cart, AddressInterface $billingAddress, - bool $useForShipping + bool $sameAsShipping ): void { try { - $this->billingAddressManagement->assign($cart->getId(), $billingAddress, $useForShipping); + $this->billingAddressManagement->assign($cart->getId(), $billingAddress, $sameAsShipping); } catch (NoSuchEntityException $e) { throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e); } catch (LocalizedException $e) { diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php index 673debefd0874..08aeb56e4cd09 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php @@ -56,8 +56,8 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b { $customerAddressId = $billingAddressInput['customer_address_id'] ?? null; $addressInput = $billingAddressInput['address'] ?? null; - $useForShipping = isset($billingAddressInput['use_for_shipping']) - ? (bool)$billingAddressInput['use_for_shipping'] : false; + $sameAsshipping = isset($billingAddressInput['same_as_shipping']) + ? (bool)$billingAddressInput['same_as_shipping'] : false; if (null === $customerAddressId && null === $addressInput) { throw new GraphQlInputException( @@ -72,15 +72,15 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b } $addresses = $cart->getAllShippingAddresses(); - if ($useForShipping && count($addresses) > 1) { + if ($sameAsshipping && count($addresses) > 1) { throw new GraphQlInputException( - __('Using the "use_for_shipping" option with multishipping is not possible.') + __('Using the "same_as_shipping" option with multishipping is not possible.') ); } $billingAddress = $this->createBillingAddress($context, $customerAddressId, $addressInput); - $this->assignBillingAddressToCart->execute($cart, $billingAddress, $useForShipping); + $this->assignBillingAddressToCart->execute($cart, $billingAddress, $sameAsshipping); } /** diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index a86eea46aa864..ae0a1bc34866a 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -96,7 +96,8 @@ input SetBillingAddressOnCartInput { input BillingAddressInput { customer_address_id: Int address: CartAddressInput - use_for_shipping: Boolean + use_for_shipping: Boolean @doc(description: "Deprecated. Use same_as_shipping") + same_as_shipping: Boolean } input CartAddressInput { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index 011930e723273..ec4ab012d37dc 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -120,7 +120,7 @@ public function testSetNewBillingAddress() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php */ - public function testSetNewBillingAddressWithUseForShippingParameter() + public function testSetNewBillingAddressWithSameAsShippingParameter() { $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); @@ -142,7 +142,7 @@ public function testSetNewBillingAddressWithUseForShippingParameter() telephone: "88776655" save_in_address_book: false } - use_for_shipping: true + same_as_shipping: true } } ) { @@ -337,7 +337,7 @@ public function testSetNewBillingAddressWithoutCustomerAddressIdAndAddress() input: { cart_id: "$maskedQuoteId" billing_address: { - use_for_shipping: true + same_as_shipping: true } } ) { @@ -363,7 +363,7 @@ public function testSetNewBillingAddressWithoutCustomerAddressIdAndAddress() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_multishipping_with_two_shipping_addresses.php */ - public function testSetNewBillingAddressWithUseForShippingAndMultishipping() + public function testSetNewBillingAddressWithSameAsShippingAndMultishipping() { $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); @@ -385,7 +385,7 @@ public function testSetNewBillingAddressWithUseForShippingAndMultishipping() telephone: "88776655" save_in_address_book: false } - use_for_shipping: true + same_as_shipping: true } } ) { @@ -399,7 +399,7 @@ public function testSetNewBillingAddressWithUseForShippingAndMultishipping() QUERY; self::expectExceptionMessage( - 'Using the "use_for_shipping" option with multishipping is not possible.' + 'Using the "same_as_shipping" option with multishipping is not possible.' ); $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php index 730e65b4ba8aa..8e500510494c2 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php @@ -90,7 +90,7 @@ public function testSetNewBillingAddress() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php */ - public function testSetNewBillingAddressWithUseForShippingParameter() + public function testSetNewBillingAddressWithSameAsShippingParameter() { $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); @@ -112,7 +112,7 @@ public function testSetNewBillingAddressWithUseForShippingParameter() telephone: "88776655" save_in_address_book: false } - use_for_shipping: true + same_as_shipping: true } } ) { @@ -346,7 +346,7 @@ public function testSetNewBillingAddressWithoutCustomerAddressIdAndAddress() input: { cart_id: "$maskedQuoteId" billing_address: { - use_for_shipping: true + same_as_shipping: true } } ) { @@ -371,7 +371,7 @@ public function testSetNewBillingAddressWithoutCustomerAddressIdAndAddress() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_multishipping_with_two_shipping_addresses.php */ - public function testSetNewBillingAddressWithUseForShippingAndMultishipping() + public function testSetNewBillingAddressWithSameAsShippingAndMultishipping() { $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); @@ -393,7 +393,7 @@ public function testSetNewBillingAddressWithUseForShippingAndMultishipping() telephone: "88776655" save_in_address_book: false } - use_for_shipping: true + same_as_shipping: true } } ) { @@ -407,7 +407,7 @@ public function testSetNewBillingAddressWithUseForShippingAndMultishipping() QUERY; self::expectExceptionMessage( - 'Using the "use_for_shipping" option with multishipping is not possible.' + 'Using the "same_as_shipping" option with multishipping is not possible.' ); $this->graphQlMutation($query); } From 5dd4a1085b02c25d061b3d0ab85783823de068cf Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Fri, 27 Sep 2019 09:48:13 +0300 Subject: [PATCH 2/7] graphQl-903: added description to the same_as_shipping field --- app/code/Magento/QuoteGraphQl/etc/schema.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index ae0a1bc34866a..e97582b9ae52d 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -97,7 +97,7 @@ input BillingAddressInput { customer_address_id: Int address: CartAddressInput use_for_shipping: Boolean @doc(description: "Deprecated. Use same_as_shipping") - same_as_shipping: Boolean + same_as_shipping: Boolean @doc(description: "Set billing address same as shipping") } input CartAddressInput { From aeb0175397d78221372cc21d8db74168afb77c5f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 27 Sep 2019 13:19:01 +0300 Subject: [PATCH 3/7] graphQl-903: Update app/code/Magento/QuoteGraphQl/etc/schema.graphqls Co-Authored-By: Lena Orobei --- app/code/Magento/QuoteGraphQl/etc/schema.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index e97582b9ae52d..1c60f18c5bc26 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -96,7 +96,7 @@ input SetBillingAddressOnCartInput { input BillingAddressInput { customer_address_id: Int address: CartAddressInput - use_for_shipping: Boolean @doc(description: "Deprecated. Use same_as_shipping") + use_for_shipping: Boolean @doc(description: "Deprecated: use `same_as_shipping` field instead") same_as_shipping: Boolean @doc(description: "Set billing address same as shipping") } From 298e4048b512542c44d05901e25dadbd1e1afb5b Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Wed, 2 Oct 2019 10:02:27 +0300 Subject: [PATCH 4/7] GraphQl-903: use_for_shipping backward compatibility --- .../Model/Cart/SetBillingAddressOnCart.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php index 08aeb56e4cd09..0f211a63726b4 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php @@ -56,9 +56,14 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b { $customerAddressId = $billingAddressInput['customer_address_id'] ?? null; $addressInput = $billingAddressInput['address'] ?? null; - $sameAsshipping = isset($billingAddressInput['same_as_shipping']) + $sameAsShipping = isset($billingAddressInput['same_as_shipping']) ? (bool)$billingAddressInput['same_as_shipping'] : false; + if (!isset($billingAddressInput['same_as_shipping'])) { + $sameAsShipping = isset($billingAddressInput['use_for_shipping']) + ? (bool)$billingAddressInput['use_for_shipping'] : false; + } + if (null === $customerAddressId && null === $addressInput) { throw new GraphQlInputException( __('The billing address must contain either "customer_address_id" or "address".') @@ -72,7 +77,7 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b } $addresses = $cart->getAllShippingAddresses(); - if ($sameAsshipping && count($addresses) > 1) { + if ($sameAsShipping && count($addresses) > 1) { throw new GraphQlInputException( __('Using the "same_as_shipping" option with multishipping is not possible.') ); @@ -80,7 +85,7 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b $billingAddress = $this->createBillingAddress($context, $customerAddressId, $addressInput); - $this->assignBillingAddressToCart->execute($cart, $billingAddress, $sameAsshipping); + $this->assignBillingAddressToCart->execute($cart, $billingAddress, $sameAsShipping); } /** From 9d96481c5d690fc4fd399b5a63007e5d91d440d6 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Wed, 2 Oct 2019 12:04:18 +0300 Subject: [PATCH 5/7] GraphQl-903: fixed static issue --- .../QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php index 0f211a63726b4..b90752ae7358b 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php @@ -56,13 +56,10 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b { $customerAddressId = $billingAddressInput['customer_address_id'] ?? null; $addressInput = $billingAddressInput['address'] ?? null; + $useForShipping = isset($billingAddressInput['use_for_shipping']) + ? (bool)$billingAddressInput['use_for_shipping'] : false; $sameAsShipping = isset($billingAddressInput['same_as_shipping']) - ? (bool)$billingAddressInput['same_as_shipping'] : false; - - if (!isset($billingAddressInput['same_as_shipping'])) { - $sameAsShipping = isset($billingAddressInput['use_for_shipping']) - ? (bool)$billingAddressInput['use_for_shipping'] : false; - } + ? (bool)$billingAddressInput['same_as_shipping'] : $useForShipping; if (null === $customerAddressId && null === $addressInput) { throw new GraphQlInputException( From 493971936b3a29957632dadb3b2b551388876f58 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Sun, 20 Oct 2019 22:31:48 +0300 Subject: [PATCH 6/7] GraphQl-903: fixed priority of `same as shipping` --- .../Model/Cart/SetBillingAddressOnCart.php | 6 +- .../Customer/SetBillingAddressOnCartTest.php | 76 ++++++++++++++++++ .../Guest/SetBillingAddressOnCartTest.php | 79 ++++++++++++++++++- 3 files changed, 156 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php index 45713f9372e7b..0d937cc64a857 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php @@ -65,10 +65,10 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b { $customerAddressId = $billingAddressInput['customer_address_id'] ?? null; $addressInput = $billingAddressInput['address'] ?? null; - $useForShipping = isset($billingAddressInput['use_for_shipping']) - ? (bool)$billingAddressInput['use_for_shipping'] : false; $sameAsShipping = isset($billingAddressInput['same_as_shipping']) - ? (bool)$billingAddressInput['same_as_shipping'] : $useForShipping; + ? (bool)$billingAddressInput['same_as_shipping'] : false; + $sameAsShipping = isset($billingAddressInput['use_for_shipping']) + ? (bool)$billingAddressInput['use_for_shipping'] : $sameAsShipping; if (null === $customerAddressId && null === $addressInput) { throw new GraphQlInputException( diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index 2e4fa0a4cdc96..65497a993da6a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -208,6 +208,82 @@ public function testSetNewBillingAddressWithSameAsShippingParameter() $this->assertNewAddressFields($shippingAddressResponse, 'ShippingCartAddress'); } + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + */ + public function testSetNewBillingAddressWithUseForShippingParameter() + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + + $query = <<graphQlMutation($query, [], '', $this->getHeaderMap()); + + self::assertArrayHasKey('cart', $response['setBillingAddressOnCart']); + $cartResponse = $response['setBillingAddressOnCart']['cart']; + self::assertArrayHasKey('billing_address', $cartResponse); + $billingAddressResponse = $cartResponse['billing_address']; + self::assertArrayHasKey('shipping_addresses', $cartResponse); + $shippingAddressResponse = current($cartResponse['shipping_addresses']); + $this->assertNewAddressFields($billingAddressResponse); + $this->assertNewAddressFields($shippingAddressResponse, 'ShippingCartAddress'); + } + /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php index 891b4425fe23e..8d3f62f68a82a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php @@ -84,12 +84,87 @@ public function testSetNewBillingAddress() $this->assertNewAddressFields($billingAddressResponse); } + /** + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + */ + public function testSetNewBillingAddressWithSameAsShippingParameter() + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + + $query = <<graphQlMutation($query); + + self::assertArrayHasKey('cart', $response['setBillingAddressOnCart']); + $cartResponse = $response['setBillingAddressOnCart']['cart']; + self::assertArrayHasKey('billing_address', $cartResponse); + $billingAddressResponse = $cartResponse['billing_address']; + self::assertArrayHasKey('shipping_addresses', $cartResponse); + $shippingAddressResponse = current($cartResponse['shipping_addresses']); + $this->assertNewAddressFields($billingAddressResponse); + $this->assertNewAddressFields($shippingAddressResponse, 'ShippingCartAddress'); + } + /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php */ - public function testSetNewBillingAddressWithSameAsShippingParameter() + public function testSetNewBillingAddressWithUseForShippingParameter() { $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); @@ -110,7 +185,7 @@ public function testSetNewBillingAddressWithSameAsShippingParameter() country_code: "US" telephone: "88776655" } - same_as_shipping: true + use_for_shipping: true } } ) { From bb25f9a9809cd08573f71adefaf18ddcdeec9197 Mon Sep 17 00:00:00 2001 From: Lena Orobei Date: Wed, 23 Oct 2019 14:07:08 -0500 Subject: [PATCH 7/7] magento/graphql-ce#903: [Checkout] Replace use_for_shipping with same_as_shipping --- .../Model/Cart/SetBillingAddressOnCart.php | 7 ++- .../Customer/SetBillingAddressOnCartTest.php | 60 +------------------ .../Guest/SetBillingAddressOnCartTest.php | 60 +------------------ 3 files changed, 9 insertions(+), 118 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php index 0d937cc64a857..7c8126194777f 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php @@ -65,10 +65,11 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b { $customerAddressId = $billingAddressInput['customer_address_id'] ?? null; $addressInput = $billingAddressInput['address'] ?? null; - $sameAsShipping = isset($billingAddressInput['same_as_shipping']) - ? (bool)$billingAddressInput['same_as_shipping'] : false; + // Need to keep this for BC of `use_for_shipping` field $sameAsShipping = isset($billingAddressInput['use_for_shipping']) - ? (bool)$billingAddressInput['use_for_shipping'] : $sameAsShipping; + ? (bool)$billingAddressInput['use_for_shipping'] : false; + $sameAsShipping = isset($billingAddressInput['same_as_shipping']) + ? (bool)$billingAddressInput['same_as_shipping'] : $sameAsShipping; if (null === $customerAddressId && null === $addressInput) { throw new GraphQlInputException( diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index 65497a993da6a..065354114b301 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -86,64 +86,6 @@ public function testSetNewBillingAddress() $query = <<graphQlMutation($query, [], '', $this->getHeaderMap()); - - self::assertArrayHasKey('cart', $response['setBillingAddressOnCart']); - $cartResponse = $response['setBillingAddressOnCart']['cart']; - self::assertArrayHasKey('billing_address', $cartResponse); - $billingAddressResponse = $cartResponse['billing_address']; - $this->assertNewAddressFields($billingAddressResponse); - } - - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - */ - public function testSetNewBillingAddressWithSameAsShippingParameter() - { - $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); - - $query = <<graphQlMutation($query); - - self::assertArrayHasKey('cart', $response['setBillingAddressOnCart']); - $cartResponse = $response['setBillingAddressOnCart']['cart']; - self::assertArrayHasKey('billing_address', $cartResponse); - $billingAddressResponse = $cartResponse['billing_address']; - $this->assertNewAddressFields($billingAddressResponse); - } - - /** - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - */ - public function testSetNewBillingAddressWithSameAsShippingParameter() - { - $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); - - $query = <<assertNewAddressFields($billingAddressResponse); self::assertArrayHasKey('shipping_addresses', $cartResponse); $shippingAddressResponse = current($cartResponse['shipping_addresses']); $this->assertNewAddressFields($billingAddressResponse); @@ -160,6 +104,8 @@ public function testSetNewBillingAddressWithSameAsShippingParameter() } /** + * Test case for deprecated `use_for_shipping` param. + * * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php