From a13639c281105815c8c539518877ebaff99725cf Mon Sep 17 00:00:00 2001 From: Valerii Naida Date: Mon, 4 Mar 2019 18:57:51 -0600 Subject: [PATCH] GraphQL-418: [Shipping methods] Set Shipping Methods on Cart --- .../ConfigurableProductGraphQl/etc/module.xml | 1 - .../Magento/QuoteGraphQl/etc/schema.graphqls | 16 ---------------- .../Customer/SetShippingMethodsOnCartTest.php | 4 ++++ .../Quote/Guest/SetShippingMethodsOnCartTest.php | 2 ++ .../_files/enable_all_shipping_methods.php | 5 +++++ .../enable_all_shipping_methods_rollback.php | 5 +++++ .../OfflineShipping/_files/tablerates_weight.php | 1 + .../_files/tablerates_weight_rollback.php | 1 + 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/module.xml b/app/code/Magento/ConfigurableProductGraphQl/etc/module.xml index f249a417f104..98e7957d0af8 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/module.xml +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/module.xml @@ -12,7 +12,6 @@ - diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index 7328a328ce2b..b94406f33c66 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -101,10 +101,6 @@ input ShippingMethodInput { cart_address_id: Int! carrier_code: String! method_code: String! - additional_data: ShippingMethodAdditionalDataInput -} - -input ShippingMethodAdditionalDataInput { } input SetPaymentMethodOnCartInput { @@ -115,10 +111,6 @@ input SetPaymentMethodOnCartInput { input PaymentMethodInput { code: String! @doc(description:"Payment method code") purchase_order_number: String @doc(description:"Purchase order number") - additional_data: PaymentMethodAdditionalDataInput -} - -input PaymentMethodAdditionalDataInput { } type SetPaymentMethodOnCartOutput { @@ -189,10 +181,6 @@ type SelectedShippingMethod { method_code: String label: String amount: Float - additional_data: SelectedShippingMethodAdditionalData -} - -type SelectedShippingMethodAdditionalData { } type AvailableShippingMethod { @@ -215,10 +203,6 @@ type AvailablePaymentMethod { type SelectedPaymentMethod { code: String @doc(description: "The payment method code") purchase_order_number: String @doc(description: "The purchase order number.") - additional_data: SelectedPaymentMethodAdditionalData -} - -type SelectedPaymentMethodAdditionalData { } enum AdressTypeEnum { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php index 52707dfd6ca4..736ea6944075 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php @@ -122,6 +122,7 @@ public function testSetMultipleShippingMethods() * @param string $shippingCarrierCode * @param string $shippingAddressId * @return string + * @SuppressWarnings(PHPMD.UnusedPrivateMethod) */ private function prepareMutationQuery( string $maskedQuoteId, @@ -163,6 +164,7 @@ private function prepareMutationQuery( /** * @param string $reversedQuoteId * @return string + * @SuppressWarnings(PHPMD.UnusedPrivateMethod) */ private function getMaskedQuoteIdByReversedQuoteId(string $reversedQuoteId): string { @@ -176,6 +178,7 @@ private function getMaskedQuoteIdByReversedQuoteId(string $reversedQuoteId): str * @param string $reversedQuoteId * @param int $customerId * @return string + * @SuppressWarnings(PHPMD.UnusedPrivateMethod) */ private function assignQuoteToCustomer( string $reversedQuoteId, @@ -192,6 +195,7 @@ private function assignQuoteToCustomer( * @param string $username * @param string $password * @return array + * @SuppressWarnings(PHPMD.UnusedPrivateMethod) */ private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php index e82a5956162d..f159cb6f6151 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php @@ -115,6 +115,7 @@ public function testSetMultipleShippingMethods() * @param string $shippingCarrierCode * @param string $shippingAddressId * @return string + * @SuppressWarnings(PHPMD.UnusedPrivateMethod) */ private function prepareMutationQuery( string $maskedQuoteId, @@ -154,6 +155,7 @@ private function prepareMutationQuery( /** * @param string $reversedQuoteId * @return string + * @SuppressWarnings(PHPMD.UnusedPrivateMethod) */ private function getMaskedQuoteIdByReversedQuoteId(string $reversedQuoteId): string { diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/enable_all_shipping_methods.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/enable_all_shipping_methods.php index c0ee7f407caf..dd48975aa2b0 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/_files/enable_all_shipping_methods.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/enable_all_shipping_methods.php @@ -1,4 +1,9 @@ get(\Magento\Framework\App\ResourceConnection::class); diff --git a/dev/tests/integration/testsuite/Magento/OfflineShipping/_files/tablerates_weight_rollback.php b/dev/tests/integration/testsuite/Magento/OfflineShipping/_files/tablerates_weight_rollback.php index 6401407d3554..cb6e9353b897 100644 --- a/dev/tests/integration/testsuite/Magento/OfflineShipping/_files/tablerates_weight_rollback.php +++ b/dev/tests/integration/testsuite/Magento/OfflineShipping/_files/tablerates_weight_rollback.php @@ -3,5 +3,6 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); require 'tablerates_rollback.php';