From ab1324ecc1d5e2990acfd4f14c7b77765d343a9e Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun Date: Fri, 13 Jul 2018 15:12:21 +0300 Subject: [PATCH 01/60] Fix the issue with "Shipping address is not set" exception #16555 --- app/code/Magento/Multishipping/Controller/Checkout.php | 1 + .../Magento/Quote/Model/ShippingMethodManagement.php | 4 +--- .../Test/Unit/Model/ShippingMethodManagementTest.php | 10 ++-------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/Multishipping/Controller/Checkout.php b/app/code/Magento/Multishipping/Controller/Checkout.php index 1870736a0efd9..161021768ce19 100644 --- a/app/code/Magento/Multishipping/Controller/Checkout.php +++ b/app/code/Magento/Multishipping/Controller/Checkout.php @@ -84,6 +84,7 @@ protected function _getCheckoutSession() * * @param RequestInterface $request * @return \Magento\Framework\App\ResponseInterface + * @throws \Magento\Framework\Exception\NotFoundException * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ diff --git a/app/code/Magento/Quote/Model/ShippingMethodManagement.php b/app/code/Magento/Quote/Model/ShippingMethodManagement.php index ade2649d0b1b0..ac609e7f435ea 100644 --- a/app/code/Magento/Quote/Model/ShippingMethodManagement.php +++ b/app/code/Magento/Quote/Model/ShippingMethodManagement.php @@ -171,9 +171,7 @@ public function set($cartId, $carrierCode, $methodCode) * @param string $methodCode The shipping method code. * @return void * @throws InputException The shipping method is not valid for an empty cart. - * @throws CouldNotSaveException The shipping method could not be saved. * @throws NoSuchEntityException CThe Cart includes virtual product(s) only, so a shipping address is not used. - * @throws StateException The billing or shipping address is missing. Set the address and try again. */ public function apply($cartId, $carrierCode, $methodCode) { @@ -191,7 +189,7 @@ public function apply($cartId, $carrierCode, $methodCode) } $shippingAddress = $quote->getShippingAddress(); if (!$shippingAddress->getCountryId()) { - throw new StateException(__('The shipping address is missing. Set the address and try again.')); + return; } $shippingAddress->setShippingMethod($carrierCode . '_' . $methodCode); } diff --git a/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php b/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php index 198f1c54a42b4..6042ab25eef7f 100644 --- a/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php +++ b/app/code/Magento/Quote/Test/Unit/Model/ShippingMethodManagementTest.php @@ -344,10 +344,6 @@ public function testSetMethodWithVirtualProduct() $this->model->set($cartId, $carrierCode, $methodCode); } - /** - * @expectedException \Magento\Framework\Exception\StateException - * @expectedExceptionMessage The shipping address is missing. Set the address and try again. - */ public function testSetMethodWithoutShippingAddress() { $cartId = 12; @@ -361,6 +357,7 @@ public function testSetMethodWithoutShippingAddress() $this->quote->expects($this->once())->method('isVirtual')->will($this->returnValue(false)); $this->quote->expects($this->once()) ->method('getShippingAddress')->will($this->returnValue($this->shippingAddress)); + $this->quote->expects($this->once())->method('collectTotals')->willReturnSelf(); $this->shippingAddress->expects($this->once())->method('getCountryId')->will($this->returnValue(null)); $this->model->set($cartId, $carrierCode, $methodCode); @@ -402,10 +399,6 @@ public function testSetMethodWithCouldNotSaveException() $this->model->set($cartId, $carrierCode, $methodCode); } - /** - * @expectedException \Magento\Framework\Exception\StateException - * @expectedExceptionMessage The shipping address is missing. Set the address and try again. - */ public function testSetMethodWithoutAddress() { $cartId = 12; @@ -420,6 +413,7 @@ public function testSetMethodWithoutAddress() $this->quote->expects($this->once()) ->method('getShippingAddress') ->willReturn($this->shippingAddress); + $this->quote->expects($this->once())->method('collectTotals')->willReturnSelf(); $this->shippingAddress->expects($this->once())->method('getCountryId'); $this->model->set($cartId, $carrierCode, $methodCode); From b8b6f3814f9d5d497384ee4c07cb93ce9b1db31f Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Fri, 20 Jul 2018 10:34:29 +0200 Subject: [PATCH 02/60] Fixed return value for getGraphQlClient --- .../Magento/TestFramework/TestCase/GraphQlAbstract.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php index af01e455fdd9d..ba64a3e9eee8f 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php @@ -93,8 +93,8 @@ private function getGraphQlClient() { if ($this->graphQlClient === null) { return Bootstrap::getObjectManager()->get(\Magento\TestFramework\TestCase\GraphQl\Client::class); - } else { - $this->graphQlClient; } + + return $this->graphQlClient; } } From adbf6473b36e03703aa1fa612a31285abb38008d Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Tue, 24 Jul 2018 10:31:41 +0200 Subject: [PATCH 03/60] Added assignment instead of direct return --- .../Magento/TestFramework/TestCase/GraphQlAbstract.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php index ba64a3e9eee8f..936cbfdb5106f 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/TestCase/GraphQlAbstract.php @@ -92,7 +92,7 @@ private function getAppCache() private function getGraphQlClient() { if ($this->graphQlClient === null) { - return Bootstrap::getObjectManager()->get(\Magento\TestFramework\TestCase\GraphQl\Client::class); + $this->graphQlClient = Bootstrap::getObjectManager()->get(\Magento\TestFramework\TestCase\GraphQl\Client::class); } return $this->graphQlClient; From 4bd5311a885e67c474503331f42f1419721580b0 Mon Sep 17 00:00:00 2001 From: Sachin Admane Date: Tue, 31 Jul 2018 12:18:00 -0500 Subject: [PATCH 04/60] MAGETWO-90719: Exception is thrown when you re-order a product with custom options from Admin. - Fix integration test to cover changes in Zend framework --- .../Model/Product/Option/Type/File/ValidatorInfoTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php index 41556d5558006..96bff8ff51af8 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php @@ -111,11 +111,11 @@ public function testExceptionWithoutErrors() */ public function testValidate() { - $validateMock = $this->createPartialMock(\Zend_Validate::class, ['isValid']); - $validateMock->expects($this->once())->method('isValid')->will($this->returnValue(true)); + //use actual zend class to test changed functionality + $validate = $this->objectManager->create(\Zend_Validate::class ); $this->validateFactoryMock->expects($this->once()) ->method('create') - ->will($this->returnValue($validateMock)); + ->will($this->returnValue($validate)); $this->assertTrue( $this->model->validate( $this->getOptionValue(), From cdf9769ec3b2979afb2ad57df665b7d44e09d75c Mon Sep 17 00:00:00 2001 From: Sachin Admane Date: Tue, 31 Jul 2018 14:27:15 -0500 Subject: [PATCH 05/60] MAGETWO-90719: Exception is thrown when you re-order a product with custom options from Admin. Fix indentation and remove extra space. --- .../Model/Product/Option/Type/File/ValidatorInfoTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php index 96bff8ff51af8..7c340c37ba9a9 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Option/Type/File/ValidatorInfoTest.php @@ -112,7 +112,7 @@ public function testExceptionWithoutErrors() public function testValidate() { //use actual zend class to test changed functionality - $validate = $this->objectManager->create(\Zend_Validate::class ); + $validate = $this->objectManager->create(\Zend_Validate::class); $this->validateFactoryMock->expects($this->once()) ->method('create') ->will($this->returnValue($validate)); From 20f943396ac1dcc8ba0cd8a13a105d0e83ee2d0c Mon Sep 17 00:00:00 2001 From: Sachin Admane Date: Wed, 1 Aug 2018 10:56:30 -0500 Subject: [PATCH 06/60] MAGETWO-90719: Exception is thrown when you re-order a product with custom options from Admin. Unkip MFTF test --- .../Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml index 3a7feb34354d7..27e5eb16a419d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml @@ -17,7 +17,7 @@ - + From 041f72810509bc657dca2646cd4667108705f0be Mon Sep 17 00:00:00 2001 From: Sachin Admane Date: Wed, 1 Aug 2018 11:03:49 -0500 Subject: [PATCH 07/60] MAGETWO-90719: Exception is thrown when you re-order a product with custom options from Admin. Remove skip comments --- .../Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml index 27e5eb16a419d..6e43753220d7c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptions.xml @@ -16,7 +16,6 @@ - From 410027d7a484d0fd2fa74de569f3107ede2c6575 Mon Sep 17 00:00:00 2001 From: Joan He Date: Thu, 2 Aug 2018 17:10:23 -0500 Subject: [PATCH 08/60] MAGETWO-90632: DHL Shipping Method not available --- app/code/Magento/Dhl/Model/Carrier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 6262d71c4edcc..55df0748b1f06 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -1970,6 +1970,6 @@ protected function isDutiable($origCountryId, $destCountryId) return self::DHL_CONTENT_TYPE_NON_DOC == $this->getConfigData('content_type') - && !$this->_isDomestic; + || !$this->_isDomestic; } } From d964200aaffdc3e52678b1d2613b2d8d5ef7f434 Mon Sep 17 00:00:00 2001 From: Daniel Renaud Date: Mon, 6 Aug 2018 16:33:27 -0500 Subject: [PATCH 09/60] MAGETWO-90862: PayPal Credit Learn More link is broken --- .../etc/adminhtml/system/express_checkout.xml | 8 ++--- .../etc/adminhtml/system/payflow_advanced.xml | 2 +- .../etc/adminhtml/system/payflow_link.xml | 6 ++-- .../system/payments_pro_hosted_solution.xml | 6 ++-- ...aypal_payflowpro_with_express_checkout.xml | 6 ++-- app/code/Magento/Paypal/i18n/en_US.csv | 36 +++++++++---------- .../Reader/_files/expected/config.xml | 28 +++++++-------- 7 files changed, 46 insertions(+), 46 deletions(-) diff --git a/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml b/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml index a726439331cb0..bff076aad9cb5 100644 --- a/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml +++ b/app/code/Magento/Paypal/etc/adminhtml/system/express_checkout.xml @@ -162,7 +162,7 @@ Learn More]]> + Learn More]]> payment/paypal_express_bml/active Magento\Config\Model\Config\Source\Yesno @@ -184,12 +184,12 @@