From ece60627af1b7950b1d837bea4872a0243025027 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi Date: Thu, 11 Apr 2019 14:25:25 -0500 Subject: [PATCH 01/30] MAGETWO-98801: Catalog cache gets flushed after Import --- app/code/Magento/Catalog/Block/Product/View.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index 8055d17a64a84..f3557a2b78853 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -323,10 +323,7 @@ public function getQuantityValidators() public function getIdentities() { $identities = $this->getProduct()->getIdentities(); - $category = $this->_coreRegistry->registry('current_category'); - if ($category) { - $identities[] = Category::CACHE_TAG . '_' . $category->getId(); - } + return $identities; } From b98ba3ddb1ab7fc89380965e6631ffca62a3d8a2 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi Date: Fri, 12 Apr 2019 10:16:41 -0500 Subject: [PATCH 02/30] MAGETWO-98801: Catalog cache gets flushed after Import --- app/code/Magento/Catalog/Block/Product/View.php | 4 ++-- .../Magento/Catalog/Test/Unit/Block/Product/ViewTest.php | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index f3557a2b78853..8b53223de0b9f 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -169,8 +169,7 @@ public function getAddToCartUrl($product, $additional = []) } /** - * Get JSON encoded configuration array which can be used for JS dynamic - * price calculation depending on product options + * Get JSON encoded configuration which can be used for JS dynamic price calculation depending on product options * * @return string */ @@ -262,6 +261,7 @@ public function isStartCustomization() /** * Get default qty - either as preconfigured, or as 1. + * * Also restricts it by minimal qty. * * @param null|\Magento\Catalog\Model\Product $product diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php index af208c016c7e3..bcb5540f14817 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php @@ -65,24 +65,19 @@ public function testGetIdentities() { $productTags = ['cat_p_1']; $product = $this->createMock(\Magento\Catalog\Model\Product::class); - $category = $this->createMock(\Magento\Catalog\Model\Category::class); $product->expects($this->once()) ->method('getIdentities') ->will($this->returnValue($productTags)); - $category->expects($this->once()) - ->method('getId') - ->will($this->returnValue(1)); $this->registryMock->expects($this->any()) ->method('registry') ->will( $this->returnValueMap( [ ['product', $product], - ['current_category', $category], ] ) ); - $this->assertEquals(['cat_p_1', 'cat_c_1'], $this->view->getIdentities()); + $this->assertEquals($productTags, $this->view->getIdentities()); } } From b2976a75d44edd43849479cdaca1a88a142199f7 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi Date: Fri, 12 Apr 2019 10:54:13 -0500 Subject: [PATCH 03/30] MAGETWO-98801: Catalog cache gets flushed after Import --- .../Catalog/Test/Unit/Block/Product/ViewTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php index bcb5540f14817..6563bdeb149e1 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Product/ViewTest.php @@ -8,6 +8,9 @@ namespace Magento\Catalog\Test\Unit\Block\Product; +/** + * Class ViewTest + */ class ViewTest extends \PHPUnit\Framework\TestCase { /** @@ -25,6 +28,9 @@ class ViewTest extends \PHPUnit\Framework\TestCase */ protected $registryMock; + /** + * @inheritDoc + */ protected function setUp() { $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -36,6 +42,9 @@ protected function setUp() ); } + /** + * @return void + */ public function testShouldRenderQuantity() { $productMock = $this->createMock(\Magento\Catalog\Model\Product::class); @@ -61,6 +70,9 @@ public function testShouldRenderQuantity() $this->assertEquals(false, $this->view->shouldRenderQuantity()); } + /** + * @return void + */ public function testGetIdentities() { $productTags = ['cat_p_1']; From f2e6fdd551645986a264dc369ae31f815edfe8ae Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi Date: Mon, 15 Apr 2019 18:08:31 -0500 Subject: [PATCH 04/30] MAGETWO-93522: Custom customer attributes don't show in admin unless they're configured to show on frontend --- .../Customer/Model/Customer/DataProvider.php | 36 +++---------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/app/code/Magento/Customer/Model/Customer/DataProvider.php b/app/code/Magento/Customer/Model/Customer/DataProvider.php index 5bad0a41aadc3..0b7c618e6a18b 100644 --- a/app/code/Magento/Customer/Model/Customer/DataProvider.php +++ b/app/code/Magento/Customer/Model/Customer/DataProvider.php @@ -307,45 +307,17 @@ protected function getAttributesMeta(Type $entityType) return $meta; } - /** - * Check whether the specific attribute can be shown in form: customer registration, customer edit, etc... - * - * @param Attribute $customerAttribute - * @return bool - */ - private function canShowAttributeInForm(AbstractAttribute $customerAttribute) - { - $isRegistration = $this->context->getRequestParam($this->getRequestFieldName()) === null; - - if ($customerAttribute->getEntityType()->getEntityTypeCode() === 'customer') { - return is_array($customerAttribute->getUsedInForms()) && - ( - (in_array('customer_account_create', $customerAttribute->getUsedInForms()) && $isRegistration) || - (in_array('customer_account_edit', $customerAttribute->getUsedInForms()) && !$isRegistration) - ); - } else { - return is_array($customerAttribute->getUsedInForms()) && - in_array('customer_address_edit', $customerAttribute->getUsedInForms()); - } - } - /** * Detect can we show attribute on specific form or not * * @param Attribute $customerAttribute * @return bool */ - private function canShowAttribute(AbstractAttribute $customerAttribute) + private function canShowAttribute(AbstractAttribute $customerAttribute): bool { - $userDefined = (bool) $customerAttribute->getIsUserDefined(); - if (!$userDefined) { - return $customerAttribute->getIsVisible(); - } - - $canShowOnForm = $this->canShowAttributeInForm($customerAttribute); - - return ($this->allowToShowHiddenAttributes && $canShowOnForm) || - (!$this->allowToShowHiddenAttributes && $canShowOnForm && $customerAttribute->getIsVisible()); + return $this->allowToShowHiddenAttributes && (bool) $customerAttribute->getIsUserDefined() + ? true + : (bool) $customerAttribute->getIsVisible(); } /** From 89c00bde43a437f6c5e067d18735cbc6449e0ed1 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi Date: Tue, 16 Apr 2019 09:07:58 -0500 Subject: [PATCH 05/30] MAGETWO-93522: Custom customer attributes don't show in admin unless they're configured to show on frontend --- .../Unit/Model/Customer/DataProviderTest.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php index ac87e2e336e3d..3cbcbdf80b2a1 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php @@ -1087,16 +1087,15 @@ public function testGetDataWithVisibleAttributesWithAccountEdit() $meta = $dataProvider->getMeta(); $this->assertNotEmpty($meta); - $this->assertEquals($this->getExpectationForVisibleAttributes(false), $meta); + $this->assertEquals($this->getExpectationForVisibleAttributes(), $meta); } /** * Retrieve all customer variations of attributes with all variations of visibility * - * @param bool $isRegistration * @return array */ - private function getCustomerAttributeExpectations($isRegistration) + private function getCustomerAttributeExpectations() { return [ self::ATTRIBUTE_CODE . "_1" => [ @@ -1106,7 +1105,7 @@ private function getCustomerAttributeExpectations($isRegistration) 'dataType' => 'frontend_input', 'formElement' => 'frontend_input', 'options' => 'test-options', - 'visible' => !$isRegistration, + 'visible' => true, 'required' => 'is_required', 'label' => __('frontend_label'), 'sortOrder' => 'sort_order', @@ -1143,7 +1142,7 @@ private function getCustomerAttributeExpectations($isRegistration) 'config' => [ 'dataType' => 'frontend_input', 'formElement' => 'frontend_input', - 'visible' => $isRegistration, + 'visible' => true, 'required' => 'is_required', 'label' => __('frontend_label'), 'sortOrder' => 'sort_order', @@ -1166,7 +1165,7 @@ private function getCustomerAttributeExpectations($isRegistration) 'config' => [ 'dataType' => 'frontend_input', 'formElement' => 'frontend_input', - 'visible' => $isRegistration, + 'visible' => true, 'required' => 'is_required', 'label' => __('frontend_label'), 'sortOrder' => 'sort_order', @@ -1189,14 +1188,13 @@ private function getCustomerAttributeExpectations($isRegistration) /** * Retrieve all variations of attributes with all variations of visibility * - * @param bool $isRegistration * @return array */ - private function getExpectationForVisibleAttributes($isRegistration = true) + private function getExpectationForVisibleAttributes() { return [ 'customer' => [ - 'children' => $this->getCustomerAttributeExpectations($isRegistration), + 'children' => $this->getCustomerAttributeExpectations(), ], 'address' => [ 'children' => [ From 0a64fbdb76c25563852ab2deb003d69681447b1c Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi Date: Wed, 17 Apr 2019 11:28:37 -0500 Subject: [PATCH 06/30] MAGETWO-93522: Custom customer attributes don't show in admin unless they're configured to show on frontend --- .../Customer/Model/Address/DataProvider.php | 4 +- .../Model/AttributeMetadataResolver.php | 43 ++----------------- .../DataProviderWithDefaultAddresses.php | 3 +- 3 files changed, 7 insertions(+), 43 deletions(-) diff --git a/app/code/Magento/Customer/Model/Address/DataProvider.php b/app/code/Magento/Customer/Model/Address/DataProvider.php index e1dd68207cae5..e7f9fce021709 100644 --- a/app/code/Magento/Customer/Model/Address/DataProvider.php +++ b/app/code/Magento/Customer/Model/Address/DataProvider.php @@ -19,6 +19,7 @@ /** * Dataprovider of customer addresses for customer address grid. + * * @property \Magento\Customer\Model\ResourceModel\Address\Collection $collection */ class DataProvider extends \Magento\Ui\DataProvider\AbstractDataProvider @@ -222,8 +223,7 @@ private function getAttributesMeta(Type $entityType): array $meta[$attribute->getAttributeCode()] = $this->attributeMetadataResolver->getAttributesMeta( $attribute, $entityType, - $this->allowToShowHiddenAttributes, - $this->getRequestFieldName() + $this->allowToShowHiddenAttributes ); } $this->attributeMetadataResolver->processWebsiteMeta($meta); diff --git a/app/code/Magento/Customer/Model/AttributeMetadataResolver.php b/app/code/Magento/Customer/Model/AttributeMetadataResolver.php index c22cc9a4f23f4..979730eb1c9c2 100644 --- a/app/code/Magento/Customer/Model/AttributeMetadataResolver.php +++ b/app/code/Magento/Customer/Model/AttributeMetadataResolver.php @@ -101,15 +101,13 @@ public function __construct( * @param AbstractAttribute $attribute * @param Type $entityType * @param bool $allowToShowHiddenAttributes - * @param string $requestFieldName * @return array * @throws \Magento\Framework\Exception\LocalizedException */ public function getAttributesMeta( AbstractAttribute $attribute, Type $entityType, - bool $allowToShowHiddenAttributes, - string $requestFieldName + bool $allowToShowHiddenAttributes ): array { $meta = $this->modifyBooleanAttributeMeta($attribute); // use getDataUsingMethod, since some getters are defined and apply additional processing of returning value @@ -138,7 +136,6 @@ public function getAttributesMeta( $meta['arguments']['data']['config']['componentType'] = Field::NAME; $meta['arguments']['data']['config']['visible'] = $this->canShowAttribute( $attribute, - $requestFieldName, $allowToShowHiddenAttributes ); @@ -155,48 +152,16 @@ public function getAttributesMeta( * Detect can we show attribute on specific form or not * * @param AbstractAttribute $customerAttribute - * @param string $requestFieldName * @param bool $allowToShowHiddenAttributes * @return bool */ private function canShowAttribute( AbstractAttribute $customerAttribute, - string $requestFieldName, bool $allowToShowHiddenAttributes ) { - $userDefined = (bool)$customerAttribute->getIsUserDefined(); - if (!$userDefined) { - return $customerAttribute->getIsVisible(); - } - - $canShowOnForm = $this->canShowAttributeInForm($customerAttribute, $requestFieldName); - - return ($allowToShowHiddenAttributes && $canShowOnForm) || - (!$allowToShowHiddenAttributes && $canShowOnForm && $customerAttribute->getIsVisible()); - } - - /** - * Check whether the specific attribute can be shown in form: customer registration, customer edit, etc... - * - * @param AbstractAttribute $customerAttribute - * @param string $requestFieldName - * @return bool - */ - private function canShowAttributeInForm(AbstractAttribute $customerAttribute, string $requestFieldName): bool - { - $isRegistration = $this->context->getRequestParam($requestFieldName) === null; - - if ($customerAttribute->getEntityType()->getEntityTypeCode() === 'customer') { - return \is_array($customerAttribute->getUsedInForms()) && - ( - (\in_array('customer_account_create', $customerAttribute->getUsedInForms(), true) - && $isRegistration) || - (\in_array('customer_account_edit', $customerAttribute->getUsedInForms(), true) - && !$isRegistration) - ); - } - return \is_array($customerAttribute->getUsedInForms()) && - \in_array('customer_address_edit', $customerAttribute->getUsedInForms(), true); + return $allowToShowHiddenAttributes && (bool) $customerAttribute->getIsUserDefined() + ? true + : (bool) $customerAttribute->getIsVisible(); } /** diff --git a/app/code/Magento/Customer/Model/Customer/DataProviderWithDefaultAddresses.php b/app/code/Magento/Customer/Model/Customer/DataProviderWithDefaultAddresses.php index 4d1bb2e6b9e99..e72e53809c79e 100644 --- a/app/code/Magento/Customer/Model/Customer/DataProviderWithDefaultAddresses.php +++ b/app/code/Magento/Customer/Model/Customer/DataProviderWithDefaultAddresses.php @@ -189,8 +189,7 @@ private function getAttributesMeta(Type $entityType): array $meta[$attribute->getAttributeCode()] = $this->attributeMetadataResolver->getAttributesMeta( $attribute, $entityType, - $this->allowToShowHiddenAttributes, - $this->getRequestFieldName() + $this->allowToShowHiddenAttributes ); } $this->attributeMetadataResolver->processWebsiteMeta($meta); From 2b60b9fad8d06b47ef0dca54fa321cb35aab2f42 Mon Sep 17 00:00:00 2001 From: Sudhanshu Bajaj Date: Fri, 19 Apr 2019 15:47:42 +0800 Subject: [PATCH 07/30] Store view specific labels cut in left navigation menu #22406 --- .../web/css/source/module/main/_store-scope.less | 2 +- app/design/adminhtml/Magento/backend/web/css/styles-old.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_store-scope.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_store-scope.less index 05e6350c88d8e..cd73d4955d176 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_store-scope.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_store-scope.less @@ -37,7 +37,7 @@ .store-scope { .admin__legend { .admin__field-tooltip { - margin-left: -@indent__base; + margin-left: 0; margin-top: .5rem; } } diff --git a/app/design/adminhtml/Magento/backend/web/css/styles-old.less b/app/design/adminhtml/Magento/backend/web/css/styles-old.less index 2dbe68ef96eec..50dd5c3a859e7 100644 --- a/app/design/adminhtml/Magento/backend/web/css/styles-old.less +++ b/app/design/adminhtml/Magento/backend/web/css/styles-old.less @@ -1366,7 +1366,7 @@ font-size: 14px; font-weight: 600; line-height: 3.2rem; - padding: 0 30px 0 0; + padding: 0 30px 0 30px; white-space: nowrap; word-wrap: break-word; From e99dac362a1a7afbd84c4056fda9d7206b7f7c49 Mon Sep 17 00:00:00 2001 From: Roman Lytvynenko Date: Wed, 24 Apr 2019 15:45:30 -0500 Subject: [PATCH 08/30] MAGETWO-99370: Shopping cart does not show all four digits of quantity. --- .../luma/Magento_Checkout/web/css/source/module/_cart.less | 2 +- .../luma/Magento_Checkout/web/css/source/module/_minicart.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less index 71814cd0f0422..460a961830b43 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_cart.less @@ -210,7 +210,7 @@ height: 36px; margin-top: -7px; text-align: center; - width: 45px; + width: 60px; } } diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less index 5ca3322403102..af94dd7b97bbb 100644 --- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less +++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/_minicart.less @@ -371,7 +371,7 @@ .item-qty { margin-right: @indent__s; text-align: center; - width: 45px; + width: 60px; } .update-cart-item { From 601cd319e53ba109b430eecb04dc877085732dfc Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Mon, 29 Apr 2019 15:52:09 -0500 Subject: [PATCH 09/30] MC-16046: Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading --- .../Magento/blank/web/css/source/_icons.less | 3 ++- .../Magento/blank/web/css/source/_typography.less | 12 ++++++++---- lib/web/css/source/lib/_typography.less | 4 +++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/design/frontend/Magento/blank/web/css/source/_icons.less b/app/design/frontend/Magento/blank/web/css/source/_icons.less index 7d1ceaca73c72..52ae8a0e8c707 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_icons.less +++ b/app/design/frontend/Magento/blank/web/css/source/_icons.less @@ -8,6 +8,7 @@ @family-name: @icons__font-name, @font-path: @icons__font-path, @font-weight: normal, - @font-style: normal + @font-style: normal, + @font-display: swap ); } diff --git a/app/design/frontend/Magento/blank/web/css/source/_typography.less b/app/design/frontend/Magento/blank/web/css/source/_typography.less index 8ce76fad97902..6807c0f692af8 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_typography.less +++ b/app/design/frontend/Magento/blank/web/css/source/_typography.less @@ -12,28 +12,32 @@ @family-name: @font-family-name__base, @font-path: '@{baseDir}fonts/opensans/light/opensans-300', @font-weight: 300, - @font-style: normal + @font-style: normal, + @font-display: swap ); .lib-font-face( @family-name: @font-family-name__base, @font-path: '@{baseDir}fonts/opensans/regular/opensans-400', @font-weight: 400, - @font-style: normal + @font-style: normal, + @font-display: swap ); .lib-font-face( @family-name: @font-family-name__base, @font-path: '@{baseDir}fonts/opensans/semibold/opensans-600', @font-weight: 600, - @font-style: normal + @font-style: normal, + @font-display: swap ); .lib-font-face( @family-name: @font-family-name__base, @font-path: '@{baseDir}fonts/opensans/bold/opensans-700', @font-weight: 700, - @font-style: normal + @font-style: normal, + @font-display: swap ); } diff --git a/lib/web/css/source/lib/_typography.less b/lib/web/css/source/lib/_typography.less index 62529fe08d1c8..2b8065b634d41 100644 --- a/lib/web/css/source/lib/_typography.less +++ b/lib/web/css/source/lib/_typography.less @@ -11,7 +11,8 @@ @family-name, @font-path, @font-weight: normal, - @font-style: normal + @font-style: normal, + @font-display: swap ) { @font-face { font-family: @family-name; @@ -19,6 +20,7 @@ url('@{font-path}.woff') format('woff'); font-weight: @font-weight; font-style: @font-style; + font-display: @font-display; } } From 83ed2ed7195ca025a8da21141647209ff2ac3d52 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Tue, 30 Apr 2019 13:37:19 -0500 Subject: [PATCH 10/30] MC-16046: Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading - Make font-display auto by default; --- lib/web/css/source/lib/_typography.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/css/source/lib/_typography.less b/lib/web/css/source/lib/_typography.less index 2b8065b634d41..3ca09d3782619 100644 --- a/lib/web/css/source/lib/_typography.less +++ b/lib/web/css/source/lib/_typography.less @@ -12,7 +12,7 @@ @font-path, @font-weight: normal, @font-style: normal, - @font-display: swap + @font-display: auto ) { @font-face { font-family: @family-name; From 2d3760edbbf40d26f47ce66c69e89fd2bd4eb3ad Mon Sep 17 00:00:00 2001 From: Denis Kopylov Date: Tue, 30 Apr 2019 18:35:55 +0300 Subject: [PATCH 11/30] [Catalog|Eav] Revert change of PR magento/magento2#13302 not included into revert commit https://github.com/magento/magento2/commit/06019a6215ea31982494708d55745ae0b9622696 --- .../Catalog/Model/ResourceModel/Product/Collection.php | 1 - .../Model/Entity/Collection/AbstractCollectionTest.php | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index 0cdf8b39f7d52..76e65400721d9 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -19,7 +19,6 @@ use Magento\Framework\DB\Select; use Magento\Framework\EntityManager\MetadataPool; use Magento\Framework\Indexer\DimensionFactory; -use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface; use Magento\Store\Model\Indexer\WebsiteDimensionProvider; use Magento\Store\Model\Store; diff --git a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php index ab5b40c56685c..bc4ed7d4bd9e4 100644 --- a/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php +++ b/app/code/Magento/Eav/Test/Unit/Model/Entity/Collection/AbstractCollectionTest.php @@ -5,9 +5,6 @@ */ namespace Magento\Eav\Test\Unit\Model\Entity\Collection; -use Magento\Framework\Data\Collection\Db\FetchStrategyInterface; -use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface; - /** * AbstractCollection test * @@ -31,7 +28,7 @@ class AbstractCollectionTest extends \PHPUnit\Framework\TestCase protected $loggerMock; /** - * @var FetchStrategyInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Data\Collection\Db\FetchStrategyInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $fetchStrategyMock; @@ -61,7 +58,7 @@ class AbstractCollectionTest extends \PHPUnit\Framework\TestCase protected $resourceHelperMock; /** - * @var ResourceModelPoolInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Validator\UniversalFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $validatorFactoryMock; From 7b523ee3cace09b3d558333b9d4d649574addd5f Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Tue, 30 Apr 2019 17:04:35 -0500 Subject: [PATCH 12/30] MQE-1536: Magento\Install\Test\TestCase\InstallTest is failing - reverting MAGETWO-99210 --- .../lib/Magento/Mtf/Util/Command/Cli.php | 41 ++++++++--- .../Mtf/Util/Command/File/Export/Reader.php | 39 ++++++++--- .../Command/File/Export/ReaderInterface.php | 2 +- .../lib/Magento/Mtf/Util/Command/File/Log.php | 37 +++++++--- .../Mtf/Util/Command/GeneratedCode.php | 39 +++++++++-- .../lib/Magento/Mtf/Util/Command/Locales.php | 42 ++++++++--- .../Magento/Mtf/Util/Command/PathChecker.php | 43 +++++++++--- .../lib/Magento/Mtf/Util/Command/Website.php | 40 +++++++---- .../CurlTransport/BackendDecorator.php | 69 ++++++++++++++----- .../CurlTransport/WebapiDecorator.php | 32 ++++++++- .../Config/Test/Handler/ConfigData/Curl.php | 2 +- dev/tests/functional/utils/authenticate.php | 29 ++++++++ dev/tests/functional/utils/command.php | 32 +++++---- .../utils/deleteMagentoGeneratedCode.php | 14 +++- dev/tests/functional/utils/export.php | 51 +++++++------- dev/tests/functional/utils/locales.php | 34 +++++---- dev/tests/functional/utils/log.php | 32 +++++---- dev/tests/functional/utils/pathChecker.php | 27 ++++---- dev/tests/functional/utils/website.php | 52 +++++++------- 19 files changed, 467 insertions(+), 190 deletions(-) create mode 100644 dev/tests/functional/utils/authenticate.php diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli.php b/dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli.php index 8fa22122cce89..f0abd280f3ebc 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli.php @@ -8,6 +8,7 @@ use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; +use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator; /** * Perform bin/magento commands from command line for functional tests executions. @@ -17,7 +18,7 @@ class Cli /** * Url to command.php. */ - const URL = 'dev/tests/functional/utils/command.php'; + const URL = '/dev/tests/functional/utils/command.php'; /** * Curl transport protocol. @@ -26,12 +27,21 @@ class Cli */ private $transport; + /** + * Webapi handler. + * + * @var WebapiDecorator + */ + private $webapiHandler; + /** * @param CurlTransport $transport + * @param WebapiDecorator $webapiHandler */ - public function __construct(CurlTransport $transport) + public function __construct(CurlTransport $transport, WebapiDecorator $webapiHandler) { $this->transport = $transport; + $this->webapiHandler = $webapiHandler; } /** @@ -43,22 +53,31 @@ public function __construct(CurlTransport $transport) */ public function execute($command, $options = []) { - $curl = $this->transport; - $curl->write($this->prepareUrl($command, $options), [], CurlInterface::GET); - $curl->read(); - $curl->close(); + $this->transport->write( + rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL, + $this->prepareParamArray($command, $options), + CurlInterface::POST, + [] + ); + $this->transport->read(); + $this->transport->close(); } /** - * Prepare url. + * Prepare parameter array. * * @param string $command * @param array $options [optional] - * @return string + * @return array */ - private function prepareUrl($command, $options = []) + private function prepareParamArray($command, $options = []) { - $command .= ' ' . implode(' ', $options); - return $_ENV['app_frontend_url'] . self::URL . '?command=' . urlencode($command); + if (!empty($options)) { + $command .= ' ' . implode(' ', $options); + } + return [ + 'token' => urlencode($this->webapiHandler->getWebapiToken()), + 'command' => urlencode($command) + ]; } } diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/Reader.php b/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/Reader.php index d7336b51a18e2..f5b6d681e4f6c 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/Reader.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/Reader.php @@ -3,12 +3,12 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Mtf\Util\Command\File\Export; use Magento\Mtf\ObjectManagerInterface; use Magento\Mtf\Util\Protocol\CurlTransport; use Magento\Mtf\Util\Protocol\CurlInterface; +use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator; /** * File reader for Magento export files. @@ -36,16 +36,29 @@ class Reader implements ReaderInterface */ private $transport; + /** + * Webapi handler. + * + * @var WebapiDecorator + */ + private $webapiHandler; + /** * @param ObjectManagerInterface $objectManager * @param CurlTransport $transport + * @param WebapiDecorator $webapiHandler * @param string $template */ - public function __construct(ObjectManagerInterface $objectManager, CurlTransport $transport, $template) - { + public function __construct( + ObjectManagerInterface $objectManager, + CurlTransport $transport, + WebapiDecorator $webapiHandler, + $template + ) { $this->objectManager = $objectManager; $this->template = $template; $this->transport = $transport; + $this->webapiHandler = $webapiHandler; } /** @@ -70,20 +83,28 @@ public function getData() */ private function getFiles() { - $this->transport->write($this->prepareUrl(), [], CurlInterface::GET); + $this->transport->write( + rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL, + $this->prepareParamArray(), + CurlInterface::POST, + [] + ); $serializedFiles = $this->transport->read(); $this->transport->close(); // phpcs:ignore Magento2.Security.InsecureFunction - return unserialize($serializedFiles, ['allowed_classes' => false]); + return unserialize($serializedFiles); } /** - * Prepare url. + * Prepare parameter array. * - * @return string + * @return array */ - private function prepareUrl() + private function prepareParamArray() { - return $_ENV['app_frontend_url'] . self::URL . '?template=' . urlencode($this->template); + return [ + 'token' => urlencode($this->webapiHandler->getWebapiToken()), + 'template' => urlencode($this->template) + ]; } } diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/ReaderInterface.php b/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/ReaderInterface.php index 93f7cf1ce9764..3666e8643efa3 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/ReaderInterface.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/ReaderInterface.php @@ -14,7 +14,7 @@ interface ReaderInterface /** * Url to export.php. */ - const URL = 'dev/tests/functional/utils/export.php'; + const URL = '/dev/tests/functional/utils/export.php'; /** * Exporting files as Data object from Magento. diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Log.php b/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Log.php index f4e55682857a2..2539be593a713 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Log.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Log.php @@ -7,6 +7,7 @@ namespace Magento\Mtf\Util\Command\File; use Magento\Mtf\Util\Protocol\CurlTransport; +use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator; /** * Get content of log file in var/log folder. @@ -16,7 +17,7 @@ class Log /** * Url to log.php. */ - const URL = 'dev/tests/functional/utils/log.php'; + const URL = '/dev/tests/functional/utils/log.php'; /** * Curl transport protocol. @@ -25,12 +26,21 @@ class Log */ private $transport; + /** + * Webapi handler. + * + * @var WebapiDecorator + */ + private $webapiHandler; + /** * @param CurlTransport $transport + * @param WebapiDecorator $webapiHandler */ - public function __construct(CurlTransport $transport) + public function __construct(CurlTransport $transport, WebapiDecorator $webapiHandler) { $this->transport = $transport; + $this->webapiHandler = $webapiHandler; } /** @@ -41,22 +51,29 @@ public function __construct(CurlTransport $transport) */ public function getFileContent($name) { - $curl = $this->transport; - $curl->write($this->prepareUrl($name), [], CurlTransport::GET); - $data = $curl->read(); - $curl->close(); + $this->transport->write( + rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL, + $this->prepareParamArray($name), + CurlInterface::POST, + [] + ); + $data = $this->transport->read(); + $this->transport->close(); // phpcs:ignore Magento2.Security.InsecureFunction return unserialize($data); } /** - * Prepare url. + * Prepare parameter array. * * @param string $name - * @return string + * @return array */ - private function prepareUrl($name) + private function prepareParamArray($name) { - return $_ENV['app_frontend_url'] . self::URL . '?name=' . urlencode($name); + return [ + 'token' => urlencode($this->webapiHandler->getWebapiToken()), + 'name' => urlencode($name) + ]; } } diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Command/GeneratedCode.php b/dev/tests/functional/lib/Magento/Mtf/Util/Command/GeneratedCode.php index dde3409ed1562..a9fefa25ffa24 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Command/GeneratedCode.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Command/GeneratedCode.php @@ -7,6 +7,7 @@ use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; +use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator; /** * GeneratedCode removes generated code of Magento (like generated/code and generated/metadata). @@ -16,7 +17,7 @@ class GeneratedCode /** * Url to deleteMagentoGeneratedCode.php. */ - const URL = 'dev/tests/functional/utils/deleteMagentoGeneratedCode.php'; + const URL = '/dev/tests/functional/utils/deleteMagentoGeneratedCode.php'; /** * Curl transport protocol. @@ -25,12 +26,21 @@ class GeneratedCode */ private $transport; + /** + * Webapi handler. + * + * @var WebapiDecorator + */ + private $webapiHandler; + /** * @param CurlTransport $transport + * @param WebapiDecorator $webapiHandler */ - public function __construct(CurlTransport $transport) + public function __construct(CurlTransport $transport, WebapiDecorator $webapiHandler) { $this->transport = $transport; + $this->webapiHandler = $webapiHandler; } /** @@ -40,10 +50,25 @@ public function __construct(CurlTransport $transport) */ public function delete() { - $url = $_ENV['app_frontend_url'] . self::URL; - $curl = $this->transport; - $curl->write($url, [], CurlInterface::GET); - $curl->read(); - $curl->close(); + $this->transport->write( + rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL, + $this->prepareParamArray(), + CurlInterface::POST, + [] + ); + $this->transport->read(); + $this->transport->close(); + } + + /** + * Prepare parameter array. + * + * @return array + */ + private function prepareParamArray() + { + return [ + 'token' => urlencode($this->webapiHandler->getWebapiToken()) + ]; } } diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Command/Locales.php b/dev/tests/functional/lib/Magento/Mtf/Util/Command/Locales.php index f669d91f2f2e5..a55d803f43087 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Command/Locales.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Command/Locales.php @@ -7,6 +7,7 @@ use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; +use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator; /** * Returns array of locales depends on fetching type. @@ -26,7 +27,7 @@ class Locales /** * Url to locales.php. */ - const URL = 'dev/tests/functional/utils/locales.php'; + const URL = '/dev/tests/functional/utils/locales.php'; /** * Curl transport protocol. @@ -35,12 +36,21 @@ class Locales */ private $transport; + /** + * Webapi handler. + * + * @var WebapiDecorator + */ + private $webapiHandler; + /** * @param CurlTransport $transport Curl transport protocol + * @param WebapiDecorator $webapiHandler */ - public function __construct(CurlTransport $transport) + public function __construct(CurlTransport $transport, WebapiDecorator $webapiHandler) { $this->transport = $transport; + $this->webapiHandler = $webapiHandler; } /** @@ -51,12 +61,28 @@ public function __construct(CurlTransport $transport) */ public function getList($type = self::TYPE_ALL) { - $url = $_ENV['app_frontend_url'] . self::URL . '?type=' . $type; - $curl = $this->transport; - $curl->write($url, [], CurlInterface::GET); - $result = $curl->read(); - $curl->close(); - + $this->transport->write( + rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL, + $this->prepareParamArray($type), + CurlInterface::POST, + [] + ); + $result = $this->transport->read(); + $this->transport->close(); return explode('|', $result); } + + /** + * Prepare parameter array. + * + * @param string $type + * @return array + */ + private function prepareParamArray($type) + { + return [ + 'token' => urlencode($this->webapiHandler->getWebapiToken()), + 'type' => urlencode($type) + ]; + } } diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Command/PathChecker.php b/dev/tests/functional/lib/Magento/Mtf/Util/Command/PathChecker.php index fd1f746a6f09c..4b12f6eec87aa 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Command/PathChecker.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Command/PathChecker.php @@ -7,6 +7,7 @@ use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; +use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator; /** * PathChecker checks that path to file or directory exists. @@ -16,7 +17,7 @@ class PathChecker /** * Url to checkPath.php. */ - const URL = 'dev/tests/functional/utils/pathChecker.php'; + const URL = '/dev/tests/functional/utils/pathChecker.php'; /** * Curl transport protocol. @@ -26,11 +27,21 @@ class PathChecker private $transport; /** + * Webapi handler. + * + * @var WebapiDecorator + */ + private $webapiHandler; + + /** + * @constructor * @param CurlTransport $transport + * @param WebapiDecorator $webapiHandler */ - public function __construct(CurlTransport $transport) + public function __construct(CurlTransport $transport, WebapiDecorator $webapiHandler) { $this->transport = $transport; + $this->webapiHandler = $webapiHandler; } /** @@ -41,12 +52,28 @@ public function __construct(CurlTransport $transport) */ public function pathExists($path) { - $url = $_ENV['app_frontend_url'] . self::URL . '?path=' . urlencode($path); - $curl = $this->transport; - $curl->write($url, [], CurlInterface::GET); - $result = $curl->read(); - $curl->close(); - + $this->transport->write( + rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL, + $this->prepareParamArray($path), + CurlInterface::POST, + [] + ); + $result = $this->transport->read(); + $this->transport->close(); return strpos($result, 'path exists: true') !== false; } + + /** + * Prepare parameter array. + * + * @param string $path + * @return array + */ + private function prepareParamArray($path) + { + return [ + 'token' => urlencode($this->webapiHandler->getWebapiToken()), + 'path' => urlencode($path) + ]; + } } diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Command/Website.php b/dev/tests/functional/lib/Magento/Mtf/Util/Command/Website.php index 7d73634c0360d..fec20bb2a8715 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Command/Website.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Command/Website.php @@ -3,11 +3,11 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Mtf\Util\Command; use Magento\Mtf\Util\Protocol\CurlInterface; use Magento\Mtf\Util\Protocol\CurlTransport; +use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator; /** * Perform Website folder creation for functional tests executions. @@ -17,7 +17,7 @@ class Website /** * Url to website.php. */ - const URL = 'dev/tests/functional/utils/website.php'; + const URL = '/dev/tests/functional/utils/website.php'; /** * Curl transport protocol. @@ -26,13 +26,22 @@ class Website */ private $transport; + /** + * Webapi handler. + * + * @var WebapiDecorator + */ + private $webapiHandler; + /** * @constructor * @param CurlTransport $transport + * @param WebapiDecorator $webapiHandler */ - public function __construct(CurlTransport $transport) + public function __construct(CurlTransport $transport, WebapiDecorator $webapiHandler) { $this->transport = $transport; + $this->webapiHandler = $webapiHandler; } /** @@ -43,21 +52,28 @@ public function __construct(CurlTransport $transport) */ public function create($websiteCode) { - $curl = $this->transport; - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($this->prepareUrl($websiteCode), [], CurlInterface::GET); - $curl->read(); - $curl->close(); + $this->transport->addOption(CURLOPT_HEADER, 1); + $this->transport->write( + rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL, + $this->prepareParamArray($websiteCode), + CurlInterface::POST, + [] + ); + $this->transport->read(); + $this->transport->close(); } /** - * Prepare url. + * Prepare parameter array. * * @param string $websiteCode - * @return string + * @return array */ - private function prepareUrl($websiteCode) + private function prepareParamArray($websiteCode) { - return $_ENV['app_frontend_url'] . self::URL . '?website_code=' . urlencode($websiteCode); + return [ + 'token' => urlencode($this->webapiHandler->getWebapiToken()), + 'website_code' => urlencode($websiteCode) + ]; } } diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php index b1c552370835c..5999b52141f05 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php @@ -63,24 +63,59 @@ public function __construct(CurlTransport $transport, DataInterface $configurati */ protected function authorize() { - // Perform GET to backend url so form_key is set - $url = $_ENV['app_backend_url']; - $this->transport->write($url, [], CurlInterface::GET); - $this->read(); - - $url = $_ENV['app_backend_url'] . $this->configuration->get('application/0/backendLoginUrl/0/value'); - $data = [ - 'login[username]' => $this->configuration->get('application/0/backendLogin/0/value'), - 'login[password]' => $this->configuration->get('application/0/backendPassword/0/value'), - 'form_key' => $this->formKey, - ]; - $this->transport->write($url, $data, CurlInterface::POST); - $response = $this->read(); - if (strpos($response, 'login-form') !== false) { + // There are situations where magento application backend url could be slightly different from the environment + // variable we know. It could be intentionally (e.g. InstallTest) or unintentionally. We would still want tests + // to run in this case. + // When the original app_backend_url does not work, we will try 4 variants of the it. i.e. with and without + // url rewrite, http and https. + $urls = []; + $originalUrl = rtrim($_ENV['app_backend_url'], '/') . '/'; + $urls[] = $originalUrl; + // It could be the case that the page needs a refresh, so we will try the original one twice. + $urls[] = $originalUrl; + if (strpos($originalUrl, '/index.php') !== false) { + $url2 = str_replace('/index.php', '', $originalUrl); + } else { + $url2 = $originalUrl . 'index.php/'; + } + $urls[] = $url2; + if (strpos($originalUrl, 'https') !== false) { + $urls[] = str_replace('https', 'http', $originalUrl); + $urls[] = str_replace('https', 'http', $url2); + } else { + $urls[] = str_replace('http', 'https', $originalUrl); + $urls[] = str_replace('http', 'https', $url2); + } + + $isAuthorized = false; + foreach ($urls as $url) { + try { + // Perform GET to backend url so form_key is set + $this->transport->write($url, [], CurlInterface::GET); + $this->read(); + + $authUrl = $url . $this->configuration->get('application/0/backendLoginUrl/0/value'); + $data = [ + 'login[username]' => $this->configuration->get('application/0/backendLogin/0/value'), + 'login[password]' => $this->configuration->get('application/0/backendPassword/0/value'), + 'form_key' => $this->formKey, + ]; + + $this->transport->write($authUrl, $data, CurlInterface::POST); + $response = $this->read(); + if (strpos($response, 'login-form') !== false) { + continue; + } + $isAuthorized = true; + $_ENV['app_backend_url'] = $url; + break; + } catch (\Exception $e) { + continue; + } + } + if ($isAuthorized == false) { // phpcs:ignore Magento2.Exceptions.DirectThrow - throw new \Exception( - 'Admin user cannot be logged in by curl handler!' - ); + throw new \Exception('Admin user cannot be logged in by curl handler!'); } } diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/WebapiDecorator.php b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/WebapiDecorator.php index 3aa756904ab00..df5ab45a3f96d 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/WebapiDecorator.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/WebapiDecorator.php @@ -70,6 +70,13 @@ class WebapiDecorator implements CurlInterface */ protected $response; + /** + * Webapi token. + * + * @var string + */ + protected $webapiToken; + /** * @construct * @param ObjectManager $objectManager @@ -110,6 +117,9 @@ protected function init() $integration->persist(); $this->setConfiguration($integration); + $this->webapiToken = $integration->getToken(); + } else { + $this->webapiToken = $integrationToken; } } @@ -161,7 +171,13 @@ protected function setConfiguration(Integration $integration) */ protected function isValidIntegration() { - $this->write($_ENV['app_frontend_url'] . 'rest/V1/modules', [], CurlInterface::GET); + $url = rtrim($_ENV['app_frontend_url'], '/'); + if (strpos($url, 'index.php') === false) { + $url .= '/index.php/rest/V1/modules'; + } else { + $url .= '/rest/V1/modules'; + } + $this->write($url, [], CurlInterface::GET); $response = json_decode($this->read(), true); return (null !== $response) && !isset($response['message']); @@ -219,4 +235,18 @@ public function close() { $this->transport->close(); } + + /** + * Return webapiToken. + * + * @return string + */ + public function getWebapiToken() + { + // Request token if integration is no longer valid + if (!$this->isValidIntegration()) { + $this->init(); + } + return $this->webapiToken; + } } diff --git a/dev/tests/functional/tests/app/Magento/Config/Test/Handler/ConfigData/Curl.php b/dev/tests/functional/tests/app/Magento/Config/Test/Handler/ConfigData/Curl.php index 66587879848a3..0d89a1d4eba6e 100644 --- a/dev/tests/functional/tests/app/Magento/Config/Test/Handler/ConfigData/Curl.php +++ b/dev/tests/functional/tests/app/Magento/Config/Test/Handler/ConfigData/Curl.php @@ -123,9 +123,9 @@ protected function prepareConfigPath(array $input) */ protected function applyConfigSettings(array $data, $section) { - $url = $this->getUrl($section); $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); $curl->addOption(CURLOPT_HEADER, 1); + $url = $this->getUrl($section); $curl->write($url, $data); $response = $curl->read(); $curl->close(); diff --git a/dev/tests/functional/utils/authenticate.php b/dev/tests/functional/utils/authenticate.php new file mode 100644 index 0000000000000..15851f6e8000a --- /dev/null +++ b/dev/tests/functional/utils/authenticate.php @@ -0,0 +1,29 @@ +create($_SERVER); + $tokenModel = $magentoObjectManager->get(\Magento\Integration\Model\Oauth\Token::class); + + $tokenPassedIn = $token; + // Token returned will be null if the token we passed in is invalid + $tokenFromMagento = $tokenModel->loadByToken($tokenPassedIn)->getToken(); + if (!empty($tokenFromMagento) && ($tokenFromMagento == $tokenPassedIn)) { + return true; + } else { + return false; + } +} diff --git a/dev/tests/functional/utils/command.php b/dev/tests/functional/utils/command.php index 99025dd1cffcc..a3f6d1e19b4e9 100644 --- a/dev/tests/functional/utils/command.php +++ b/dev/tests/functional/utils/command.php @@ -3,7 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - +// phpcs:ignore Magento2.Security.IncludeFile +include __DIR__ . '/authenticate.php'; // phpcs:ignore Magento2.Security.IncludeFile require_once __DIR__ . '/../../../../app/bootstrap.php'; @@ -11,18 +12,21 @@ use Symfony\Component\Console\Output\NullOutput; // phpcs:ignore Magento2.Security.Superglobal -if (isset($_GET['command'])) { - // phpcs:ignore Magento2.Security.Superglobal - $command = urldecode($_GET['command']); - // phpcs:ignore Magento2.Security.Superglobal - $magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); - // phpcs:ignore Magento2.Security.Superglobal - $magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); - $cli = $magentoObjectManager->create(\Magento\Framework\Console\Cli::class); - $input = new StringInput($command); - $input->setInteractive(false); - $output = new NullOutput(); - $cli->doRun($input, $output); +if (!empty($_POST['token']) && !empty($_POST['command'])) { + if (authenticate(urldecode($_POST['token']))) { + $command = urldecode($_POST['command']); + // phpcs:ignore Magento2.Security.Superglobal + $magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); + // phpcs:ignore Magento2.Security.Superglobal + $magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); + $cli = $magentoObjectManager->create(\Magento\Framework\Console\Cli::class); + $input = new StringInput(escapeshellcmd($command)); + $input->setInteractive(false); + $output = new NullOutput(); + $cli->doRun($input, $output); + } else { + echo "Command not unauthorized."; + } } else { - throw new \InvalidArgumentException("Command GET parameter is not set."); + echo "'token' or 'command' parameter is not set."; } diff --git a/dev/tests/functional/utils/deleteMagentoGeneratedCode.php b/dev/tests/functional/utils/deleteMagentoGeneratedCode.php index 17260bd1da635..dcdedcbeeb04a 100644 --- a/dev/tests/functional/utils/deleteMagentoGeneratedCode.php +++ b/dev/tests/functional/utils/deleteMagentoGeneratedCode.php @@ -3,6 +3,16 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +// phpcs:ignore Magento2.Security.IncludeFile +include __DIR__ . '/authenticate.php'; -// phpcs:ignore Magento2.Security.InsecureFunction -exec('rm -rf ../../../../generated/*'); +if (!empty($_POST['token']) && !empty($_POST['path'])) { + if (authenticate(urldecode($_POST['token']))) { + // phpcs:ignore Magento2.Security.InsecureFunction + exec('rm -rf ../../../../generated/*'); + } else { + echo "Command not unauthorized."; + } +} else { + echo "'token' parameter is not set."; +} diff --git a/dev/tests/functional/utils/export.php b/dev/tests/functional/utils/export.php index fa50bc729d0f6..5cdc74c880a76 100644 --- a/dev/tests/functional/utils/export.php +++ b/dev/tests/functional/utils/export.php @@ -3,32 +3,35 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +// phpcs:ignore Magento2.Security.IncludeFile +include __DIR__ . '/authenticate.php'; -// phpcs:ignore Magento2.Security.Superglobal -if (!isset($_GET['template'])) { - // phpcs:ignore Magento2.Exceptions.DirectThrow - throw new \InvalidArgumentException('Argument "template" must be set.'); -} +if (!empty($_POST['token']) && !empty($_POST['template'])) { + if (authenticate(urldecode($_POST['token']))) { + $varDir = '../../../../var/'; + $template = urldecode($_POST['template']); + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $fileList = scandir($varDir, SCANDIR_SORT_NONE); + $files = []; -$varDir = '../../../../var/export/'; -// phpcs:ignore Magento2.Security.Superglobal -$template = urldecode($_GET['template']); -// phpcs:ignore Magento2.Functions.DiscouragedFunction -$fileList = scandir($varDir, SCANDIR_SORT_NONE); -$files = []; + foreach ($fileList as $fileName) { + if (preg_match("`$template`", $fileName) === 1) { + $filePath = $varDir . $fileName; + $files[] = [ + // phpcs:ignore Magento2.Functions.DiscouragedFunction + 'content' => file_get_contents($filePath), + 'name' => $fileName, + // phpcs:ignore Magento2.Functions.DiscouragedFunction + 'date' => filectime($filePath), + ]; + } + } -foreach ($fileList as $fileName) { - if (preg_match("`$template`", $fileName) === 1) { - $filePath = $varDir . $fileName; - $files[] = [ - // phpcs:ignore Magento2.Functions.DiscouragedFunction - 'content' => file_get_contents($filePath), - 'name' => $fileName, - // phpcs:ignore Magento2.Functions.DiscouragedFunction - 'date' => filectime($filePath), - ]; + // phpcs:ignore Magento2.Security.LanguageConstruct, Magento2.Security.InsecureFunction + echo serialize($files); + } else { + echo "Command not unauthorized."; } +} else { + echo "'token' or 'template' parameter is not set."; } - -// phpcs:ignore Magento2.Security.LanguageConstruct, Magento2.Security.InsecureFunction -echo serialize($files); diff --git a/dev/tests/functional/utils/locales.php b/dev/tests/functional/utils/locales.php index 11e1e2b70fa50..97c8932a9e6c0 100644 --- a/dev/tests/functional/utils/locales.php +++ b/dev/tests/functional/utils/locales.php @@ -3,20 +3,26 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +// phpcs:ignore Magento2.Security.IncludeFile +include __DIR__ . '/authenticate.php'; -// phpcs:ignore Magento2.Security.Superglobal -if (isset($_GET['type']) && $_GET['type'] == 'deployed') { - // phpcs:ignore Magento2.Security.Superglobal - $themePath = isset($_GET['theme_path']) ? $_GET['theme_path'] : 'adminhtml/Magento/backend'; - $directory = __DIR__ . '/../../../../pub/static/' . $themePath; - // phpcs:ignore Magento2.Functions.DiscouragedFunction - $locales = array_diff(scandir($directory), ['..', '.']); +if (!empty($_POST['token'])) { + if (authenticate(urldecode($_POST['token']))) { + if ($_POST['type'] == 'deployed') { + $themePath = isset($_POST['theme_path']) ? $_POST['theme_path'] : 'adminhtml/Magento/backend'; + $directory = __DIR__ . '/../../../../pub/static/' . $themePath; + $locales = array_diff(scandir($directory), ['..', '.']); + } else { + // phpcs:ignore Magento2.Security.IncludeFile + require_once __DIR__ . DIRECTORY_SEPARATOR . 'bootstrap.php'; + $localeConfig = $magentoObjectManager->create(\Magento\Framework\Locale\Config::class); + $locales = $localeConfig->getAllowedLocales(); + } + // phpcs:ignore Magento2.Security.LanguageConstruct + echo implode('|', $locales); + } else { + echo "Command not unauthorized."; + } } else { - // phpcs:ignore Magento2.Security.IncludeFile - require_once __DIR__ . DIRECTORY_SEPARATOR . 'bootstrap.php'; - $localeConfig = $magentoObjectManager->create(\Magento\Framework\Locale\Config::class); - $locales = $localeConfig->getAllowedLocales(); + echo "'token' parameter is not set."; } - -// phpcs:ignore Magento2.Security.LanguageConstruct -echo implode('|', $locales); diff --git a/dev/tests/functional/utils/log.php b/dev/tests/functional/utils/log.php index 30783ae8e1d28..cec2e1c0ad211 100644 --- a/dev/tests/functional/utils/log.php +++ b/dev/tests/functional/utils/log.php @@ -3,21 +3,23 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - declare(strict_types=1); -// phpcs:ignore Magento2.Security.Superglobal -if (!isset($_GET['name'])) { - // phpcs:ignore Magento2.Exceptions.DirectThrow - throw new \InvalidArgumentException( - 'The name of log file is required for getting logs.' - ); -} +// phpcs:ignore Magento2.Security.IncludeFile +include __DIR__ . '/authenticate.php'; -// phpcs:ignore Magento2.Security.Superglobal -$name = urldecode($_GET['name']); -if (preg_match('/\.\.(\\\|\/)/', $name)) { - throw new \InvalidArgumentException('Invalid log file name'); -} +if (!empty($_POST['token']) && !empty($_POST['name'])) { + if (authenticate(urldecode($_POST['token']))) { + $name = urldecode($_POST['name']); + if (preg_match('/\.\.(\\\|\/)/', $name)) { + // phpcs:ignore Magento2.Exceptions.DirectThrow + throw new \InvalidArgumentException('Invalid log file name'); + } -// phpcs:ignore Magento2.Security.InsecureFunction, Magento2.Functions.DiscouragedFunction, Magento2.Security.LanguageConstruct -echo serialize(file_get_contents('../../../../var/log' .'/' .$name)); + // phpcs:ignore Magento2.Security.InsecureFunction, Magento2.Functions.DiscouragedFunction, Magento2.Security.LanguageConstruct + echo serialize(file_get_contents('../../../../var/log' . '/' . $name)); + } else { + echo "Command not unauthorized."; + } +} else { + echo "'token' or 'name' parameter is not set."; +} diff --git a/dev/tests/functional/utils/pathChecker.php b/dev/tests/functional/utils/pathChecker.php index 217cf90af0a56..ed1949d71768d 100644 --- a/dev/tests/functional/utils/pathChecker.php +++ b/dev/tests/functional/utils/pathChecker.php @@ -3,20 +3,23 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +// phpcs:ignore Magento2.Security.IncludeFile +include __DIR__ . '/authenticate.php'; -// phpcs:ignore Magento2.Security.Superglobal -if (isset($_GET['path'])) { - // phpcs:ignore Magento2.Security.Superglobal - $path = urldecode($_GET['path']); - // phpcs:ignore Magento2.Functions.DiscouragedFunction - if (file_exists('../../../../' . $path)) { - // phpcs:ignore Magento2.Security.LanguageConstruct - echo 'path exists: true'; +if (!empty($_POST['token']) && !empty($_POST['path'])) { + if (authenticate(urldecode($_POST['token']))) { + $path = urldecode($_POST['path']); + // phpcs:ignore Magento2.Functions.DiscouragedFunction + if (file_exists('../../../../' . $path)) { + // phpcs:ignore Magento2.Security.LanguageConstruct + echo 'path exists: true'; + } else { + // phpcs:ignore Magento2.Security.LanguageConstruct + echo 'path exists: false'; + } } else { - // phpcs:ignore Magento2.Security.LanguageConstruct - echo 'path exists: false'; + echo "Command not unauthorized."; } } else { - // phpcs:ignore Magento2.Exceptions.DirectThrow - throw new \InvalidArgumentException("GET parameter 'path' is not set."); + echo "'token' or 'path' parameter is not set."; } diff --git a/dev/tests/functional/utils/website.php b/dev/tests/functional/utils/website.php index 720b4962aedd4..980dd557db6f7 100644 --- a/dev/tests/functional/utils/website.php +++ b/dev/tests/functional/utils/website.php @@ -3,36 +3,40 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +// phpcs:ignore Magento2.Security.IncludeFile +include __DIR__ . '/authenticate.php'; -// phpcs:ignore Magento2.Security.Superglobal -if (!isset($_GET['website_code'])) { - // phpcs:ignore Magento2.Exceptions.DirectThrow - throw new \Exception("website_code GET parameter is not set."); -} - -// phpcs:ignore Magento2.Security.Superglobal -$websiteCode = urldecode($_GET['website_code']); -$rootDir = '../../../../'; -$websiteDir = $rootDir . 'websites/' . $websiteCode . '/'; -// phpcs:ignore Magento2.Functions.DiscouragedFunction -$contents = file_get_contents($rootDir . 'index.php'); +if (!empty($_POST['token']) && !empty($_POST['website_code'])) { + if (authenticate(urldecode($_POST['token']))) { + $websiteCode = urldecode($_POST['website_code']); + $rootDir = '../../../../'; + $websiteDir = $rootDir . 'websites/' . $websiteCode . '/'; + // phpcs:ignore Magento2.Functions.DiscouragedFunction + $contents = file_get_contents($rootDir . 'index.php'); -$websiteParam = << Date: Wed, 1 May 2019 16:39:20 +0530 Subject: [PATCH 13/30] Resolved typo error Resolved typo error --- lib/web/css/docs/source/_pages.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/css/docs/source/_pages.less b/lib/web/css/docs/source/_pages.less index 6b01fa7549e92..59eb121112d28 100644 --- a/lib/web/css/docs/source/_pages.less +++ b/lib/web/css/docs/source/_pages.less @@ -4,7 +4,7 @@ // */ // # Pagination HTML markup -// Pagination is used to display numbers of pages in case content exceeds page limits. The markup corresponds to accesibility demands. +// Pagination is used to display numbers of pages in case content exceeds page limits. The markup corresponds to accessibility demands. // // Required HTML markup: // ```html From 54063286858824c4f8b492d22672008864d87b81 Mon Sep 17 00:00:00 2001 From: Abhinay Pratap Singh <32534204+abhinay111222@users.noreply.github.com> Date: Wed, 1 May 2019 16:44:56 +0530 Subject: [PATCH 14/30] fixed typo error fixed typo error --- lib/web/css/docs/source/_popups.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/css/docs/source/_popups.less b/lib/web/css/docs/source/_popups.less index b192219b6438f..7251cde45bc3c 100644 --- a/lib/web/css/docs/source/_popups.less +++ b/lib/web/css/docs/source/_popups.less @@ -245,7 +245,7 @@ // @popup-title-headings__level // h3 // h1 | h2 | h3 | h4 | h5 | h6 -// What heading style is applyed to the popup title +// What heading style is applied to the popup title // // // Popup close button From d9edfe27a638e115a4c66eb721c77b8aa0e86f78 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 1 May 2019 12:57:31 -0500 Subject: [PATCH 15/30] MQE-1532: Bump MFTF version in Magento - Version bump and lock file update --- composer.json | 2 +- composer.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index cff2d676038d7..2ba4d20c6533e 100644 --- a/composer.json +++ b/composer.json @@ -86,7 +86,7 @@ "friendsofphp/php-cs-fixer": "~2.13.0", "lusitanian/oauth": "~0.8.10", "magento/magento-coding-standard": "~1.0.0", - "magento/magento2-functional-testing-framework": "~2.3.14", + "magento/magento2-functional-testing-framework": "~2.4.0", "pdepend/pdepend": "2.5.2", "phpmd/phpmd": "@stable", "phpunit/phpunit": "~6.5.0", diff --git a/composer.lock b/composer.lock index 5d9f7fbdf695c..09ca8cd9f3f02 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "597fe6a47b695221292482fead498d83", + "content-hash": "6b0350be54f49186c1c9f55ac29bf1cb", "packages": [ { "name": "braintree/braintree_php", @@ -6699,16 +6699,16 @@ }, { "name": "magento/magento2-functional-testing-framework", - "version": "2.3.14", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/magento/magento2-functional-testing-framework.git", - "reference": "b4002b3fe53884895921b44cf519d42918e3c7c6" + "reference": "ef534dbcb3aeea68f9254dfd018165c546ad2edb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/b4002b3fe53884895921b44cf519d42918e3c7c6", - "reference": "b4002b3fe53884895921b44cf519d42918e3c7c6", + "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/ef534dbcb3aeea68f9254dfd018165c546ad2edb", + "reference": "ef534dbcb3aeea68f9254dfd018165c546ad2edb", "shasum": "" }, "require": { @@ -6721,12 +6721,12 @@ "fzaninotto/faker": "^1.6", "monolog/monolog": "^1.0", "mustache/mustache": "~2.5", - "php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0", + "php": "7.0.2||7.0.4||~7.0.6||~7.1.0||~7.2.0||~7.3.0", "symfony/process": "^2.8 || ^3.1 || ^4.0", "vlucas/phpdotenv": "^2.4" }, "require-dev": { - "brainmaestro/composer-git-hooks": "^2.3", + "brainmaestro/composer-git-hooks": "^2.3.1", "codacy/coverage": "^1.4", "codeception/aspect-mock": "^3.0", "doctrine/cache": "<1.7.0", @@ -6768,19 +6768,19 @@ "magento", "testing" ], - "time": "2019-02-19T16:03:22+00:00" + "time": "2019-04-29T20:56:26+00:00" }, { "name": "mikey179/vfsStream", "version": "v1.6.5", "source": { "type": "git", - "url": "https://github.com/mikey179/vfsStream.git", + "url": "https://github.com/bovigo/vfsStream.git", "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", "shasum": "" }, From 0ccea38d9e8e923d1644e3df953e8b2c62f3946d Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 1 May 2019 14:24:34 -0500 Subject: [PATCH 16/30] MAGETWO-99451: Custom customer address attribute values are empty when address is changed in admin checkout --- .../templates/order/create/form/address.phtml | 12 +------ .../Api/ExtensibleDataObjectConverter.php | 33 ++++++++++++++----- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml index d1a90783c68c7..46d0961353c65 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml @@ -6,16 +6,6 @@ // @codingStandardsIgnoreFile -/** - * @var \Magento\Customer\Model\ResourceModel\Address\Collection $addressCollection - */ -$addressCollection = $block->getData('customerAddressCollection'); - -$addressArray = []; -if ($block->getCustomerId()) { - $addressArray = $addressCollection->setCustomerFilter([$block->getCustomerId()])->toArray(); -} - /** * @var \Magento\Sales\ViewModel\Customer\AddressFormatter $customerAddressFormatter */ @@ -32,7 +22,7 @@ if ($block->getIsShipping()): require(["Magento_Sales/order/create/form"], function(){ order.shippingAddressContainer = ''; - order.setAddresses(getAddressesJson($addressArray) ?>); + order.setAddresses(getAddressCollectionJson() ?>); }); diff --git a/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php b/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php index 538f4e646d060..c3efcf6a0dc54 100644 --- a/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php +++ b/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php @@ -45,6 +45,28 @@ public function toNestedArray( } $dataObjectArray = $this->dataObjectProcessor->buildOutputDataArray($dataObject, $dataObjectType); //process custom attributes if present + $dataObjectArray = $this->processCustomAttributes($dataObjectArray, $skipAttributes); + + if (!empty($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY])) { + /** @var array $extensionAttributes */ + $extensionAttributes = $dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]; + unset($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]); + foreach ($extensionAttributes as $attributeKey => $attributeValue) { + if (!in_array($attributeKey, $skipAttributes)) { + $dataObjectArray[$attributeKey] = $attributeValue; + } + } + } + return $dataObjectArray; + } + + /** + * @param array $dataObjectArray + * @param array $skipAttributes + * @return array + */ + private function processCustomAttributes(array $dataObjectArray, array $skipAttributes): array + { if (!empty($dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY])) { /** @var AttributeValue[] $customAttributes */ $customAttributes = $dataObjectArray[AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY]; @@ -56,14 +78,9 @@ public function toNestedArray( } } } - if (!empty($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY])) { - /** @var array $extensionAttributes */ - $extensionAttributes = $dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]; - unset($dataObjectArray[ExtensibleDataInterface::EXTENSION_ATTRIBUTES_KEY]); - foreach ($extensionAttributes as $attributeKey => $attributeValue) { - if (!in_array($attributeKey, $skipAttributes)) { - $dataObjectArray[$attributeKey] = $attributeValue; - } + foreach ($dataObjectArray as $key => $value) { + if (is_array($value)) { + $dataObjectArray[$key] = $this->processCustomAttributes($value, $skipAttributes); } } return $dataObjectArray; From a4452308ae99dfde1e9d415179116745e0639f77 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 1 May 2019 15:22:06 -0500 Subject: [PATCH 17/30] MQE-1532: Bump MFTF version in Magento - Flaky test fix --- ...rtStorefrontShoppingCartSummaryWithShippingActionGroup.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml index 5eb3de3a1af82..dcb683a50125d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml @@ -13,8 +13,6 @@ - - - + From 98bf900c748e922a632f824033e5b7e221c4eec7 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 1 May 2019 16:10:00 -0500 Subject: [PATCH 18/30] MAGETWO-99451: Custom customer address attribute values are empty when address is changed in admin checkout --- .../templates/order/create/form/address.phtml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml index 46d0961353c65..ad2641577c4a7 100644 --- a/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml +++ b/app/code/Magento/Sales/view/adminhtml/templates/order/create/form/address.phtml @@ -6,6 +6,16 @@ // @codingStandardsIgnoreFile +/** + * @var \Magento\Customer\Model\ResourceModel\Address\Collection $addressCollection + */ +$addressCollection = $block->getData('customerAddressCollection'); + +$addressArray = []; +if ($block->getCustomerId()) { + $addressArray = $addressCollection->setCustomerFilter([$block->getCustomerId()])->toArray(); +} + /** * @var \Magento\Sales\ViewModel\Customer\AddressFormatter $customerAddressFormatter */ From 3bba6f3cbd8e5b53bc5b0a032deaba1da88352a1 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Wed, 1 May 2019 16:12:52 -0500 Subject: [PATCH 19/30] MAGETWO-99451: Custom customer address attribute values are empty when address is changed in admin checkout --- .../Magento/Framework/Api/ExtensibleDataObjectConverter.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php b/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php index c3efcf6a0dc54..e51788ad9ecf5 100644 --- a/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php +++ b/lib/internal/Magento/Framework/Api/ExtensibleDataObjectConverter.php @@ -61,6 +61,8 @@ public function toNestedArray( } /** + * Recursive process array to process customer attributes + * * @param array $dataObjectArray * @param array $skipAttributes * @return array From a2b7a08face5ba8f1940d3ad945e13bd0d000f0c Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Wed, 1 May 2019 16:46:16 -0500 Subject: [PATCH 20/30] MC-16046: Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading - Remove font display swap from icons; --- app/design/frontend/Magento/blank/web/css/source/_icons.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/blank/web/css/source/_icons.less b/app/design/frontend/Magento/blank/web/css/source/_icons.less index 52ae8a0e8c707..7d1ceaca73c72 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_icons.less +++ b/app/design/frontend/Magento/blank/web/css/source/_icons.less @@ -8,7 +8,6 @@ @family-name: @icons__font-name, @font-path: @icons__font-path, @font-weight: normal, - @font-style: normal, - @font-display: swap + @font-style: normal ); } From 9dd61cfd8b25cafbe012eedf8c8abec7208ee755 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Wed, 1 May 2019 17:49:10 -0500 Subject: [PATCH 21/30] MC-16046: Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading - Add font display swap from icons; --- app/design/frontend/Magento/blank/web/css/source/_icons.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/design/frontend/Magento/blank/web/css/source/_icons.less b/app/design/frontend/Magento/blank/web/css/source/_icons.less index 7d1ceaca73c72..52ae8a0e8c707 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_icons.less +++ b/app/design/frontend/Magento/blank/web/css/source/_icons.less @@ -8,6 +8,7 @@ @family-name: @icons__font-name, @font-path: @icons__font-path, @font-weight: normal, - @font-style: normal + @font-style: normal, + @font-display: swap ); } From b96c2d8a44a54fce04c2b20c52f8477965a828a2 Mon Sep 17 00:00:00 2001 From: Ravi Chandra Date: Thu, 2 May 2019 09:51:08 +0530 Subject: [PATCH 22/30] Correct spelling --- .../Ui/DataProvider/Product/ProductRenderCollectorComposite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorComposite.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorComposite.php index 359b1a1a948f8..a4b3f231cfb9c 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorComposite.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorComposite.php @@ -9,7 +9,7 @@ use Magento\Catalog\Api\Data\ProductRenderInterface; /** - * Composite, which holds collectors, that collect enought information for + * Composite, which holds collectors, that collect enough information for * product render */ class ProductRenderCollectorComposite implements ProductRenderCollectorInterface From 183e0620a53083aca08d2fbdb373f0041847278e Mon Sep 17 00:00:00 2001 From: Afreen Sheikh Date: Thu, 2 May 2019 18:07:14 +0530 Subject: [PATCH 23/30] fixed typo issue fixed typo issue --- lib/web/css/docs/source/_responsive.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/css/docs/source/_responsive.less b/lib/web/css/docs/source/_responsive.less index 46c19bc23a66c..8e7397d6ad6f3 100644 --- a/lib/web/css/docs/source/_responsive.less +++ b/lib/web/css/docs/source/_responsive.less @@ -81,7 +81,7 @@ // // ## Gathering // -// Everything that you include in collector mixins above will go in place where they declarated. +// Everything that you include in collector mixins above will go in place where they declared. // As example all // ```css // .media-width(@extremum, @break) { From 9d8eaa487d1f30bea5be94ed9311184d2c2a1686 Mon Sep 17 00:00:00 2001 From: Dmytro Poperechnyy Date: Thu, 2 May 2019 09:12:25 -0500 Subject: [PATCH 24/30] MC-16046: Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading - Remove font display swap from icons; --- app/design/frontend/Magento/blank/web/css/source/_icons.less | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/design/frontend/Magento/blank/web/css/source/_icons.less b/app/design/frontend/Magento/blank/web/css/source/_icons.less index 52ae8a0e8c707..7d1ceaca73c72 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_icons.less +++ b/app/design/frontend/Magento/blank/web/css/source/_icons.less @@ -8,7 +8,6 @@ @family-name: @icons__font-name, @font-path: @icons__font-path, @font-weight: normal, - @font-style: normal, - @font-display: swap + @font-style: normal ); } From a83eade22bc3a376be6b5a4b586e3a8318abe053 Mon Sep 17 00:00:00 2001 From: Ji Lu Date: Thu, 2 May 2019 09:51:35 -0500 Subject: [PATCH 25/30] MQE-1536: Magento\Install\Test\TestCase\InstallTest is failing - reverting MAGETWO-99210 --- .../Mtf/Util/Protocol/CurlTransport/BackendDecorator.php | 1 + dev/tests/functional/utils/authenticate.php | 5 +++++ dev/tests/functional/utils/command.php | 5 +++++ dev/tests/functional/utils/deleteMagentoGeneratedCode.php | 4 ++++ dev/tests/functional/utils/export.php | 7 ++++++- dev/tests/functional/utils/locales.php | 7 +++++++ dev/tests/functional/utils/log.php | 5 +++++ dev/tests/functional/utils/pathChecker.php | 5 +++++ dev/tests/functional/utils/website.php | 5 +++++ 9 files changed, 43 insertions(+), 1 deletion(-) diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php index 5999b52141f05..a9a082e2c0027 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php @@ -109,6 +109,7 @@ protected function authorize() $isAuthorized = true; $_ENV['app_backend_url'] = $url; break; + // phpcs:ignore Magento2.Exceptions.ThrowCatch } catch (\Exception $e) { continue; } diff --git a/dev/tests/functional/utils/authenticate.php b/dev/tests/functional/utils/authenticate.php index 15851f6e8000a..958b692cbd385 100644 --- a/dev/tests/functional/utils/authenticate.php +++ b/dev/tests/functional/utils/authenticate.php @@ -9,12 +9,17 @@ * * @param string $token * @return bool + * + * phpcs:disable Squiz.Functions.GlobalFunction */ function authenticate($token) { + // phpcs:ignore Magento2.Security.IncludeFile require_once __DIR__ . '/../../../../app/bootstrap.php'; + // phpcs:ignore Magento2.Security.Superglobal $magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); + // phpcs:ignore Magento2.Security.Superglobal $magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); $tokenModel = $magentoObjectManager->get(\Magento\Integration\Model\Oauth\Token::class); diff --git a/dev/tests/functional/utils/command.php b/dev/tests/functional/utils/command.php index a3f6d1e19b4e9..9405f4ff7c4ca 100644 --- a/dev/tests/functional/utils/command.php +++ b/dev/tests/functional/utils/command.php @@ -13,20 +13,25 @@ // phpcs:ignore Magento2.Security.Superglobal if (!empty($_POST['token']) && !empty($_POST['command'])) { + // phpcs:ignore Magento2.Security.Superglobal if (authenticate(urldecode($_POST['token']))) { + // phpcs:ignore Magento2.Security.Superglobal $command = urldecode($_POST['command']); // phpcs:ignore Magento2.Security.Superglobal $magentoObjectManagerFactory = \Magento\Framework\App\Bootstrap::createObjectManagerFactory(BP, $_SERVER); // phpcs:ignore Magento2.Security.Superglobal $magentoObjectManager = $magentoObjectManagerFactory->create($_SERVER); $cli = $magentoObjectManager->create(\Magento\Framework\Console\Cli::class); + // phpcs:ignore Magento2.Functions.DiscouragedFunction $input = new StringInput(escapeshellcmd($command)); $input->setInteractive(false); $output = new NullOutput(); $cli->doRun($input, $output); } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "Command not unauthorized."; } } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "'token' or 'command' parameter is not set."; } diff --git a/dev/tests/functional/utils/deleteMagentoGeneratedCode.php b/dev/tests/functional/utils/deleteMagentoGeneratedCode.php index dcdedcbeeb04a..bd4ed828202e1 100644 --- a/dev/tests/functional/utils/deleteMagentoGeneratedCode.php +++ b/dev/tests/functional/utils/deleteMagentoGeneratedCode.php @@ -6,13 +6,17 @@ // phpcs:ignore Magento2.Security.IncludeFile include __DIR__ . '/authenticate.php'; +// phpcs:ignore Magento2.Security.Superglobal if (!empty($_POST['token']) && !empty($_POST['path'])) { + // phpcs:ignore Magento2.Security.Superglobal if (authenticate(urldecode($_POST['token']))) { // phpcs:ignore Magento2.Security.InsecureFunction exec('rm -rf ../../../../generated/*'); } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "Command not unauthorized."; } } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "'token' parameter is not set."; } diff --git a/dev/tests/functional/utils/export.php b/dev/tests/functional/utils/export.php index 5cdc74c880a76..df97c8db48406 100644 --- a/dev/tests/functional/utils/export.php +++ b/dev/tests/functional/utils/export.php @@ -6,9 +6,12 @@ // phpcs:ignore Magento2.Security.IncludeFile include __DIR__ . '/authenticate.php'; +// phpcs:ignore Magento2.Security.Superglobal if (!empty($_POST['token']) && !empty($_POST['template'])) { + // phpcs:ignore Magento2.Security.Superglobal if (authenticate(urldecode($_POST['token']))) { - $varDir = '../../../../var/'; + $varDir = '../../../../var/export/'; + // phpcs:ignore Magento2.Security.Superglobal $template = urldecode($_POST['template']); // phpcs:ignore Magento2.Functions.DiscouragedFunction $fileList = scandir($varDir, SCANDIR_SORT_NONE); @@ -30,8 +33,10 @@ // phpcs:ignore Magento2.Security.LanguageConstruct, Magento2.Security.InsecureFunction echo serialize($files); } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "Command not unauthorized."; } } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "'token' or 'template' parameter is not set."; } diff --git a/dev/tests/functional/utils/locales.php b/dev/tests/functional/utils/locales.php index 97c8932a9e6c0..40781ba8b68ec 100644 --- a/dev/tests/functional/utils/locales.php +++ b/dev/tests/functional/utils/locales.php @@ -6,11 +6,16 @@ // phpcs:ignore Magento2.Security.IncludeFile include __DIR__ . '/authenticate.php'; +// phpcs:ignore Magento2.Security.Superglobal if (!empty($_POST['token'])) { + // phpcs:ignore Magento2.Security.Superglobal if (authenticate(urldecode($_POST['token']))) { + // phpcs:ignore Magento2.Security.Superglobal if ($_POST['type'] == 'deployed') { + // phpcs:ignore Magento2.Security.Superglobal $themePath = isset($_POST['theme_path']) ? $_POST['theme_path'] : 'adminhtml/Magento/backend'; $directory = __DIR__ . '/../../../../pub/static/' . $themePath; + // phpcs:ignore Magento2.Functions.DiscouragedFunction $locales = array_diff(scandir($directory), ['..', '.']); } else { // phpcs:ignore Magento2.Security.IncludeFile @@ -21,8 +26,10 @@ // phpcs:ignore Magento2.Security.LanguageConstruct echo implode('|', $locales); } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "Command not unauthorized."; } } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "'token' parameter is not set."; } diff --git a/dev/tests/functional/utils/log.php b/dev/tests/functional/utils/log.php index cec2e1c0ad211..c07f52575504f 100644 --- a/dev/tests/functional/utils/log.php +++ b/dev/tests/functional/utils/log.php @@ -7,8 +7,11 @@ // phpcs:ignore Magento2.Security.IncludeFile include __DIR__ . '/authenticate.php'; +// phpcs:ignore Magento2.Security.Superglobal if (!empty($_POST['token']) && !empty($_POST['name'])) { + // phpcs:ignore Magento2.Security.Superglobal if (authenticate(urldecode($_POST['token']))) { + // phpcs:ignore Magento2.Security.Superglobal $name = urldecode($_POST['name']); if (preg_match('/\.\.(\\\|\/)/', $name)) { // phpcs:ignore Magento2.Exceptions.DirectThrow @@ -18,8 +21,10 @@ // phpcs:ignore Magento2.Security.InsecureFunction, Magento2.Functions.DiscouragedFunction, Magento2.Security.LanguageConstruct echo serialize(file_get_contents('../../../../var/log' . '/' . $name)); } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "Command not unauthorized."; } } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "'token' or 'name' parameter is not set."; } diff --git a/dev/tests/functional/utils/pathChecker.php b/dev/tests/functional/utils/pathChecker.php index ed1949d71768d..d4a59529fac44 100644 --- a/dev/tests/functional/utils/pathChecker.php +++ b/dev/tests/functional/utils/pathChecker.php @@ -6,8 +6,11 @@ // phpcs:ignore Magento2.Security.IncludeFile include __DIR__ . '/authenticate.php'; +// phpcs:ignore Magento2.Security.Superglobal if (!empty($_POST['token']) && !empty($_POST['path'])) { + // phpcs:ignore Magento2.Security.Superglobal if (authenticate(urldecode($_POST['token']))) { + // phpcs:ignore Magento2.Security.Superglobal $path = urldecode($_POST['path']); // phpcs:ignore Magento2.Functions.DiscouragedFunction if (file_exists('../../../../' . $path)) { @@ -18,8 +21,10 @@ echo 'path exists: false'; } } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "Command not unauthorized."; } } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "'token' or 'path' parameter is not set."; } diff --git a/dev/tests/functional/utils/website.php b/dev/tests/functional/utils/website.php index 980dd557db6f7..859b60785e49d 100644 --- a/dev/tests/functional/utils/website.php +++ b/dev/tests/functional/utils/website.php @@ -6,8 +6,11 @@ // phpcs:ignore Magento2.Security.IncludeFile include __DIR__ . '/authenticate.php'; +// phpcs:ignore Magento2.Security.Superglobal if (!empty($_POST['token']) && !empty($_POST['website_code'])) { + // phpcs:ignore Magento2.Security.Superglobal if (authenticate(urldecode($_POST['token']))) { + // phpcs:ignore Magento2.Security.Superglobal $websiteCode = urldecode($_POST['website_code']); $rootDir = '../../../../'; $websiteDir = $rootDir . 'websites/' . $websiteCode . '/'; @@ -35,8 +38,10 @@ // phpcs:ignore Magento2.Functions.DiscouragedFunction file_put_contents($websiteDir . 'index.php', $contents); } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "Command not unauthorized."; } } else { + // phpcs:ignore Magento2.Security.LanguageConstruct echo "'token' or 'website_code' parameter is not set."; } From 149d8eb677e4214d95ade1d7987e6935c64ae511 Mon Sep 17 00:00:00 2001 From: Oleksandr Iegorov Date: Thu, 2 May 2019 12:13:57 -0500 Subject: [PATCH 26/30] MAGETWO-99451: Custom customer address attribute values are empty when address is changed in admin checkout --- .../Unit/ExtensibleDataObjectConverterTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php index f0e333aa5e1d5..e362d652b7a13 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php @@ -83,6 +83,17 @@ public function testToNestedArrayCustom() AttributeValue::VALUE => 'custom_attribute_value_skip', ], ], + 'test' => [ + 0 => [ + '3rd_attribute_key' => '3rd_attribute_value', + AbstractExtensibleObject::CUSTOM_ATTRIBUTES_KEY => [ + [ + AttributeValue::ATTRIBUTE_CODE => 'another_custom_attribute_code', + AttributeValue::VALUE => 'another_custom_attribute_value', + ] + ] + ] + ] ]; $resultArray = [ @@ -92,6 +103,12 @@ public function testToNestedArrayCustom() 'custom_attribute_value_multi_1', 'custom_attribute_value_multi_2', ], + 'test' => [ + 0 => [ + '3rd_attribute_key' => '3rd_attribute_value', + 'another_custom_attribute_code' => 'another_custom_attribute_value', + ] + ] ]; $this->processor->expects($this->any()) From 509cded0ce0cf3bd23dc1cf0b7c442483c9d1dd9 Mon Sep 17 00:00:00 2001 From: Nazarn96 Date: Fri, 3 May 2019 14:34:10 +0300 Subject: [PATCH 27/30] magento/magento2#22599 static-test-fix --- .../DataProvider/Product/ProductRenderCollectorComposite.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorComposite.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorComposite.php index a4b3f231cfb9c..7edf25ff20cc1 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorComposite.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorComposite.php @@ -9,8 +9,7 @@ use Magento\Catalog\Api\Data\ProductRenderInterface; /** - * Composite, which holds collectors, that collect enough information for - * product render + * Composite, which holds collectors, that collect enough information for product render */ class ProductRenderCollectorComposite implements ProductRenderCollectorInterface { From 5f5a2618d218a31705c472167654e4db25dcdc51 Mon Sep 17 00:00:00 2001 From: UdgamN Date: Fri, 3 May 2019 18:18:36 +0530 Subject: [PATCH 28/30] Resolved Typo Updated and corrected the spelling of 'accesibility' to accessiblity --- lib/web/css/docs/source/_breadcrumbs.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/css/docs/source/_breadcrumbs.less b/lib/web/css/docs/source/_breadcrumbs.less index 848af20c0728e..5b5df991e3cdc 100644 --- a/lib/web/css/docs/source/_breadcrumbs.less +++ b/lib/web/css/docs/source/_breadcrumbs.less @@ -8,7 +8,7 @@ // // Breadcrumbs layout with links can be separated by any symbol, for example > symbol. // -// The following markup corresponds to the accesibility demands: +// The following markup corresponds to the accessibility demands: // ```html //
// You are here: From c6b1e108a16a41db59ac2ead340c7089a1c7ca2e Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 1 May 2019 15:22:06 -0500 Subject: [PATCH 29/30] MQE-1532: Bump MFTF version in Magento - Flaky test fix (cherry picked from commit a445230) --- ...rtStorefrontShoppingCartSummaryWithShippingActionGroup.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml index 5eb3de3a1af82..dcb683a50125d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/AssertStorefrontShoppingCartSummaryWithShippingActionGroup.xml @@ -13,8 +13,6 @@ - - - + From a12ecfd2885e84dfd9e4dc109fca0cdeb6b8e032 Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi Date: Mon, 6 May 2019 12:21:35 -0500 Subject: [PATCH 30/30] MAGETWO-99451: Custom customer address attribute values are empty when address is changed in admin checkout --- .../Api/Test/Unit/ExtensibleDataObjectConverterTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php index e362d652b7a13..08fad90fe2f29 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensibleDataObjectConverterTest.php @@ -10,6 +10,9 @@ use Magento\Framework\Api\AbstractExtensibleObject; use Magento\Framework\Api\AttributeValue; +/** + * Class ExtensibleDataObjectConverterTest + */ class ExtensibleDataObjectConverterTest extends \PHPUnit\Framework\TestCase { /** @var \Magento\Framework\Api\ExtensibleDataObjectConverter */