diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml index 9e4a6d9219526..278a738b60f0f 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml @@ -16,5 +16,10 @@ + + + + + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml new file mode 100644 index 0000000000000..2c061e54f5509 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminAttributeTextSwatchesCanBeFiledTest.xml @@ -0,0 +1,116 @@ + + + + + + + + + + <description value="Check that attribute text swatches can be filed"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-96710"/> + <useCaseId value="MAGETWO-96409"/> + <group value="backend"/> + <group value="ui"/> + </annotations> + <before> + + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + + </before> + <after> + <!-- Delete all 10 store views --> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView1"> + <argument name="customStore" value="customStore"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView2"> + <argument name="customStore" value="NewStoreViewData"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView3"> + <argument name="customStore" value="storeViewData"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView4"> + <argument name="customStore" value="storeViewData1"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView5"> + <argument name="customStore" value="storeViewData2"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView6"> + <argument name="customStore" value="storeViewData3"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView7"> + <argument name="customStore" value="storeViewData4"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView8"> + <argument name="customStore" value="storeViewData5"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView9"> + <argument name="customStore" value="storeViewData6"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView10"> + <argument name="customStore" value="storeViewData7"/> + </actionGroup> + + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Create 10 store views --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView1"> + <argument name="customStore" value="customStore"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView2"> + <argument name="customStore" value="NewStoreViewData"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView3"> + <argument name="customStore" value="storeViewData"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView4"> + <argument name="customStore" value="storeViewData1"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView5"> + <argument name="customStore" value="storeViewData2"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView6"> + <argument name="customStore" value="storeViewData3"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView7"> + <argument name="customStore" value="storeViewData4"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView8"> + <argument name="customStore" value="storeViewData5"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView9"> + <argument name="customStore" value="storeViewData6"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView10"> + <argument name="customStore" value="storeViewData7"/> + </actionGroup> + + <!--Navigate to Product attribute page--> + <amOnPage url="{{ProductAttributePage.url}}" stepKey="navigateToNewProductAttributePage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField userInput="test_label" selector="{{AttributePropertiesSection.DefaultLabel}}" stepKey="fillDefaultLabel"/> + <selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="Text Swatch" stepKey="selectInputType"/> + <click selector="{{AttributePropertiesSection.addSwatch}}" stepKey="clickAddSwatch"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + + <!-- Fill Swatch and Description fields for Admin --> + <fillField selector="{{AttributeManageSwatchSection.swatchField('Admin')}}" userInput="test" stepKey="fillSwatchForAdmin"/> + <fillField selector="{{AttributeManageSwatchSection.descriptionField('Admin')}}" userInput="test" stepKey="fillDescriptionForAdmin"/> + + <!-- Grab value Swatch and Description fields for Admin --> + <grabValueFrom selector="{{AttributeManageSwatchSection.swatchField('Admin')}}" stepKey="grabSwatchForAdmin"/> + <grabValueFrom selector="{{AttributeManageSwatchSection.descriptionField('Admin')}}" stepKey="grabDescriptionForAdmin"/> + + <!-- Check that Swatch and Description fields for Admin are not empty--> + <assertNotEmpty actual="$grabSwatchForAdmin" stepKey="checkSwatchFieldForAdmin"/> + <assertNotEmpty actual="$grabDescriptionForAdmin" stepKey="checkDescriptionFieldForAdmin"/> + </test> +</tests> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml index 412513c59c63c..5cdfd6d4b41eb 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml @@ -6,7 +6,7 @@ */ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminOrderBraintreeFillActionGroup"> <!--Select Braintree Payment method on Admin Order Create Page--> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml index 9eaae8b33e73f..cbb065704fbc1 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/ConfigureBraintreeActionGroup.xml @@ -12,7 +12,7 @@ <!-- GoTo ConfigureBraintree fields --> <click stepKey="clickOnSTORES" selector="{{AdminMenuSection.stores}}"/> <waitForPageLoad stepKey="waitForConfiguration" time="2"/> - <click stepKey="clickOnConfigurations" selector="{{StoresSubmenuSection.configuration}}" /> + <click stepKey="clickOnConfigurations" selector="{{AdminMenuSection.configuration}}" /> <waitForPageLoad stepKey="waitForSales" time="2"/> <click stepKey="clickOnSales" selector="{{ConfigurationListSection.sales}}" /> <waitForPageLoad stepKey="waitForPaymentMethods" time="2"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminEditRoleInfoSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/AdminEditRoleInfoSection.xml deleted file mode 100644 index e37ce8f4738b3..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminEditRoleInfoSection.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> - <section name="AdminEditRoleInfoSection"> - <element name="roleName" type="input" selector="#role_name"/> - <element name="password" type="input" selector="#current_password"/> - <element name="roleResourcesTab" type="button" selector="#role_info_tabs_account"/> - <element name="backButton" type="button" selector="button[title='Back']"/> - <element name="resetButton" type="button" selector="button[title='Reset']"/> - <element name="deleteButton" type="button" selector="button[title='Delete Role']"/> - <element name="saveButton" type="button" selector="button[title='Save Role']"/> - <element name="message" type="text" selector=".modal-popup.confirm div.modal-content"/> - <element name="cancel" type="button" selector=".modal-popup.confirm button.action-dismiss"/> - <element name="ok" type="button" selector=".modal-popup.confirm button.action-accept" timeout="60"/> - </section> -</sections> \ No newline at end of file diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminEditUserRoleSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/AdminEditUserRoleSection.xml deleted file mode 100644 index e999413c96d74..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminEditUserRoleSection.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> - <section name="AdminEditUserRoleSection"> - <element name="usernameTextField" type="input" selector="#user_username"/> - <element name="roleNameFilterTextField" type="input" selector="#permissionsUserRolesGrid_filter_role_name"/> - <element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/> - <element name="resetButton" type="button" selector="button[title='Reset Filter']"/> - <element name="roleNameInFirstRow" type="text" selector=".col-role_name"/> - <element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/> - </section> -</sections> \ No newline at end of file diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminEditUserSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/AdminEditUserSection.xml deleted file mode 100644 index 2e5fcfb7b5c8d..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminEditUserSection.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> - <section name="AdminEditUserSection"> - <element name="system" type="input" selector="#menu-magento-backend-system"/> - <element name="allUsers" type="input" selector="//span[contains(text(), 'All Users')]"/> - <element name="create" type="input" selector="#add"/> - <element name="usernameTextField" type="input" selector="#user_username"/> - <element name="firstNameTextField" type="input" selector="#user_firstname"/> - <element name="lastNameTextField" type="input" selector="#user_lastname"/> - <element name="emailTextField" type="input" selector="#user_email"/> - <element name="passwordTextField" type="input" selector="#user_password"/> - <element name="pwConfirmationTextField" type="input" selector="#user_confirmation"/> - <element name="currentPasswordField" type="input" selector="#user_current_password"/> - <element name="userRoleTab" type="button" selector="#page_tabs_roles_section"/> - <element name="roleNameFilterTextField" type="input" selector="#permissionsUserRolesGrid_filter_role_name"/> - <element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/> - <element name="resetButton" type="button" selector="button[title='Reset Filter']"/> - <element name="roleNameInFirstRow" type="text" selector=".col-role_name"/> - <element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/> - <element name="saveButton" type="button" selector="#save"/> - </section> -</sections> \ No newline at end of file diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminMenuSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/AdminMenuSection.xml deleted file mode 100644 index eb7a9ce2c376e..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminMenuSection.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> - <section name="AdminMenuSection"> - <element name="dashboard" type="button" selector="//li[@id='menu-magento-backend-dashboard']"/> - <element name="sales" type="button" selector="//li[@id='menu-magento-sales-sales']"/> - <element name="catalog" type="button" selector="//li[@id='menu-magento-catalog-catalog']"/> - <element name="customers" type="button" selector="//li[@id='menu-magento-customer-customer']"/> - <element name="marketing" type="button" selector="//li[@id='menu-magento-backend-marketing']"/> - <element name="content" type="button" selector="//li[@id='menu-magento-backend-content']"/> - <element name="reports" type="button" selector="//li[@id='menu-magento-reports-report']"/> - <element name="stores" type="button" selector="//li[@id='menu-magento-backend-stores']"/> - <element name="system" type="button" selector="//li[@id='menu-magento-backend-system']"/> - <element name="findPartners" type="button" selector="//li[@id='menu-magento-marketplace-partners']"/> - </section> -</sections> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminRoleGridSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/AdminRoleGridSection.xml deleted file mode 100644 index 63cbadc71d3d3..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminRoleGridSection.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> - <section name="AdminRoleGridSection"> - <element name="idFilterTextField" type="input" selector="#roleGrid_filter_role_id"/> - <element name="roleNameFilterTextField" type="input" selector="#roleGrid_filter_role_name"/> - <element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/> - <element name="resetButton" type="button" selector="button[title='Reset Filter']"/> - <element name="roleNameInFirstRow" type="text" selector=".col-role_name"/> - <element name="searchResultFirstRow" type="text" selector=".data-grid>tbody>tr"/> - </section> -</sections> \ No newline at end of file diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/BraintreeConfiguraionSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/BraintreeConfiguraionSection.xml index 016af2e102744..98dc849644fe9 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/BraintreeConfiguraionSection.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Section/BraintreeConfiguraionSection.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="BraintreeConfiguraionSection"> <element name="titleForBraintreeSettings" type="input" selector="//input[@id='payment_us_braintree_section_braintree_braintree_required_title']"/> <element name="environment" type="select" selector="//select[@id='payment_us_braintree_section_braintree_braintree_required_environment']"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/ConfigurationPaymentSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/ConfigurationPaymentSection.xml index 885a45be721f1..8632dc62cd19d 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/ConfigurationPaymentSection.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Section/ConfigurationPaymentSection.xml @@ -7,8 +7,8 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> - <section name="ConfigurationPaymentSection"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="ConfigurationPaymentSection"> <element name="configureButton" type="button" selector="//button[@id='payment_us_braintree_section_braintree-head']"/> </section> </sections> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/StoresSubmenuSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/StoresSubmenuSection.xml deleted file mode 100644 index f094baa9f3446..0000000000000 --- a/app/code/Magento/Braintree/Test/Mftf/Section/StoresSubmenuSection.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> - <section name="StoresSubmenuSection"> - <element name="configuration" type="button" selector="//li[@id='menu-magento-backend-stores']//li[@data-ui-id='menu-magento-config-system-config']"/> - </section> -</sections> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml index 2ddefa40b536c..35d03d69b662f 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml @@ -74,8 +74,8 @@ <actionGroup ref="useBraintreeForMasterCard" stepKey="selectCardWithBraintree"/> <click stepKey="submitOrder" selector="{{NewOrderSection.submitOrder}}"/> - <waitForPageLoad stepKey="waitForSaveConfig" time="5"/> - <waitForElementVisible selector="{{NewOrderSection.successMessage}}" stepKey="waitForSuccessMessage" time="1"/> + <waitForPageLoad stepKey="waitForSaveConfig"/> + <waitForElementVisible selector="{{NewOrderSection.successMessage}}" stepKey="waitForSuccessMessage"/> <after> <!-- Disable BrainTree --> diff --git a/app/code/Magento/Catalog/Api/CategoryLinkRepositoryInterface.php b/app/code/Magento/Catalog/Api/CategoryLinkRepositoryInterface.php index 34656d522a72c..a65355c690923 100644 --- a/app/code/Magento/Catalog/Api/CategoryLinkRepositoryInterface.php +++ b/app/code/Magento/Catalog/Api/CategoryLinkRepositoryInterface.php @@ -39,7 +39,7 @@ public function delete(\Magento\Catalog\Api\Data\CategoryProductLinkInterface $p /** * Remove the product assignment from the category by category id and sku * - * @param string $categoryId + * @param int $categoryId * @param string $sku * @return bool will returned True if products successfully deleted * diff --git a/app/code/Magento/Catalog/Api/Data/ProductRender/PriceInfoInterface.php b/app/code/Magento/Catalog/Api/Data/ProductRender/PriceInfoInterface.php index 2ef4d068317dd..9768b3c08c8ab 100644 --- a/app/code/Magento/Catalog/Api/Data/ProductRender/PriceInfoInterface.php +++ b/app/code/Magento/Catalog/Api/Data/ProductRender/PriceInfoInterface.php @@ -8,6 +8,7 @@ /** * Price interface. + * * @api * @since 101.1.0 */ @@ -23,6 +24,7 @@ public function getFinalPrice(); /** * Set the final price: usually it calculated as minimal price of the product + * * Can be different depends on type of product * * @param float $finalPrice @@ -33,6 +35,7 @@ public function setFinalPrice($finalPrice); /** * Retrieve max price of a product + * * E.g. for product with custom options is price with the most expensive custom option * * @return float @@ -51,6 +54,7 @@ public function setMaxPrice($maxPrice); /** * Set max regular price + * * Max regular price is the same, as maximum price, except of excluding calculating special price and catalog rules * in it * @@ -105,6 +109,8 @@ public function setSpecialPrice($specialPrice); public function getSpecialPrice(); /** + * Retrieve minimal price + * * @return float * @since 101.1.0 */ @@ -129,6 +135,7 @@ public function getRegularPrice(); /** * Regular price - is price of product without discounts and special price with taxes and fixed product tax + * * Usually this price is corresponding to price in admin panel of product * * @param float $regularPrice @@ -148,7 +155,7 @@ public function getFormattedPrices(); /** * Set dto with formatted prices * - * @param string[] $formattedPriceInfo + * @param FormattedPriceInfoInterface $formattedPriceInfo * @return void * @since 101.1.0 */ diff --git a/app/code/Magento/Catalog/Api/Data/ProductRenderInterface.php b/app/code/Magento/Catalog/Api/Data/ProductRenderInterface.php index 910168d8854e7..166a1aba76b61 100644 --- a/app/code/Magento/Catalog/Api/Data/ProductRenderInterface.php +++ b/app/code/Magento/Catalog/Api/Data/ProductRenderInterface.php @@ -30,7 +30,7 @@ public function getAddToCartButton(); /** * Set information needed for render "Add To Cart" button on front * - * @param \Magento\Catalog\Api\Data\ProductRender\ButtonInterface $addToCartData + * @param ButtonInterface $cartAddToCartButton * @return void * @since 101.1.0 */ @@ -47,7 +47,7 @@ public function getAddToCompareButton(); /** * Set information needed for render "Add To Compare" button on front * - * @param ButtonInterface $compareUrlData + * @param ButtonInterface $compareButton * @return string * @since 101.1.0 */ @@ -55,6 +55,7 @@ public function setAddToCompareButton(ButtonInterface $compareButton); /** * Provide information needed for render prices and adjustments for different product types on front + * * Prices are represented in raw format and in current currency * * @return \Magento\Catalog\Api\Data\ProductRender\PriceInfoInterface @@ -73,6 +74,7 @@ public function setPriceInfo(PriceInfoInterface $priceInfo); /** * Provide enough information, that needed to render image on front + * * Images can be separated by image codes * * @return \Magento\Catalog\Api\Data\ProductRender\ImageInterface[] @@ -167,6 +169,7 @@ public function getIsSalable(); /** * Set information about product saleability (Stock, other conditions) + * * Is used to provide information to frontend JS renders * You can add plugin, in order to hide product on product page or product list on front * @@ -178,6 +181,7 @@ public function setIsSalable($isSalable); /** * Provide information about current store id or requested store id + * * Product should be assigned to provided store id * This setting affect store scope attributes * @@ -197,6 +201,7 @@ public function setStoreId($storeId); /** * Provide current or desired currency code to product + * * This setting affect formatted prices* * * @return string diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php index 1f74969c3d169..7f80aece60ee0 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php @@ -4,15 +4,15 @@ * See COPYING.txt for license details. */ +namespace Magento\Catalog\Block\Adminhtml\Product\Frontend\Product; + +use Magento\Framework\Data\Form\Element\AbstractElement; + /** * Fieldset config form element renderer * * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Catalog\Block\Adminhtml\Product\Frontend\Product; - -use Magento\Framework\Data\Form\Element\AbstractElement; - class Watermark extends \Magento\Backend\Block\AbstractBlock implements \Magento\Framework\Data\Form\Element\Renderer\RendererInterface { @@ -60,6 +60,8 @@ public function __construct( } /** + * Render form element as HTML + * * @param AbstractElement $element * @return string */ @@ -124,13 +126,14 @@ public function render(AbstractElement $element) } /** + * Get header html for render + * * @param AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedLocalVariable) */ protected function _getHeaderHtml($element) { - $id = $element->getHtmlId(); $default = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store'); $html = '<h4 class="icon-head head-edit-form">' . $element->getLegend() . '</h4>'; @@ -148,6 +151,8 @@ protected function _getHeaderHtml($element) } /** + * Get footer html for render + * * @param AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Rss/NotifyStock.php b/app/code/Magento/Catalog/Block/Adminhtml/Rss/NotifyStock.php index ac1fd8c692ed2..c296a5aa0dbbd 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Rss/NotifyStock.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Rss/NotifyStock.php @@ -9,6 +9,7 @@ /** * Class NotifyStock + * * @package Magento\Catalog\Block\Adminhtml\Rss */ class NotifyStock extends \Magento\Backend\Block\AbstractBlock implements DataProviderInterface @@ -41,7 +42,7 @@ public function __construct( } /** - * @return void + * @inheritdoc */ protected function _construct() { @@ -50,12 +51,12 @@ protected function _construct() } /** - * {@inheritdoc} + * @inheritdoc */ public function getRssData() { - $newUrl = $this->rssUrlBuilder->getUrl(['_secure' => true, '_nosecret' => true, 'type' => 'notifystock']); - $title = __('Low Stock Products'); + $newUrl = $this->rssUrlBuilder->getUrl(['_secure' => true, '_nosecret' => true, 'type' => 'notifystock']); + $title = __('Low Stock Products')->render(); $data = ['title' => $title, 'description' => $title, 'link' => $newUrl, 'charset' => 'UTF-8']; foreach ($this->rssModel->getProductsCollection() as $item) { @@ -65,7 +66,7 @@ public function getRssData() ['id' => $item->getId(), '_secure' => true, '_nosecret' => true] ); $qty = 1 * $item->getQty(); - $description = __('%1 has reached a quantity of %2.', $item->getName(), $qty); + $description = __('%1 has reached a quantity of %2.', $item->getName(), $qty)->render(); $data['entries'][] = ['title' => $item->getName(), 'link' => $url, 'description' => $description]; } @@ -73,7 +74,7 @@ public function getRssData() } /** - * {@inheritdoc} + * @inheritdoc */ public function getCacheLifetime() { @@ -81,7 +82,7 @@ public function getCacheLifetime() } /** - * {@inheritdoc} + * @inheritdoc */ public function isAllowed() { @@ -89,7 +90,7 @@ public function isAllowed() } /** - * {@inheritdoc} + * @inheritdoc */ public function getFeeds() { @@ -97,7 +98,7 @@ public function getFeeds() } /** - * {@inheritdoc} + * @inheritdoc */ public function isAuthRequired() { diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php index ba6bfddca9c6c..082101ff07826 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php @@ -8,6 +8,9 @@ use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; +/** + * Move category admin controller + */ class Move extends \Magento\Catalog\Controller\Adminhtml\Category implements HttpPostActionInterface { /** @@ -46,7 +49,7 @@ public function __construct( /** * Move category action * - * @return \Magento\Framework\Controller\Result\Raw + * @return \Magento\Framework\Controller\Result\Json */ public function execute() { diff --git a/app/code/Magento/Catalog/Controller/Index/Index.php b/app/code/Magento/Catalog/Controller/Index/Index.php index eae3325df9fc2..bd00c97204996 100644 --- a/app/code/Magento/Catalog/Controller/Index/Index.php +++ b/app/code/Magento/Catalog/Controller/Index/Index.php @@ -5,12 +5,17 @@ */ namespace Magento\Catalog\Controller\Index; -class Index extends \Magento\Framework\App\Action\Action +use Magento\Framework\App\Action\HttpGetActionInterface; + +/** + * Catalog index page controller. + */ +class Index extends \Magento\Framework\App\Action\Action implements HttpGetActionInterface { /** * Index action * - * @return $this + * @return \Magento\Framework\Controller\Result\Redirect */ public function execute() { diff --git a/app/code/Magento/Catalog/Helper/Product/Configuration.php b/app/code/Magento/Catalog/Helper/Product/Configuration.php index 9b47e29900992..5b8f6fad6e18a 100644 --- a/app/code/Magento/Catalog/Helper/Product/Configuration.php +++ b/app/code/Magento/Catalog/Helper/Product/Configuration.php @@ -55,6 +55,7 @@ class Configuration extends AbstractHelper implements ConfigurationInterface * @param \Magento\Framework\Filter\FilterManager $filter * @param \Magento\Framework\Stdlib\StringUtils $string * @param Json $serializer + * @param Escaper $escaper */ public function __construct( \Magento\Framework\App\Helper\Context $context, diff --git a/app/code/Magento/Catalog/Helper/Product/ProductList.php b/app/code/Magento/Catalog/Helper/Product/ProductList.php index fbea73a6324de..3aa6aeed3779a 100644 --- a/app/code/Magento/Catalog/Helper/Product/ProductList.php +++ b/app/code/Magento/Catalog/Helper/Product/ProductList.php @@ -42,6 +42,7 @@ class ProductList /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig + * @param \Magento\Framework\Registry $coreRegistry */ public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, diff --git a/app/code/Magento/Catalog/Helper/Product/View.php b/app/code/Magento/Catalog/Helper/Product/View.php index 1509e489aee3b..74f40a18971d5 100644 --- a/app/code/Magento/Catalog/Helper/Product/View.php +++ b/app/code/Magento/Catalog/Helper/Product/View.php @@ -10,7 +10,9 @@ /** * Catalog category helper + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class View extends \Magento\Framework\App\Helper\AbstractHelper { @@ -105,7 +107,7 @@ public function __construct( * * @param \Magento\Framework\View\Result\Page $resultPage * @param \Magento\Catalog\Model\Product $product - * @return \Magento\Framework\View\Result\Page + * @return $this */ private function preparePageMetadata(ResultPage $resultPage, $product) { diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php index a218266c25034..cb708695255d4 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php @@ -17,6 +17,8 @@ use Magento\Store\Model\StoreManagerInterface; /** + * Category rows indexer. + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Rows extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractAction @@ -213,6 +215,7 @@ protected function isRangingNeeded() /** * Returns a list of category ids which are assigned to product ids in the index * + * @param array $productIds * @return \Magento\Framework\Indexer\CacheContext */ private function getCategoryIdsFromIndex(array $productIds) diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Indexer.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Indexer.php index a669fb73f64fc..c14bc0dd7e507 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Indexer.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Indexer.php @@ -54,7 +54,7 @@ public function __construct( * @param int $storeId * @param int $productId * @param string $valueFieldSuffix - * @return \Magento\Catalog\Model\Indexer\Product\Flat + * @return $this * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) * @SuppressWarnings(PHPMD.NPathComplexity) diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Decimal.php b/app/code/Magento/Catalog/Model/Layer/Filter/Decimal.php index dac2632ff6db8..d76711cb21dbf 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Decimal.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Decimal.php @@ -32,8 +32,8 @@ class Decimal extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Layer $layer * @param \Magento\Catalog\Model\Layer\Filter\Item\DataBuilder $itemDataBuilder - * @param \Magento\Catalog\Model\ResourceModel\Layer\Filter\DecimalFactory $filterDecimalFactory * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency + * @param \Magento\Catalog\Model\Layer\Filter\DataProvider\DecimalFactory $dataProviderFactory * @param array $data */ public function __construct( diff --git a/app/code/Magento/Catalog/Model/Plugin/ProductRepository/TransactionWrapper.php b/app/code/Magento/Catalog/Model/Plugin/ProductRepository/TransactionWrapper.php index c88215d92357e..f51b2e4f90a64 100644 --- a/app/code/Magento/Catalog/Model/Plugin/ProductRepository/TransactionWrapper.php +++ b/app/code/Magento/Catalog/Model/Plugin/ProductRepository/TransactionWrapper.php @@ -7,6 +7,9 @@ */ namespace Magento\Catalog\Model\Plugin\ProductRepository; +/** + * Transaction wrapper for product repository CRUD. + */ class TransactionWrapper { /** @@ -24,8 +27,10 @@ public function __construct( } /** + * Transaction wrapper for save action. + * * @param \Magento\Catalog\Api\ProductRepositoryInterface $subject - * @param callable $proceed + * @param \Closure $proceed * @param \Magento\Catalog\Api\Data\ProductInterface $product * @param bool $saveOptions * @return \Magento\Catalog\Api\Data\ProductInterface @@ -51,8 +56,10 @@ public function aroundSave( } /** + * Transaction wrapper for delete action. + * * @param \Magento\Catalog\Api\ProductRepositoryInterface $subject - * @param callable $proceed + * @param \Closure $proceed * @param \Magento\Catalog\Api\Data\ProductInterface $product * @return bool * @throws \Exception @@ -76,8 +83,10 @@ public function aroundDelete( } /** + * Transaction wrapper for delete by id action. + * * @param \Magento\Catalog\Api\ProductRepositoryInterface $subject - * @param callable $proceed + * @param \Closure $proceed * @param string $productSku * @return bool * @throws \Exception diff --git a/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php b/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php index b19906ecd6cc9..2b4739ebeb736 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Type/Date.php @@ -12,6 +12,7 @@ * Catalog product option date type * * @author Magento Core Team <core@magentocommerce.com> + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class Date extends \Magento\Catalog\Model\Product\Option\Type\DefaultType { @@ -147,7 +148,6 @@ public function validateUserValue($values) public function prepareForCart() { if ($this->getIsValid() && $this->getUserValue() !== null) { - $option = $this->getOption(); $value = $this->getUserValue(); if (isset($value['date_internal']) && $value['date_internal'] != '') { diff --git a/app/code/Magento/Catalog/Model/Product/Website/ReadHandler.php b/app/code/Magento/Catalog/Model/Product/Website/ReadHandler.php index e81cdedd6d370..8acb4a6593a4c 100644 --- a/app/code/Magento/Catalog/Model/Product/Website/ReadHandler.php +++ b/app/code/Magento/Catalog/Model/Product/Website/ReadHandler.php @@ -9,6 +9,9 @@ use Magento\Catalog\Model\ResourceModel\Product\Website\Link as ProductWebsiteLink; use Magento\Framework\EntityManager\Operation\ExtensionInterface; +/** + * Add websites ids to product extension attributes. + */ class ReadHandler implements ExtensionInterface { /** @@ -18,7 +21,7 @@ class ReadHandler implements ExtensionInterface /** * ReadHandler constructor. - * @param ProductWebsiteLink $resourceModel + * @param ProductWebsiteLink $productWebsiteLink */ public function __construct( ProductWebsiteLink $productWebsiteLink @@ -27,6 +30,8 @@ public function __construct( } /** + * Add website ids to product extension attributes, if no set. + * * @param ProductInterface $product * @param array $arguments * @SuppressWarnings(PHPMD.UnusedFormalParameter) diff --git a/app/code/Magento/Catalog/Model/ProductRender.php b/app/code/Magento/Catalog/Model/ProductRender.php index 702c04b910d44..5efb0343cd99b 100644 --- a/app/code/Magento/Catalog/Model/ProductRender.php +++ b/app/code/Magento/Catalog/Model/ProductRender.php @@ -206,7 +206,7 @@ public function getExtensionAttributes() * Set an extension attributes object. * * @param \Magento\Catalog\Api\Data\ProductRenderExtensionInterface $extensionAttributes - * @return $this + * @return void */ public function setExtensionAttributes( \Magento\Catalog\Api\Data\ProductRenderExtensionInterface $extensionAttributes diff --git a/app/code/Magento/Catalog/Model/ProductRender/Image.php b/app/code/Magento/Catalog/Model/ProductRender/Image.php index 774199a0dbf0a..5e024938d37ea 100644 --- a/app/code/Magento/Catalog/Model/ProductRender/Image.php +++ b/app/code/Magento/Catalog/Model/ProductRender/Image.php @@ -9,14 +9,16 @@ use Magento\Catalog\Api\Data\ProductRender\ImageInterface; /** - * @inheritdoc + * Product image renderer model. */ class Image extends \Magento\Framework\Model\AbstractExtensibleModel implements ImageInterface { /** + * Set url to image. + * * @param string $url - * @return @return void + * @return void */ public function setUrl($url) { @@ -34,6 +36,8 @@ public function getUrl() } /** + * Retrieve image code. + * * @return string */ public function getCode() @@ -42,6 +46,8 @@ public function getCode() } /** + * Set image code. + * * @param string $code * @return void */ @@ -51,6 +57,8 @@ public function setCode($code) } /** + * Set image height. + * * @param string $height * @return void */ @@ -60,6 +68,8 @@ public function setHeight($height) } /** + * Retrieve image height. + * * @return float */ public function getHeight() @@ -68,6 +78,8 @@ public function getHeight() } /** + * Retrieve image width. + * * @return float */ public function getWidth() @@ -76,6 +88,8 @@ public function getWidth() } /** + * Set image width. + * * @param string $width * @return void */ @@ -85,6 +99,8 @@ public function setWidth($width) } /** + * Retrieve image label. + * * @return string */ public function getLabel() @@ -93,6 +109,8 @@ public function getLabel() } /** + * Set image label. + * * @param string $label * @return void */ @@ -102,6 +120,8 @@ public function setLabel($label) } /** + * Retrieve image width after image resize. + * * @return float */ public function getResizedWidth() @@ -110,6 +130,8 @@ public function getResizedWidth() } /** + * Set image width after image resize. + * * @param string $width * @return void */ @@ -119,6 +141,8 @@ public function setResizedWidth($width) } /** + * Set image height after image resize. + * * @param string $height * @return void */ @@ -128,6 +152,8 @@ public function setResizedHeight($height) } /** + * Retrieve image height after image resize. + * * @return float */ public function getResizedHeight() @@ -149,7 +175,7 @@ public function getExtensionAttributes() * Set an extension attributes object. * * @param \Magento\Catalog\Api\Data\ProductRender\ImageExtensionInterface $extensionAttributes - * @return $this + * @return void */ public function setExtensionAttributes( \Magento\Catalog\Api\Data\ProductRender\ImageExtensionInterface $extensionAttributes diff --git a/app/code/Magento/Catalog/Model/ProductRenderList.php b/app/code/Magento/Catalog/Model/ProductRenderList.php index a3d906cf10c15..d1f60c098630e 100644 --- a/app/code/Magento/Catalog/Model/ProductRenderList.php +++ b/app/code/Magento/Catalog/Model/ProductRenderList.php @@ -17,8 +17,8 @@ /** * Provide product render information (this information should be enough for rendering product on front) - * for one or few products * + * Render information provided for one or few products */ class ProductRenderList implements ProductRenderListInterface { @@ -64,7 +64,6 @@ class ProductRenderList implements ProductRenderListInterface * @param ProductRenderSearchResultsFactory $searchResultFactory * @param ProductRenderFactory $productRenderDtoFactory * @param Config $config - * @param Product\Visibility $productVisibility * @param CollectionModifier $collectionModifier * @param array $productAttributes */ diff --git a/app/code/Magento/Catalog/Model/ResourceModel/AbstractCollection.php b/app/code/Magento/Catalog/Model/ResourceModel/AbstractCollection.php index d4f5fdd5137c1..2896849b76cce 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/AbstractCollection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/AbstractCollection.php @@ -7,6 +7,7 @@ /** * Flat abstract collection + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class AbstractCollection extends \Magento\Framework\Model\ResourceModel\Db\VersionControl\Collection @@ -34,7 +35,7 @@ public function setSelectCountSql(\Magento\Framework\DB\Select $countSelect) } /** - * get select count sql + * Get select count sql * * @return \Magento\Framework\DB\Select */ @@ -69,6 +70,7 @@ protected function _attributeToField($attribute) /** * Add attribute to select result set. + * * Backward compatibility with EAV collection * * @param string $attribute @@ -82,6 +84,7 @@ public function addAttributeToSelect($attribute) /** * Specify collection select filter by attribute value + * * Backward compatibility with EAV collection * * @param string|\Magento\Eav\Model\Entity\Attribute $attribute @@ -96,6 +99,7 @@ public function addAttributeToFilter($attribute, $condition = null) /** * Specify collection select order by attribute value + * * Backward compatibility with EAV collection * * @param string $attribute @@ -110,6 +114,7 @@ public function addAttributeToSort($attribute, $dir = 'asc') /** * Set collection page start and records to show + * * Backward compatibility with EAV collection * * @param int $pageNum @@ -124,11 +129,12 @@ public function setPage($pageNum, $pageSize) /** * Create all ids retrieving select with limitation + * * Backward compatibility with EAV collection * * @param int $limit * @param int $offset - * @return \Magento\Eav\Model\Entity\Collection\AbstractCollection + * @return \Magento\Framework\DB\Select */ protected function _getAllIdsSelect($limit = null, $offset = null) { @@ -144,6 +150,7 @@ protected function _getAllIdsSelect($limit = null, $offset = null) /** * Retrieve all ids for collection + * * Backward compatibility with EAV collection * * @param int $limit diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category.php b/app/code/Magento/Catalog/Model/ResourceModel/Category.php index 90f55cd44bdb9..536fda7e093d3 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category.php @@ -200,7 +200,7 @@ protected function _getTree() * delete child categories * * @param \Magento\Framework\DataObject $object - * @return $this + * @return void */ protected function _beforeDelete(\Magento\Framework\DataObject $object) { diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php index c33ea7c781aa3..e024f0d30f1dc 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php @@ -24,13 +24,11 @@ abstract class AbstractEav extends \Magento\Catalog\Model\ResourceModel\Product\ protected $_eventManager = null; /** - * AbstractEav constructor. * @param \Magento\Framework\Model\ResourceModel\Db\Context $context * @param \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param null $connectionName - * @param \Magento\Indexer\Model\Indexer\StateFactory|null $stateFactory + * @param string $connectionName */ public function __construct( \Magento\Framework\Model\ResourceModel\Db\Context $context, @@ -70,7 +68,6 @@ public function reindexAll() /** * Rebuild index data by entities * - * * @param int|array $processIds * @return $this * @throws \Exception @@ -88,8 +85,8 @@ public function reindexEntities($processIds) /** * Rebuild index data by attribute id - * If attribute is not indexable remove data by attribute * + * If attribute is not indexable remove data by attribute * * @param int $attributeId * @param bool $isIndexable @@ -245,7 +242,8 @@ protected function _prepareRelationIndex($parentIds = null) /** * Retrieve condition for retrieve indexable attribute select - * the catalog/eav_attribute table must have alias is ca + * + * The catalog/eav_attribute table must have alias is ca * * @return string */ diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php index 0005ac8dea58a..95fecc832fa26 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php @@ -16,6 +16,7 @@ /** * Prepare base select for Product Price index limited by specified dimensions: website and customer group + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class BaseFinalPrice @@ -66,10 +67,11 @@ class BaseFinalPrice private $metadataPool; /** - * BaseFinalPrice constructor. * @param \Magento\Framework\App\ResourceConnection $resource * @param JoinAttributeProcessor $joinAttributeProcessor * @param \Magento\Framework\Module\Manager $moduleManager + * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool * @param string $connectionName */ public function __construct( @@ -89,6 +91,8 @@ public function __construct( } /** + * Build query for base final price. + * * @param Dimension[] $dimensions * @param string $productType * @param array $entityIds @@ -285,7 +289,7 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression) /** * Get tier price expression for table * - * @param $tableAlias + * @param string $tableAlias * @param \Zend_Db_Expr $priceExpression * @return \Zend_Db_Expr */ @@ -305,7 +309,7 @@ private function getTierPriceExpressionForTable($tableAlias, \Zend_Db_Expr $pric /** * Get connection * - * return \Magento\Framework\DB\Adapter\AdapterInterface + * @return \Magento\Framework\DB\Adapter\AdapterInterface * @throws \DomainException */ private function getConnection(): \Magento\Framework\DB\Adapter\AdapterInterface diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/TemporaryTableStrategy.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/TemporaryTableStrategy.php index 54673cb01bb1d..89daab2885970 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/TemporaryTableStrategy.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/TemporaryTableStrategy.php @@ -30,7 +30,7 @@ class TemporaryTableStrategy implements \Magento\Framework\Indexer\Table\Strateg /** * TemporaryTableStrategy constructor. - * @param \Magento\Framework\Indexer\Table\Strategy $strategy + * @param \Magento\Framework\Indexer\Table\StrategyInterface $strategy * @param \Magento\Framework\App\ResourceConnection $resource */ public function __construct( @@ -66,9 +66,10 @@ public function getTableName($tablePrefix) } /** - * Create temporary index table based on memory table + * Create temporary index table based on memory table{@inheritdoc} * - * {@inheritdoc} + * @param string $tablePrefix + * @return string */ public function prepareTableName($tablePrefix) { diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/DeleteHandler.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/DeleteHandler.php index 024c87c9fc886..a554ff2641dfe 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/DeleteHandler.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/DeleteHandler.php @@ -60,9 +60,11 @@ public function __construct( } /** + * Delete linked product. + * * @param string $entityType * @param object $entity - * @return object + * @return void * @throws CouldNotDeleteException * @throws NoSuchEntityException * @SuppressWarnings(PHPMD.UnusedFormalParameter) diff --git a/app/code/Magento/Catalog/Model/Rss/Category.php b/app/code/Magento/Catalog/Model/Rss/Category.php index a58569d1b59d7..653d86b177a52 100644 --- a/app/code/Magento/Catalog/Model/Rss/Category.php +++ b/app/code/Magento/Catalog/Model/Rss/Category.php @@ -6,8 +6,7 @@ namespace Magento\Catalog\Model\Rss; /** - * Class Category - * @package Magento\Catalog\Model\Rss + * Rss Category model. */ class Category { @@ -42,9 +41,11 @@ public function __construct( } /** + * Get products for given category. + * * @param \Magento\Catalog\Model\Category $category * @param int $storeId - * @return $this + * @return \Magento\Catalog\Model\ResourceModel\Product\Collection */ public function getProductCollection(\Magento\Catalog\Model\Category $category, $storeId) { diff --git a/app/code/Magento/Catalog/Model/Template/Filter.php b/app/code/Magento/Catalog/Model/Template/Filter.php index 1eb30ff95a40b..8cd61415b958a 100644 --- a/app/code/Magento/Catalog/Model/Template/Filter.php +++ b/app/code/Magento/Catalog/Model/Template/Filter.php @@ -66,7 +66,7 @@ public function __construct( * Set use absolute links flag * * @param bool $flag - * @return \Magento\Email\Model\Template\Filter + * @return $this */ public function setUseAbsoluteLinks($flag) { @@ -76,10 +76,11 @@ public function setUseAbsoluteLinks($flag) /** * Setter whether SID is allowed in store directive + * * Doesn't set anything intentionally, since SID is not allowed in any kind of emails * * @param bool $flag - * @return \Magento\Email\Model\Template\Filter + * @return $this */ public function setUseSessionInUrl($flag) { @@ -132,6 +133,7 @@ public function mediaDirective($construction) /** * Retrieve store URL directive + * * Support url and direct_url properties * * @param array $construction diff --git a/app/code/Magento/Catalog/Plugin/Model/ResourceModel/Config.php b/app/code/Magento/Catalog/Plugin/Model/ResourceModel/Config.php index dfa06b6ebe6c8..b942f5570f57d 100644 --- a/app/code/Magento/Catalog/Plugin/Model/ResourceModel/Config.php +++ b/app/code/Magento/Catalog/Plugin/Model/ResourceModel/Config.php @@ -8,6 +8,9 @@ use Magento\Framework\App\ObjectManager; use Magento\Framework\Serialize\SerializerInterface; +/** + * Config cache plugin. + */ class Config { /**#@+ @@ -46,8 +49,10 @@ public function __construct( } /** + * Cache attribute used in listing. + * * @param \Magento\Catalog\Model\ResourceModel\Config $config - * @param callable $proceed + * @param \Closure $proceed * @return array */ public function aroundGetAttributesUsedInListing( @@ -73,8 +78,10 @@ public function aroundGetAttributesUsedInListing( } /** + * Cache attributes used for sorting. + * * @param \Magento\Catalog\Model\ResourceModel\Config $config - * @param callable $proceed + * @param \Closure $proceed * @return array */ public function aroundGetAttributesUsedForSortBy( diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/CreateNewProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateNewProductActionGroup.xml similarity index 84% rename from app/code/Magento/Braintree/Test/Mftf/ActionGroup/CreateNewProductActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateNewProductActionGroup.xml index 19de3e859ae9a..bad5eec86bc90 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/CreateNewProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/CreateNewProductActionGroup.xml @@ -6,8 +6,8 @@ */ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> - <actionGroup name="CreateNewProductActionGroup"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CreateNewProductActionGroup"> <click stepKey="openCatalog" selector="{{AdminMenuSection.catalog}}"/> <waitForPageLoad stepKey="waitForCatalogSubmenu" time="5"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/DeleteProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductActionGroup.xml similarity index 86% rename from app/code/Magento/Braintree/Test/Mftf/ActionGroup/DeleteProductActionGroup.xml rename to app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductActionGroup.xml index 724c6d92846c4..d6f9d03271f55 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/DeleteProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/DeleteProductActionGroup.xml @@ -6,7 +6,7 @@ */ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="DeleteProductActionGroup"> <arguments> <argument name="productName" defaultValue=""/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Data/NewProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/NewProductData.xml similarity index 66% rename from app/code/Magento/Braintree/Test/Mftf/Data/NewProductData.xml rename to app/code/Magento/Catalog/Test/Mftf/Data/NewProductData.xml index 72661ae94076f..ff13217cbcb53 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Data/NewProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/NewProductData.xml @@ -7,7 +7,7 @@ --> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="NewProductData" type="braintree_config_state"> <data key="ProductName">ProductTest</data> <data key="Price">100</data> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml index 324f261f3a50a..05be20b14acc0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml @@ -22,6 +22,11 @@ <element name="TinyMCE4" type="button" selector="//span[text()='Default Value']/parent::label/following-sibling::div//div[@class='mce-branding-powered-by']"/> <element name="checkIfTabOpen" selector="//div[@id='advanced_fieldset-wrapper' and not(contains(@class,'opened'))]" type="button"/> <element name="useInLayeredNavigation" type="select" selector="#is_filterable"/> + <element name="addSwatch" type="button" selector="#add_new_swatch_text_option_button"/> + </section> + <section name="AttributeManageSwatchSection"> + <element name="swatchField" type="input" selector="//th[contains(@class, 'col-swatch')]/span[contains(text(), '{{arg}}')]/ancestor::thead/following-sibling::tbody//input[@placeholder='Swatch']" parameterized="true"/> + <element name="descriptionField" type="input" selector="//th[contains(@class, 'col-swatch')]/span[contains(text(), '{{arg}}')]/ancestor::thead/following-sibling::tbody//input[@placeholder='Description']" parameterized="true"/> </section> <section name="AttributeOptionsSection"> <element name="AddOption" type="button" selector="#add_new_option_button"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/CatalogSubmenuSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/CatalogSubmenuSection.xml similarity index 68% rename from app/code/Magento/Braintree/Test/Mftf/Section/CatalogSubmenuSection.xml rename to app/code/Magento/Catalog/Test/Mftf/Section/CatalogSubmenuSection.xml index 32f02a69f817e..84a81c5204acc 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/CatalogSubmenuSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/CatalogSubmenuSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="CatalogSubmenuSection"> <element name="products" type="button" selector="//li[@id='menu-magento-catalog-catalog']//li[@data-ui-id='menu-magento-catalog-catalog-products']"/> </section> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/NewProductPageSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/NewProductPageSection.xml similarity index 81% rename from app/code/Magento/Braintree/Test/Mftf/Section/NewProductPageSection.xml rename to app/code/Magento/Catalog/Test/Mftf/Section/NewProductPageSection.xml index 42e451940c91b..b98bd47b54132 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/NewProductPageSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/NewProductPageSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="NewProductPageSection"> <element name="productName" type="input" selector="//input[@name='product[name]']"/> <element name="sku" type="input" selector="//input[@name='product[sku]']"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/ProductsPageSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/ProductsPageSection.xml similarity index 84% rename from app/code/Magento/Braintree/Test/Mftf/Section/ProductsPageSection.xml rename to app/code/Magento/Catalog/Test/Mftf/Section/ProductsPageSection.xml index 267efdf3d0e5e..6cf56f7baacae 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/ProductsPageSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/ProductsPageSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="ProductsPageSection"> <element name="addProductButton" type="button" selector="//button[@id='add_new_product-button']"/> <element name="checkboxForProduct" type="button" selector="//*[contains(text(),'{{args}}')]/parent::td/preceding-sibling::td/label[@class='data-grid-checkbox-cell-inner']" parameterized="true"/> diff --git a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Rss/NotifyStockTest.php b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Rss/NotifyStockTest.php index 1dd866f1fe2ca..da35d845468d5 100644 --- a/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Rss/NotifyStockTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Block/Adminhtml/Rss/NotifyStockTest.php @@ -96,7 +96,12 @@ public function testGetRssData() $this->urlBuilder->expects($this->once())->method('getUrl') ->with('catalog/product/edit', ['id' => 1, '_secure' => true, '_nosecret' => true]) ->will($this->returnValue('http://magento.com/catalog/product/edit/id/1')); - $this->assertEquals($this->rssFeed, $this->block->getRssData()); + + $data = $this->block->getRssData(); + $this->assertTrue(is_string($data['title'])); + $this->assertTrue(is_string($data['description'])); + $this->assertTrue(is_string($data['entries'][0]['description'])); + $this->assertEquals($this->rssFeed, $data); } public function testGetCacheLifetime() diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php index 7379600011bcf..99f7122efa0a8 100755 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php @@ -560,7 +560,7 @@ private function getAttributes() * Loads attributes for specified groups at once * * @param AttributeGroupInterface[] $groups - * @return @return ProductAttributeInterface[] + * @return ProductAttributeInterface[] */ private function loadAttributesForGroups(array $groups) { diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav/CompositeConfigProcessor.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav/CompositeConfigProcessor.php index 5513af9d98e7d..fed94193225f8 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav/CompositeConfigProcessor.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav/CompositeConfigProcessor.php @@ -10,6 +10,9 @@ use Psr\Log\LoggerInterface as Logger; +/** + * Process config for Wysiwyg. + */ class CompositeConfigProcessor implements WysiwygConfigDataProcessorInterface { /** @@ -24,6 +27,7 @@ class CompositeConfigProcessor implements WysiwygConfigDataProcessorInterface /** * CompositeConfigProcessor constructor. + * @param Logger $logger * @param array $eavWysiwygDataProcessors */ public function __construct(Logger $logger, array $eavWysiwygDataProcessors) @@ -33,7 +37,7 @@ public function __construct(Logger $logger, array $eavWysiwygDataProcessors) } /** - * {@inheritdoc} + * @inheritdoc */ public function process(\Magento\Catalog\Api\Data\ProductAttributeInterface $attribute) { diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/DataProvider.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/DataProvider.php index 3090734df0144..4de0b94d06801 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/DataProvider.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Listing/DataProvider.php @@ -24,8 +24,6 @@ class DataProvider extends \Magento\Framework\View\Element\UiComponent\DataProvi /** * @param string $name - * @param string $primaryFieldName - * @param string $requestFieldName * @param Reporting $reporting * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param RequestInterface $request @@ -61,7 +59,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function getData() { diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorInterface.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorInterface.php index 5d14cd21f7b95..3f16e0a6617da 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorInterface.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/ProductRenderCollectorInterface.php @@ -21,7 +21,6 @@ interface ProductRenderCollectorInterface * * @param ProductInterface $product * @param ProductRenderInterface $productRender - * @param array $data * @return void * @since 101.1.0 */ diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml index fddc01ac4c189..c04cfb2dce00a 100644 --- a/app/code/Magento/Catalog/etc/adminhtml/di.xml +++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml @@ -78,7 +78,7 @@ <type name="Magento\Catalog\Model\ResourceModel\Attribute"> <plugin name="invalidate_pagecache_after_attribute_save" type="Magento\Catalog\Plugin\Model\ResourceModel\Attribute\Save" /> </type> - <virtualType name="\Magento\Catalog\Ui\DataProvider\Product\ProductCollectionFactory" type="\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory"> + <virtualType name="Magento\Catalog\Ui\DataProvider\Product\ProductCollectionFactory" type="Magento\Catalog\Model\ResourceModel\Product\CollectionFactory"> <arguments> <argument name="instanceName" xsi:type="string">\Magento\Catalog\Ui\DataProvider\Product\ProductCollection</argument> </arguments> diff --git a/app/code/Magento/CatalogInventory/Observer/CancelOrderItemObserver.php b/app/code/Magento/CatalogInventory/Observer/CancelOrderItemObserver.php index 1e99794d68a40..098e254d785a5 100644 --- a/app/code/Magento/CatalogInventory/Observer/CancelOrderItemObserver.php +++ b/app/code/Magento/CatalogInventory/Observer/CancelOrderItemObserver.php @@ -6,15 +6,21 @@ namespace Magento\CatalogInventory\Observer; -use Magento\Framework\Event\ObserverInterface; use Magento\CatalogInventory\Api\StockManagementInterface; +use Magento\CatalogInventory\Model\Configuration; use Magento\Framework\Event\Observer as EventObserver; +use Magento\Framework\Event\ObserverInterface; /** * Catalog inventory module observer */ class CancelOrderItemObserver implements ObserverInterface { + /** + * @var \Magento\CatalogInventory\Model\Configuration + */ + protected $configuration; + /** * @var StockManagementInterface */ @@ -26,13 +32,16 @@ class CancelOrderItemObserver implements ObserverInterface protected $priceIndexer; /** + * @param Configuration $configuration * @param StockManagementInterface $stockManagement * @param \Magento\Catalog\Model\Indexer\Product\Price\Processor $priceIndexer */ public function __construct( + Configuration $configuration, StockManagementInterface $stockManagement, \Magento\Catalog\Model\Indexer\Product\Price\Processor $priceIndexer ) { + $this->configuration = $configuration; $this->stockManagement = $stockManagement; $this->priceIndexer = $priceIndexer; } @@ -49,7 +58,8 @@ public function execute(EventObserver $observer) $item = $observer->getEvent()->getItem(); $children = $item->getChildrenItems(); $qty = $item->getQtyOrdered() - max($item->getQtyShipped(), $item->getQtyInvoiced()) - $item->getQtyCanceled(); - if ($item->getId() && $item->getProductId() && empty($children) && $qty) { + if ($item->getId() && $item->getProductId() && empty($children) && $qty && $this->configuration + ->getCanBackInStock()) { $this->stockManagement->backItemQty($item->getProductId(), $qty, $item->getStore()->getWebsiteId()); } $this->priceIndexer->reindexRow($item->getProductId()); diff --git a/app/code/Magento/CheckoutAgreements/etc/di.xml b/app/code/Magento/CheckoutAgreements/etc/di.xml index 081e3daa781ff..a8ff8f5941f96 100644 --- a/app/code/Magento/CheckoutAgreements/etc/di.xml +++ b/app/code/Magento/CheckoutAgreements/etc/di.xml @@ -23,7 +23,7 @@ <type name="Magento\Checkout\Api\GuestPaymentInformationManagementInterface"> <plugin name="validate-guest-agreements" type="Magento\CheckoutAgreements\Model\Checkout\Plugin\GuestValidation"/> </type> - <type name="\Magento\CheckoutAgreements\Model\CheckoutAgreementsList"> + <type name="Magento\CheckoutAgreements\Model\CheckoutAgreementsList"> <arguments> <argument name="collectionProcessor" xsi:type="object">Magento\CheckoutAgreements\Model\Api\SearchCriteria\CollectionProcessor</argument> </arguments> diff --git a/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml b/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml new file mode 100644 index 0000000000000..53ca46e746206 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/Data/CountryOptionConfigData.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="EnableAdminAccountAllowCountry" type="admin_account_country_options_config"> + <requiredEntity type="admin_account_country_options_value">AdminAccountAllowCountryUS</requiredEntity> + </entity> + <entity name="AdminAccountAllowCountryUS" type="admin_account_country_options_value"> + <data key="value">US</data> + </entity> + + <entity name="DisableAdminAccountAllowCountry" type="default_admin_account_country_options_config"> + <requiredEntity type="checkoutTotalFlagZero">DefaultAdminAccountAllowCountry</requiredEntity> + </entity> + <entity name="DefaultAdminAccountAllowCountry" type="checkoutTotalFlagZero"> + <data key="value">0</data> + </entity> +</entities> diff --git a/app/code/Magento/Config/Test/Mftf/Metadata/system_config-countries-meta.xml b/app/code/Magento/Config/Test/Mftf/Metadata/system_config-countries-meta.xml new file mode 100644 index 0000000000000..bd16c225af51d --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/Metadata/system_config-countries-meta.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="AdminAccountCountryOptionConfig" dataType="admin_account_country_options_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/general/" method="POST"> + <object key="groups" dataType="admin_account_country_options_config"> + <object key="country" dataType="admin_account_country_options_config"> + <object key="fields" dataType="admin_account_country_options_config"> + <object key="allow" dataType="admin_account_country_options_value"> + <field key="value">string</field> + </object> + </object> + </object> + </object> + </operation> + + <operation name="DefaultAdminAccountCountryOptionConfig" dataType="default_admin_account_country_options_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/general/" method="POST"> + <object key="groups" dataType="default_admin_account_country_options_config"> + <object key="country" dataType="default_admin_account_country_options_config"> + <object key="fields" dataType="default_admin_account_country_options_config"> + <object key="allow" dataType="default_admin_account_country_options_config"> + <object key="inherit" dataType="checkoutTotalFlagZero"> + <field key="value">string</field> + </object> + </object> + </object> + </object> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml b/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml new file mode 100644 index 0000000000000..b0a7ee07ddad0 --- /dev/null +++ b/app/code/Magento/Config/Test/Mftf/Test/CheckingCountryDropDownWithOneAllowedCountryTest.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="CheckingCountryDropDownWithOneAllowedCountryTest"> + <annotations> + <features value="Config"/> + <stories value="MAGETWO-96107: Additional blank option in country dropdown"/> + <title value="Checking country drop-down with one allowed country"/> + <description value="Check country drop-down with one allowed country"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-96133"/> + <group value="configuration"/> + </annotations> + <before> + <createData entity="EnableAdminAccountAllowCountry" stepKey="setAllowedCountries"/> + </before> + <after> + <createData entity="DisableAdminAccountAllowCountry" stepKey="setDefaultValueForAllowCountries"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> + <argument name="customerEmail" value="CustomerEntityOne.email"/> + </actionGroup> + <actionGroup ref="AdminClearCustomersFiltersActionGroup" stepKey="clearFilters"/> + <waitForPageLoad stepKey="WaitForPageToLoad"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!--Flush Magento Cache--> + <magentoCLI stepKey="flushCache" command="cache:flush"/> + <!--Create a customer account from Storefront--> + <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="createAnAccount"> + <argument name="Customer" value="CustomerEntityOne"/> + </actionGroup> + <click selector="{{CheckoutPaymentSection.addressBook}}" stepKey="goToAddressBook"/> + <click selector="{{StorefrontCustomerAddressSection.country}}" stepKey="clickToExpandCountryDropDown"/> + <see selector="{{StorefrontCustomerAddressSection.country}}" userInput="United States" stepKey="seeSelectedCountry"/> + <dontSee selector="{{StorefrontCustomerAddressSection.country}}" userInput="Brazil" stepKey="canNotSeeSelectedCountry"/> + </test> +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminChooseAffectedAttributeSetSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminChooseAffectedAttributeSetSection.xml index 4289638352990..6e8303e6baead 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminChooseAffectedAttributeSetSection.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminChooseAffectedAttributeSetSection.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminChooseAffectedAttributeSetPopup"> <element name="confirm" type="button" selector="button[data-index='confirm_button']" timeout="30"/> + <element name="closePopUp" type="button" selector="//*[contains(@class,'product_form_product_form_configurable_attribute_set')]//button[@data-role='closeBtn']" timeout="30"/> </section> -</sections> \ No newline at end of file +</sections> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml index f2caef1717e84..6f8384015ccfd 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml @@ -22,6 +22,8 @@ <element name="removeProductBtn" type="button" selector="//a[text()='Remove Product']"/> <element name="disableProductBtn" type="button" selector="//a[text()='Disable Product']"/> <element name="enableProductBtn" type="button" selector="//a[text()='Enable Product']"/> + <element name="confProductSku" type="input" selector="//*[@name='configurable-matrix[{{arg}}][sku]']" parameterized="true"/> + <element name="confProductSkuMessage" type="text" selector="//*[@name='configurable-matrix[{{arg}}][sku]']/following-sibling::label" parameterized="true"/> <element name="variationsSkuInputByRow" selector="[data-index='configurable-matrix'] table > tbody > tr:nth-of-type({{row}}) input[name*='sku']" type="input" parameterized="true"/> <element name="variationsSkuInputErrorByRow" selector="[data-index='configurable-matrix'] table > tbody > tr:nth-of-type({{row}}) .admin__field-error" type="text" parameterized="true"/> </section> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml new file mode 100644 index 0000000000000..2c331fa05efd7 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckValidatorConfigurableProductTest"> + <annotations> + <features value="ConfigurableProduct"/> + <title value="Check that validator works correctly when creating Configurations for Configurable Products"/> + <description value="Verify validator works correctly for Configurable Products"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-95995"/> + <useCaseId value="MAGETWO-95834"/> + <group value="ConfigurableProduct"/> + </annotations> + + <before> + <!--Login as admin--> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <!--Create Category--> + <createData entity="ApiCategory" stepKey="createCategory"/> + <!--Create Configurable product--> + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + </before> + + <after> + <!--Delete created data--> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> + <argument name="sku" value="{{ApiConfigurableProduct.name}}-thisIsShortName"/> + </actionGroup> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" + dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <!-- Remove attribute --> + <actionGroup ref="deleteProductAttribute" stepKey="deleteAttribute"> + <argument name="ProductAttribute" value="productDropDownAttribute"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Find the product that we just created using the product grid --> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> + <waitForPageLoad stepKey="waitForAdminProductPageLoad"/> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" + dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/> + <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct"> + <argument name="product" value="ApiConfigurableProduct"/> + </actionGroup> + <waitForPageLoad stepKey="waitForProductFilterLoad"/> + <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + + <!-- Create configurations based off the Text Swatch we created earlier --> + <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> + + <!--Create new attribute--> + <waitForElementVisible stepKey="waitForNewAttributePageOpened" selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}"/> + <click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickCreateNewAttribute" after="waitForNewAttributePageOpened"/> + <switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="enterAttributePanelIFrame" after="clickCreateNewAttribute"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.defaultLabel}}" time="30" stepKey="waitForIframeLoad" after="enterAttributePanelIFrame"/> + <fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillDefaultLabel" after="waitForIframeLoad"/> + <selectOption selector="{{AdminNewAttributePanel.inputType}}" userInput="{{colorProductAttribute.input_type}}" stepKey="selectAttributeInputType" after="fillDefaultLabel"/> + <!--Add option to attribute--> + <click selector="{{AdminNewAttributePanel.addOption}}" stepKey="clickAddOption1" after="selectAttributeInputType"/> + <waitForElementVisible selector="{{AdminNewAttributePanel.isDefault('1')}}" time="30" stepKey="waitForOptionRow1" after="clickAddOption1"/> + <fillField selector="{{AdminNewAttributePanel.optionAdminValue('0')}}" userInput="ThisIsLongNameNameLengthMoreThanSixtyFourThisIsLongNameNameLength" stepKey="fillAdminLabel1" after="waitForOptionRow1"/> + <fillField selector="{{AdminNewAttributePanel.optionDefaultStoreValue('0')}}" userInput="{{colorProductAttribute1.name}}" stepKey="fillDefaultLabel1" after="fillAdminLabel1"/> + + <!--Save attribute--> + <click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickOnNewAttributePanel"/> + <waitForPageLoad stepKey="waitForSaveAttribute"/> + <switchToIFrame stepKey="switchOutOfIFrame"/> + + <!--Find attribute in grid and select--> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> + <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/> + <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillFilterAttributeCodeField"/> + <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(productDropDownAttribute.attribute_code)}}" stepKey="waitForNextPageOpened"/> + <click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(productDropDownAttribute.attribute_code)}}" stepKey="clickSelectAll"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="waitForNextPageOpened2"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySinglePriceToAllSkus}}" stepKey="clickOnApplySinglePriceToAllSkus"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.singlePrice}}" userInput="10" stepKey="enterAttributePrice"/> + <click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> + <fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextStep3"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="waitForNextPageOpened3"/> + <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/> + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveButtonVisible"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitForPopUpVisible"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/> + <dontSeeElement selector="{{AdminMessagesSection.success}}" stepKey="dontSeeSaveProductMessage"/> + + <!--Close modal window--> + <click selector="{{AdminChooseAffectedAttributeSetPopup.closePopUp}}" stepKey="clickOnClosePopup"/> + <waitForElementNotVisible selector="{{AdminChooseAffectedAttributeSetPopup.closePopUp}}" stepKey="waitForDialogClosed"/> + + <!--See that validation message is shown under the fields--> + <scrollTo selector="{{AdminProductFormConfigurationsSection.currentVariationsSkuCells}}" stepKey="scrollTConfigurationTab"/> + <see userInput="Please enter less or equal than 64 symbols." selector="{{AdminProductFormConfigurationsSection.confProductSkuMessage('0')}}" stepKey="SeeValidationMessage"/> + + <!--Edit "SKU" with valid quantity--> + <fillField stepKey="fillValidValue" selector="{{AdminProductFormConfigurationsSection.confProductSku('0')}}" userInput="{{ApiConfigurableProduct.name}}-thisIsShortName"/> + + <!--Click on "Save"--> + <waitForElementVisible selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitForSaveBtnVisible"/> + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAgain"/> + + <!--Click on "Confirm". Product is saved, success message appears --> + <waitForElementVisible selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="waitPopUpVisible"/> + <click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmPopup"/> + <seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/> + </test> +</tests> diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js index 8d27e3dc58a4a..6d9e9944be66c 100644 --- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js +++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js @@ -383,7 +383,11 @@ define([ * Chose action for the form save button */ saveFormHandler: function () { - this.serializeData(); + this.formElement().validate(); + + if (this.formElement().source.get('params.invalid') === false) { + this.serializeData(); + } if (this.checkForNewAttributes()) { this.formSaveParams = arguments; diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithWebsiteAndStoreViewActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithWebsiteAndStoreViewActionGroup.xml index 4c458c66ca65b..37149e23dc87e 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithWebsiteAndStoreViewActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithWebsiteAndStoreViewActionGroup.xml @@ -42,4 +42,26 @@ <click stepKey="saveAddress" selector="{{AdminCustomerAddressesSection.saveAddress}}"/> <waitForPageLoad stepKey="waitForAddressSave"/> </actionGroup> + + <actionGroup name="AdminCreateCustomerWithWebSiteAndGroup"> + <arguments> + <argument name="customerData" defaultValue="Simple_US_Customer"/> + <argument name="website" type="string" defaultValue="customWebsite"/> + <argument name="storeView" type="string" defaultValue="customStore"/> + </arguments> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/> + <click stepKey="addNewCustomer" selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}"/> + <selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/> + <click selector="{{AdminCustomerAccountInformationSection.group}}" stepKey="ClickToExpandGroup"/> + <waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption('Default (General)')}}" stepKey="waitForCustomerGroupExpand"/> + <click selector="{{AdminCustomerAccountInformationSection.groupValue('Default (General)')}}" after="waitForCustomerGroupExpand" stepKey="ClickToSelectGroup"/> + <fillField stepKey="FillFirstName" selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customerData.firstname}}"/> + <fillField stepKey="FillLastName" selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customerData.lastname}}"/> + <fillField stepKey="FillEmail" selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customerData.email}}"/> + <selectOption stepKey="selectStoreView" selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{storeView}}"/> + <waitForElement selector="{{AdminCustomerAccountInformationSection.storeView}}" stepKey="waitForCustomerStoreViewExpand"/> + <click stepKey="save" selector="{{AdminCustomerAccountInformationSection.saveCustomer}}"/> + <waitForPageLoad stepKey="waitForCustomersPage"/> + <see stepKey="seeSuccessMessage" userInput="You saved the customer."/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/CreateCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/CreateCustomerActionGroup.xml similarity index 94% rename from app/code/Magento/Braintree/Test/Mftf/ActionGroup/CreateCustomerActionGroup.xml rename to app/code/Magento/Customer/Test/Mftf/ActionGroup/CreateCustomerActionGroup.xml index a68042127ec48..de24616b8adc9 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/CreateCustomerActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/CreateCustomerActionGroup.xml @@ -6,7 +6,7 @@ */ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="CreateCustomerActionGroup"> <click stepKey="openCustomers" selector="{{AdminMenuSection.customers}}"/> <waitForAjaxLoad stepKey="waitForCatalogSubmenu" time="5"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml similarity index 100% rename from app/code/Magento/Braintree/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml rename to app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/SwitchAccountActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SwitchAccountActionGroup.xml similarity index 85% rename from app/code/Magento/Braintree/Test/Mftf/ActionGroup/SwitchAccountActionGroup.xml rename to app/code/Magento/Customer/Test/Mftf/ActionGroup/SwitchAccountActionGroup.xml index 7c774a634b369..c3963f3dbef97 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/SwitchAccountActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SwitchAccountActionGroup.xml @@ -6,8 +6,7 @@ */ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> - + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Sign out--> <actionGroup name="SignOut"> <click selector="{{SignOutSection.admin}}" stepKey="clickToAdminProfile"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Data/NewCustomerData.xml b/app/code/Magento/Customer/Test/Mftf/Data/NewCustomerData.xml similarity index 77% rename from app/code/Magento/Braintree/Test/Mftf/Data/NewCustomerData.xml rename to app/code/Magento/Customer/Test/Mftf/Data/NewCustomerData.xml index 30345ec31bacd..9c1e7c48a74a2 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Data/NewCustomerData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/NewCustomerData.xml @@ -7,7 +7,7 @@ --> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="NewCustomerData" type="braintree_config_state"> <data key="FirstName">Abgar</data> <data key="LastName">Abgaryan</data> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminCreateUserSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCreateUserSection.xml similarity index 82% rename from app/code/Magento/Braintree/Test/Mftf/Section/AdminCreateUserSection.xml rename to app/code/Magento/Customer/Test/Mftf/Section/AdminCreateUserSection.xml index 98d748b5a30ea..9eaf0ae33d15b 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminCreateUserSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCreateUserSection.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminCreateUserSection"> <element name="system" type="input" selector="#menu-magento-backend-system"/> <element name="allUsers" type="input" selector="//span[contains(text(), 'All Users')]"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminDeleteUserSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminDeleteUserSection.xml similarity index 69% rename from app/code/Magento/Braintree/Test/Mftf/Section/AdminDeleteUserSection.xml rename to app/code/Magento/Customer/Test/Mftf/Section/AdminDeleteUserSection.xml index bf2e2b44eb602..af48b8f78216a 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminDeleteUserSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminDeleteUserSection.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminDeleteUserSection"> <element name="theUser" selector="//td[contains(text(), 'John')]" type="button"/> <element name="password" selector="#user_current_password" type="input"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminUserGridSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminUserGridSection.xml similarity index 75% rename from app/code/Magento/Braintree/Test/Mftf/Section/AdminUserGridSection.xml rename to app/code/Magento/Customer/Test/Mftf/Section/AdminUserGridSection.xml index 9564bc61f799c..9f51822684254 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminUserGridSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminUserGridSection.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminUserGridSection"> <element name="usernameFilterTextField" type="input" selector="#permissionsUserGrid_filter_username"/> <element name="searchButton" type="button" selector=".admin__data-grid-header button[title=Search]"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/CustomersPageSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/CustomersPageSection.xml similarity index 84% rename from app/code/Magento/Braintree/Test/Mftf/Section/CustomersPageSection.xml rename to app/code/Magento/Customer/Test/Mftf/Section/CustomersPageSection.xml index e4a75b1b6a842..60c635387199a 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/CustomersPageSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/CustomersPageSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="CustomersPageSection"> <element name="addNewCustomerButton" type="button" selector="//*[@id='add']"/> <element name="customerCheckbox" type="button" selector="//*[contains(text(),'{{args}}')]/parent::td/preceding-sibling::td/label[@class='data-grid-checkbox-cell-inner']" parameterized="true"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/CustomersSubmenuSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/CustomersSubmenuSection.xml similarity index 68% rename from app/code/Magento/Braintree/Test/Mftf/Section/CustomersSubmenuSection.xml rename to app/code/Magento/Customer/Test/Mftf/Section/CustomersSubmenuSection.xml index 937afb83da96f..6eeef1ba9daf0 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/CustomersSubmenuSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/CustomersSubmenuSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="CustomersSubmenuSection"> <element name="allCustomers" type="button" selector="//li[@id='menu-magento-customer-customer']//li[@data-ui-id='menu-magento-customer-customer-manage']"/> </section> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/NewCustomerPageSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/NewCustomerPageSection.xml similarity index 92% rename from app/code/Magento/Braintree/Test/Mftf/Section/NewCustomerPageSection.xml rename to app/code/Magento/Customer/Test/Mftf/Section/NewCustomerPageSection.xml index d302f9c7d0cba..db11f2d260b15 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/NewCustomerPageSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/NewCustomerPageSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="NewCustomerPageSection"> <element name="associateToWebsite" type="select" selector="//*[@class='admin__field-control _with-tooltip']//*[@class='admin__control-select']"/> <element name="group" type="select" selector="//div[@class='admin__field-control admin__control-fields required']//div[@class='admin__field-control']//select[@class='admin__control-select']"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/SwitchAccountSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/SwitchAccountSection.xml similarity index 78% rename from app/code/Magento/Braintree/Test/Mftf/Section/SwitchAccountSection.xml rename to app/code/Magento/Customer/Test/Mftf/Section/SwitchAccountSection.xml index 3a07cbc6dd145..e7655924133e1 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/SwitchAccountSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/SwitchAccountSection.xml @@ -7,8 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> - + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="LoginFormSection"> <element name="username" type="input" selector="#username"/> <element name="password" type="input" selector="#login"/> diff --git a/app/code/Magento/Directory/Model/ResourceModel/Country/Collection.php b/app/code/Magento/Directory/Model/ResourceModel/Country/Collection.php index f90a7b3b519b5..827a32dcea4f9 100644 --- a/app/code/Magento/Directory/Model/ResourceModel/Country/Collection.php +++ b/app/code/Magento/Directory/Model/ResourceModel/Country/Collection.php @@ -205,6 +205,7 @@ public function getItemById($countryId) /** * Add filter by country code to collection. + * * $countryCode can be either array of country codes or string representing one country code. * $iso can be either array containing 'iso2', 'iso3' values or string with containing one of that values directly. * The collection will contain countries where at least one of country $iso fields matches $countryCode. @@ -297,7 +298,7 @@ public function toOptionArray($emptyLabel = ' ') } $options[] = $option; } - if ($emptyLabel !== false && count($options) > 0) { + if ($emptyLabel !== false && count($options) > 1) { array_unshift($options, ['value' => '', 'label' => $emptyLabel]); } diff --git a/app/code/Magento/Elasticsearch/etc/di.xml b/app/code/Magento/Elasticsearch/etc/di.xml index 6a42e4b3c9fe2..7e219bb2f918f 100644 --- a/app/code/Magento/Elasticsearch/etc/di.xml +++ b/app/code/Magento/Elasticsearch/etc/di.xml @@ -68,7 +68,7 @@ </argument> </arguments> </type> - <type name="\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\ProductFieldMapperProxy"> + <type name="Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\ProductFieldMapperProxy"> <arguments> <argument name="productFieldMappers" xsi:type="array"> <item name="elasticsearch" xsi:type="object">Magento\Elasticsearch\Model\Adapter\FieldMapper\ProductFieldMapper</item> @@ -287,7 +287,7 @@ <argument name="fieldNameResolver" xsi:type="object">elasticsearch5FieldNameResolver</argument> </arguments> </type> - <type name="\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver"> + <type name="Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> <item name="notEav" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldName\Resolver\NotEavAttribute</item> @@ -317,7 +317,7 @@ <argument name="fieldTypeConverter" xsi:type="object">Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Converter</argument> </arguments> </virtualType> - <type name="\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\CompositeResolver"> + <type name="Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> <item name="integer" xsi:type="object">\Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType</item> @@ -327,7 +327,7 @@ </argument> </arguments> </type> - <type name="\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\CompositeResolver"> + <type name="Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\CompositeResolver"> <arguments> <argument name="items" xsi:type="array"> <item name="keyword" xsi:type="object">\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\KeywordType</item> @@ -368,12 +368,12 @@ <argument name="indexTypeConverter" xsi:type="object">Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldIndex\Converter</argument> </arguments> </virtualType> - <type name="\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\KeywordType"> + <type name="Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\KeywordType"> <arguments> <argument name="fieldTypeConverter" xsi:type="object">Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Converter</argument> </arguments> </type> - <type name="\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType"> + <type name="Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Resolver\IntegerType"> <arguments> <argument name="fieldTypeConverter" xsi:type="object">Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Converter</argument> </arguments> @@ -393,13 +393,13 @@ <argument name="fieldTypeConverter" xsi:type="object">Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\Product\FieldProvider\FieldType\Converter</argument> </arguments> </virtualType> - <type name="\Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\ProductFieldMapper"> + <type name="Magento\Elasticsearch\Elasticsearch5\Model\Adapter\FieldMapper\ProductFieldMapper"> <arguments> <argument name="fieldProvider" xsi:type="object">elasticsearch5FieldProvider</argument> <argument name="fieldNameResolver" xsi:type="object">elasticsearch5FieldNameResolver</argument> </arguments> </type> - <type name="\Magento\Elasticsearch\Model\Adapter\FieldMapper\ProductFieldMapper"> + <type name="Magento\Elasticsearch\Model\Adapter\FieldMapper\ProductFieldMapper"> <arguments> <argument name="attributeAdapterProvider" xsi:type="object">Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\AttributeProvider</argument> <argument name="fieldProvider" xsi:type="object">Magento\Elasticsearch\Model\Adapter\FieldMapper\Product\FieldProviderInterface</argument> diff --git a/app/code/Magento/ImportExport/Model/Import.php b/app/code/Magento/ImportExport/Model/Import.php index 1372322ee5855..1cc8dc224acb6 100644 --- a/app/code/Magento/ImportExport/Model/Import.php +++ b/app/code/Magento/ImportExport/Model/Import.php @@ -7,10 +7,12 @@ namespace Magento\ImportExport\Model; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; use Magento\Framework\HTTP\Adapter\FileTransferFactory; use Magento\Framework\Stdlib\DateTime\DateTime; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError; use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface; +use Magento\Framework\Message\ManagerInterface; /** * Import model @@ -179,6 +181,11 @@ class Import extends \Magento\ImportExport\Model\AbstractModel */ private $localeDate; + /** + * @var ManagerInterface + */ + private $messageManager; + /** * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Filesystem $filesystem @@ -195,6 +202,7 @@ class Import extends \Magento\ImportExport\Model\AbstractModel * @param History $importHistoryModel * @param DateTime $localeDate * @param array $data + * @param ManagerInterface|null $messageManager * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -212,7 +220,8 @@ public function __construct( \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry, \Magento\ImportExport\Model\History $importHistoryModel, DateTime $localeDate, - array $data = [] + array $data = [], + ManagerInterface $messageManager = null ) { $this->_importExportData = $importExportData; $this->_coreConfig = $coreConfig; @@ -227,6 +236,7 @@ public function __construct( $this->_filesystem = $filesystem; $this->importHistoryModel = $importHistoryModel; $this->localeDate = $localeDate; + $this->messageManager = $messageManager ?: ObjectManager::getInstance()->get(ManagerInterface::class); parent::__construct($logger, $filesystem, $data); } @@ -620,9 +630,13 @@ public function validateSource(\Magento\ImportExport\Model\Import\AbstractSource $messages = $this->getOperationResultMessages($errorAggregator); $this->addLogComment($messages); - $result = !$errorAggregator->getErrorsCount(); + $errorsCount = $errorAggregator->getErrorsCount(); + $result = !$errorsCount; $validationStrategy = $this->getData(self::FIELD_NAME_VALIDATION_STRATEGY); - if ($validationStrategy === ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_SKIP_ERRORS) { + if ($errorsCount + && $validationStrategy === ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_SKIP_ERRORS + ) { + $this->messageManager->addWarningMessage(__('Skipped errors: %1', $errorsCount)); $result = true; } diff --git a/app/code/Magento/ImportExport/etc/adminhtml/di.xml b/app/code/Magento/ImportExport/etc/adminhtml/di.xml index 03c24c7b2bf69..8f7955e679cc2 100644 --- a/app/code/Magento/ImportExport/etc/adminhtml/di.xml +++ b/app/code/Magento/ImportExport/etc/adminhtml/di.xml @@ -6,7 +6,7 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> - <type name="\Magento\ImportExport\Controller\Adminhtml\Import\Start"> + <type name="Magento\ImportExport\Controller\Adminhtml\Import\Start"> <arguments> <argument name="exceptionMessageFactory" xsi:type="object">Magento\Framework\Message\ExceptionMessageLookupFactory</argument> </arguments> diff --git a/app/code/Magento/Indexer/etc/di.xml b/app/code/Magento/Indexer/etc/di.xml index c7603191e8606..76e7e7a46224b 100644 --- a/app/code/Magento/Indexer/etc/di.xml +++ b/app/code/Magento/Indexer/etc/di.xml @@ -42,7 +42,7 @@ <plugin name="page-cache-indexer-reindex-clean-cache" type="Magento\Indexer\Model\Processor\CleanCache" sortOrder="10"/> </type> - <type name="\Magento\Indexer\Model\ProcessManager"> + <type name="Magento\Indexer\Model\ProcessManager"> <arguments> <argument name="threadsCount" xsi:type="init_parameter">Magento\Indexer\Model\ProcessManager::THREADS_COUNT</argument> </arguments> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml index 2bb8b34aa01c8..452daac1e3cde 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml @@ -59,6 +59,15 @@ <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> </actionGroup> + <!--Navigate to New Order Page for existing Customer And Store--> + <actionGroup name="NavigateToNewOrderPageExistingCustomerAndStoreActionGroup" extends="navigateToNewOrderPageExistingCustomer" > + <arguments> + <argument name="storeView" defaultValue="_defaultStore"/> + </arguments> + <click selector="{{AdminOrderStoreScopeTreeSection.storeOption(storeView.name)}}" stepKey="selectStoreView" after="waitForCreateOrderPageLoad"/> + <waitForPageLoad stepKey="waitForLoad" after="selectStoreView"/> + </actionGroup> + <!--Check the required fields are actually required--> <actionGroup name="checkRequiredFieldsNewOrderForm"> <seeElement selector="{{AdminOrderFormAccountSection.requiredGroup}}" stepKey="seeCustomerGroupRequired"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/CreateNewOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateNewOrderActionGroup.xml similarity index 72% rename from app/code/Magento/Braintree/Test/Mftf/ActionGroup/CreateNewOrderActionGroup.xml rename to app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateNewOrderActionGroup.xml index 17d634c009b3e..2c549d5c01cf2 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/CreateNewOrderActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/CreateNewOrderActionGroup.xml @@ -6,34 +6,29 @@ */ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> - + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="useBraintreeForMasterCard"> <click stepKey="chooseBraintree" selector="{{NewOrderSection.creditCardBraintree}}"/> - <waitForPageLoad stepKey="waitForBraintreeConfigs" time="5"/> + <waitForPageLoad stepKey="waitForBraintreeConfigs"/> <click stepKey="openCardTypes" selector="{{NewOrderSection.openCardTypes}}"/> - <waitForPageLoad stepKey="waitForCardTypes" time="3"/> + <waitForPageLoad stepKey="waitForCardTypes"/> <click stepKey="chooseCardType" selector="{{NewOrderSection.masterCard}}"/> - <waitForPageLoad stepKey="waitForCardSelected" time="3"/> + <waitForPageLoad stepKey="waitForCardSelected"/> <switchToIFrame stepKey="switchToCardNumber" selector="{{NewOrderSection.cardFrame}}"/> <fillField stepKey="fillCardNumber" selector="{{NewOrderSection.creditCardNumber}}" userInput="{{PaymentAndShippingInfo.cardNumber}}"/> - <waitForPageLoad stepKey="waitForFillCardNumber" time="1"/> <switchToIFrame stepKey="switchBackFromCard"/> <switchToIFrame stepKey="switchToExpirationMonth" selector="{{NewOrderSection.monthFrame}}"/> <fillField stepKey="fillMonth" selector="{{NewOrderSection.expirationMonth}}" userInput="{{PaymentAndShippingInfo.month}}"/> - <waitForPageLoad stepKey="waitForFillMonth" time="1"/> <switchToIFrame stepKey="switchBackFromMonth"/> <switchToIFrame stepKey="switchToExpirationYear" selector="{{NewOrderSection.yearFrame}}"/> <fillField stepKey="fillYear" selector="{{NewOrderSection.expirationYear}}" userInput="{{PaymentAndShippingInfo.year}}"/> - <waitForPageLoad stepKey="waitForFillYear" time="1"/> <switchToIFrame stepKey="switchBackFromYear"/> <switchToIFrame stepKey="switchToCVV" selector="{{NewOrderSection.cvvFrame}}"/> <fillField stepKey="fillCVV" selector="{{NewOrderSection.cvv}}" userInput="{{PaymentAndShippingInfo.cvv}}"/> - <wait stepKey="waitForFillCVV" time="1"/> <switchToIFrame stepKey="switchBackFromCVV"/> </actionGroup> </actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/ConfigurationListSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/ConfigurationListSection.xml similarity index 72% rename from app/code/Magento/Braintree/Test/Mftf/Section/ConfigurationListSection.xml rename to app/code/Magento/Sales/Test/Mftf/Section/ConfigurationListSection.xml index 100407438eaae..bce5f95cf78a6 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/ConfigurationListSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/ConfigurationListSection.xml @@ -7,7 +7,7 @@ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="ConfigurationListSection"> <element name="sales" type="button" selector="//div[contains(@class, 'admin__page-nav-title title _collapsible')]/strong[text()='Sales']"/> <element name="salesPaymentMethods" type="button" selector="//span[text()='Payment Methods']"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/NewOrderSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/NewOrderSection.xml similarity index 90% rename from app/code/Magento/Braintree/Test/Mftf/Section/NewOrderSection.xml rename to app/code/Magento/Sales/Test/Mftf/Section/NewOrderSection.xml index 13f59ad2cf18e..cde46c1ad63e8 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/NewOrderSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/NewOrderSection.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="NewOrderSection"> <element name="createNewOrder" type="button" selector="#add"/> <element name="customer" type="button" selector="//td[contains(text(), 'Abgar')]"/> diff --git a/app/code/Magento/Sales/etc/webapi.xml b/app/code/Magento/Sales/etc/webapi.xml index cee245e348393..492dff8057039 100644 --- a/app/code/Magento/Sales/etc/webapi.xml +++ b/app/code/Magento/Sales/etc/webapi.xml @@ -10,271 +10,271 @@ <route url="/V1/orders/:id" method="GET"> <service class="Magento\Sales\Api\OrderRepositoryInterface" method="get"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::actions_view" /> </resources> </route> <route url="/V1/orders" method="GET"> <service class="Magento\Sales\Api\OrderRepositoryInterface" method="getList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::actions_view" /> </resources> </route> <route url="/V1/orders/:id/statuses" method="GET"> <service class="Magento\Sales\Api\OrderManagementInterface" method="getStatus"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::actions_view" /> </resources> </route> <route url="/V1/orders/:id/cancel" method="POST"> <service class="Magento\Sales\Api\OrderManagementInterface" method="cancel"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::cancel" /> </resources> </route> <route url="/V1/orders/:id/emails" method="POST"> <service class="Magento\Sales\Api\OrderManagementInterface" method="notify"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::emails" /> </resources> </route> <route url="/V1/orders/:id/hold" method="POST"> <service class="Magento\Sales\Api\OrderManagementInterface" method="hold"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::hold" /> </resources> </route> <route url="/V1/orders/:id/unhold" method="POST"> <service class="Magento\Sales\Api\OrderManagementInterface" method="unHold"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::unhold" /> </resources> </route> <route url="/V1/orders/:id/comments" method="POST"> <service class="Magento\Sales\Api\OrderManagementInterface" method="addComment"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::comment" /> </resources> </route> <route url="/V1/orders/:id/comments" method="GET"> <service class="Magento\Sales\Api\OrderManagementInterface" method="getCommentsList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::actions_view" /> </resources> </route> <route url="/V1/orders/create" method="PUT"> <service class="Magento\Sales\Api\OrderRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::create" /> </resources> </route> <route url="/V1/orders/:parent_id" method="PUT"> <service class="Magento\Sales\Api\OrderAddressRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::create" /> </resources> </route> <route url="/V1/orders/items/:id" method="GET"> <service class="Magento\Sales\Api\OrderItemRepositoryInterface" method="get"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::actions_view" /> </resources> </route> <route url="/V1/orders/items" method="GET"> <service class="Magento\Sales\Api\OrderItemRepositoryInterface" method="getList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::actions_view" /> </resources> </route> <route url="/V1/invoices/:id" method="GET"> <service class="Magento\Sales\Api\InvoiceRepositoryInterface" method="get"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_invoice" /> </resources> </route> <route url="/V1/invoices" method="GET"> <service class="Magento\Sales\Api\InvoiceRepositoryInterface" method="getList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_invoice" /> </resources> </route> <route url="/V1/invoices/:id/comments" method="GET"> <service class="Magento\Sales\Api\InvoiceManagementInterface" method="getCommentsList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_invoice" /> </resources> </route> <route url="/V1/invoices/:id/emails" method="POST"> <service class="Magento\Sales\Api\InvoiceManagementInterface" method="notify"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_invoice" /> </resources> </route> <route url="/V1/invoices/:id/void" method="POST"> <service class="Magento\Sales\Api\InvoiceManagementInterface" method="setVoid"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_invoice" /> </resources> </route> <route url="/V1/invoices/:id/capture" method="POST"> <service class="Magento\Sales\Api\InvoiceManagementInterface" method="setCapture"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_invoice" /> </resources> </route> <route url="/V1/invoices/comments" method="POST"> <service class="Magento\Sales\Api\InvoiceCommentRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_invoice" /> </resources> </route> <route url="/V1/invoices/" method="POST"> <service class="Magento\Sales\Api\InvoiceRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_invoice" /> </resources> </route> <route url="/V1/invoice/:invoiceId/refund" method="POST"> <service class="Magento\Sales\Api\RefundInvoiceInterface" method="execute"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_invoice" /> </resources> </route> <route url="/V1/creditmemo/:id/comments" method="GET"> <service class="Magento\Sales\Api\CreditmemoManagementInterface" method="getCommentsList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_creditmemo" /> </resources> </route> <route url="/V1/creditmemos" method="GET"> <service class="Magento\Sales\Api\CreditmemoRepositoryInterface" method="getList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_creditmemo" /> </resources> </route> <route url="/V1/creditmemo/:id" method="GET"> <service class="Magento\Sales\Api\CreditmemoRepositoryInterface" method="get"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_creditmemo" /> </resources> </route> <route url="/V1/creditmemo/:id" method="PUT"> <service class="Magento\Sales\Api\CreditmemoManagementInterface" method="cancel"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_creditmemo" /> </resources> </route> <route url="/V1/creditmemo/:id/emails" method="POST"> <service class="Magento\Sales\Api\CreditmemoManagementInterface" method="notify"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_creditmemo" /> </resources> </route> <route url="/V1/creditmemo/refund" method="POST"> <service class="Magento\Sales\Api\CreditmemoManagementInterface" method="refund"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_creditmemo" /> </resources> </route> <route url="/V1/creditmemo/:id/comments" method="POST"> <service class="Magento\Sales\Api\CreditmemoCommentRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_creditmemo" /> </resources> </route> <route url="/V1/creditmemo" method="POST"> <service class="Magento\Sales\Api\CreditmemoRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::sales_creditmemo" /> </resources> </route> <route url="/V1/order/:orderId/refund" method="POST"> <service class="Magento\Sales\Api\RefundOrderInterface" method="execute"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::creditmemo" /> </resources> </route> <route url="/V1/shipment/:id" method="GET"> <service class="Magento\Sales\Api\ShipmentRepositoryInterface" method="get"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::shipment" /> </resources> </route> <route url="/V1/shipments" method="GET"> <service class="Magento\Sales\Api\ShipmentRepositoryInterface" method="getList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::shipment" /> </resources> </route> <route url="/V1/shipment/:id/comments" method="GET"> <service class="Magento\Sales\Api\ShipmentManagementInterface" method="getCommentsList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::shipment" /> </resources> </route> <route url="/V1/shipment/:id/comments" method="POST"> <service class="Magento\Sales\Api\ShipmentCommentRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::shipment" /> </resources> </route> <route url="/V1/shipment/:id/emails" method="POST"> <service class="Magento\Sales\Api\ShipmentManagementInterface" method="notify"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::shipment" /> </resources> </route> <route url="/V1/shipment/track" method="POST"> <service class="Magento\Sales\Api\ShipmentTrackRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::shipment" /> </resources> </route> <route url="/V1/shipment/track/:id" method="DELETE"> <service class="Magento\Sales\Api\ShipmentTrackRepositoryInterface" method="deleteById"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::shipment" /> </resources> </route> <route url="/V1/shipment/" method="POST"> <service class="Magento\Sales\Api\ShipmentRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::shipment" /> </resources> </route> <route url="/V1/shipment/:id/label" method="GET"> <service class="Magento\Sales\Api\ShipmentManagementInterface" method="getLabel"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::shipment" /> </resources> </route> <route url="/V1/order/:orderId/ship" method="POST"> <service class="Magento\Sales\Api\ShipOrderInterface" method="execute"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::ship" /> </resources> </route> <route url="/V1/orders/" method="POST"> <service class="Magento\Sales\Api\OrderRepositoryInterface" method="save"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::create" /> </resources> </route> <route url="/V1/transactions/:id" method="GET"> <service class="Magento\Sales\Api\TransactionRepositoryInterface" method="get"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::transactions_fetch" /> </resources> </route> <route url="/V1/transactions" method="GET"> <service class="Magento\Sales\Api\TransactionRepositoryInterface" method="getList"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::transactions_fetch" /> </resources> </route> <route url="/V1/order/:orderId/invoice" method="POST"> <service class="Magento\Sales\Api\InvoiceOrderInterface" method="execute"/> <resources> - <resource ref="Magento_Sales::sales" /> + <resource ref="Magento_Sales::invoice" /> </resources> </route> </routes> diff --git a/app/code/Magento/Sales/etc/webapi_rest/di.xml b/app/code/Magento/Sales/etc/webapi_rest/di.xml index 6435445e0ef93..f2cbd14eb8042 100644 --- a/app/code/Magento/Sales/etc/webapi_rest/di.xml +++ b/app/code/Magento/Sales/etc/webapi_rest/di.xml @@ -18,7 +18,7 @@ <type name="Magento\Framework\Reflection\DataObjectProcessor"> <arguments> <argument name="processors" xsi:type="array"> - <item name="\Magento\Sales\Model\Order\Item" xsi:type="object">Magento\Sales\Model\Order\Webapi\ChangeOutputArray\Proxy</item> + <item name="Magento\Sales\Model\Order\Item" xsi:type="object">Magento\Sales\Model\Order\Webapi\ChangeOutputArray\Proxy</item> </argument> </arguments> </type> diff --git a/app/code/Magento/Sales/etc/webapi_soap/di.xml b/app/code/Magento/Sales/etc/webapi_soap/di.xml index 6435445e0ef93..f2cbd14eb8042 100644 --- a/app/code/Magento/Sales/etc/webapi_soap/di.xml +++ b/app/code/Magento/Sales/etc/webapi_soap/di.xml @@ -18,7 +18,7 @@ <type name="Magento\Framework\Reflection\DataObjectProcessor"> <arguments> <argument name="processors" xsi:type="array"> - <item name="\Magento\Sales\Model\Order\Item" xsi:type="object">Magento\Sales\Model\Order\Webapi\ChangeOutputArray\Proxy</item> + <item name="Magento\Sales\Model\Order\Item" xsi:type="object">Magento\Sales\Model\Order\Webapi\ChangeOutputArray\Proxy</item> </argument> </arguments> </type> diff --git a/app/code/Magento/SalesRule/etc/di.xml b/app/code/Magento/SalesRule/etc/di.xml index a8c350457a5a6..27c9a41503b22 100644 --- a/app/code/Magento/SalesRule/etc/di.xml +++ b/app/code/Magento/SalesRule/etc/di.xml @@ -179,7 +179,7 @@ </arguments> </type> - <type name="\Magento\Quote\Model\Cart\CartTotalRepository"> + <type name="Magento\Quote\Model\Cart\CartTotalRepository"> <plugin name="coupon_label_plugin" type="Magento\SalesRule\Plugin\CartTotalRepository" /> </type> </config> diff --git a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php index 8bd64ccf82d88..100ba029beabd 100644 --- a/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php +++ b/app/code/Magento/Shipping/Controller/Adminhtml/Order/Shipment/Save.php @@ -1,13 +1,13 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Shipping\Controller\Adminhtml\Order\Shipment; -use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface; -use Magento\Backend\App\Action; +use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\Controller\ResultFactory; use Magento\Sales\Model\Order\Shipment\Validation\QuantityValidator; /** @@ -48,17 +48,22 @@ class Save extends \Magento\Backend\App\Action implements HttpPostActionInterfac * @param \Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader $shipmentLoader * @param \Magento\Shipping\Model\Shipping\LabelGenerator $labelGenerator * @param \Magento\Sales\Model\Order\Email\Sender\ShipmentSender $shipmentSender + * @param \Magento\Sales\Model\Order\Shipment\ShipmentValidatorInterface|null $shipmentValidator */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Shipping\Controller\Adminhtml\Order\ShipmentLoader $shipmentLoader, \Magento\Shipping\Model\Shipping\LabelGenerator $labelGenerator, - \Magento\Sales\Model\Order\Email\Sender\ShipmentSender $shipmentSender + \Magento\Sales\Model\Order\Email\Sender\ShipmentSender $shipmentSender, + \Magento\Sales\Model\Order\Shipment\ShipmentValidatorInterface $shipmentValidator = null ) { + parent::__construct($context); + $this->shipmentLoader = $shipmentLoader; $this->labelGenerator = $labelGenerator; $this->shipmentSender = $shipmentSender; - parent::__construct($context); + $this->shipmentValidator = $shipmentValidator ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Sales\Model\Order\Shipment\ShipmentValidatorInterface::class); } /** @@ -84,9 +89,10 @@ protected function _saveShipment($shipment) /** * Save shipment + * * We can save only new shipment. Existing shipments are not editable * - * @return void + * @return \Magento\Framework\Controller\ResultInterface * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ @@ -98,7 +104,7 @@ public function execute() $formKeyIsValid = $this->_formKeyValidator->validate($this->getRequest()); $isPost = $this->getRequest()->isPost(); if (!$formKeyIsValid || !$isPost) { - $this->messageManager->addError(__('We can\'t save the shipment right now.')); + $this->messageManager->addErrorMessage(__('We can\'t save the shipment right now.')); return $resultRedirect->setPath('sales/order/index'); } @@ -118,8 +124,7 @@ public function execute() $this->shipmentLoader->setTracking($this->getRequest()->getParam('tracking')); $shipment = $this->shipmentLoader->load(); if (!$shipment) { - $this->_forward('noroute'); - return; + return $this->resultFactory->create(ResultFactory::TYPE_FORWARD)->forward('noroute'); } if (!empty($data['comment_text'])) { @@ -132,15 +137,13 @@ public function execute() $shipment->setCustomerNote($data['comment_text']); $shipment->setCustomerNoteNotify(isset($data['comment_customer_notify'])); } - $validationResult = $this->getShipmentValidator() - ->validate($shipment, [QuantityValidator::class]); + $validationResult = $this->shipmentValidator->validate($shipment, [QuantityValidator::class]); if ($validationResult->hasMessages()) { - $this->messageManager->addError( + $this->messageManager->addErrorMessage( __("Shipment Document Validation Error(s):\n" . implode("\n", $validationResult->getMessages())) ); - $this->_redirect('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); - return; + return $resultRedirect->setPath('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); } $shipment->register(); @@ -160,7 +163,7 @@ public function execute() $shipmentCreatedMessage = __('The shipment has been created.'); $labelCreatedMessage = __('You created the shipping label.'); - $this->messageManager->addSuccess( + $this->messageManager->addSuccessMessage( $isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage : $shipmentCreatedMessage ); $this->_objectManager->get(\Magento\Backend\Model\Session::class)->getCommentText(true); @@ -169,8 +172,8 @@ public function execute() $responseAjax->setError(true); $responseAjax->setMessage($e->getMessage()); } else { - $this->messageManager->addError($e->getMessage()); - $this->_redirect('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); + $this->messageManager->addErrorMessage($e->getMessage()); + return $resultRedirect->setPath('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); } } catch (\Exception $e) { $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e); @@ -178,29 +181,14 @@ public function execute() $responseAjax->setError(true); $responseAjax->setMessage(__('An error occurred while creating shipping label.')); } else { - $this->messageManager->addError(__('Cannot save shipment.')); - $this->_redirect('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); + $this->messageManager->addErrorMessage(__('Cannot save shipment.')); + return $resultRedirect->setPath('*/*/new', ['order_id' => $this->getRequest()->getParam('order_id')]); } } if ($isNeedCreateLabel) { - $this->getResponse()->representJson($responseAjax->toJson()); - } else { - $this->_redirect('sales/order/view', ['order_id' => $shipment->getOrderId()]); - } - } - - /** - * @return \Magento\Sales\Model\Order\Shipment\ShipmentValidatorInterface - * @deprecated 100.1.1 - */ - private function getShipmentValidator() - { - if ($this->shipmentValidator === null) { - $this->shipmentValidator = $this->_objectManager->get( - \Magento\Sales\Model\Order\Shipment\ShipmentValidatorInterface::class - ); + return $this->resultFactory->create(ResultFactory::TYPE_JSON)->setJsonData($responseAjax->toJson()); } - return $this->shipmentValidator; + return $resultRedirect->setPath('sales/order/view', ['order_id' => $shipment->getOrderId()]); } } diff --git a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php index 27047ae46bf1f..0dadb0e243864 100644 --- a/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php +++ b/app/code/Magento/Shipping/Model/Carrier/AbstractCarrierOnline.php @@ -29,6 +29,14 @@ abstract class AbstractCarrierOnline extends AbstractCarrier const GUAM_REGION_CODE = 'GU'; + const SPAIN_COUNTRY_ID = 'ES'; + + const CANARY_ISLANDS_COUNTRY_ID = 'IC'; + + const SANTA_CRUZ_DE_TENERIFE_REGION_ID = 'Santa Cruz de Tenerife'; + + const LAS_PALMAS_REGION_ID = 'Las Palmas'; + /** * Array of quotes * diff --git a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php index f841728416f82..c253900501d18 100644 --- a/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php +++ b/app/code/Magento/Shipping/Test/Unit/Controller/Adminhtml/Order/Shipment/SaveTest.php @@ -142,7 +142,7 @@ protected function setUp() ); $this->messageManager = $this->createPartialMock( \Magento\Framework\Message\Manager::class, - ['addSuccess', 'addError'] + ['addSuccessMessage', 'addErrorMessage'] ); $this->session = $this->createPartialMock( \Magento\Backend\Model\Session::class, @@ -236,7 +236,7 @@ public function testExecute($formKeyIsValid, $isPost) if (!$formKeyIsValid || !$isPost) { $this->messageManager->expects($this->once()) - ->method('addError'); + ->method('addErrorMessage'); $this->resultRedirect->expects($this->once()) ->method('setPath') @@ -325,12 +325,11 @@ public function testExecute($formKeyIsValid, $isPost) ->method('get') ->with(\Magento\Backend\Model\Session::class) ->will($this->returnValue($this->session)); - $path = 'sales/order/view'; $arguments = ['order_id' => $orderId]; $shipment->expects($this->once()) ->method('getOrderId') ->will($this->returnValue($orderId)); - $this->prepareRedirect($path, $arguments); + $this->prepareRedirect($arguments); $this->shipmentValidatorMock->expects($this->once()) ->method('validate') @@ -360,10 +359,9 @@ public function executeDataProvider() } /** - * @param string $path * @param array $arguments */ - protected function prepareRedirect($path, array $arguments = []) + protected function prepareRedirect(array $arguments = []) { $this->actionFlag->expects($this->any()) ->method('get') @@ -372,14 +370,8 @@ protected function prepareRedirect($path, array $arguments = []) $this->session->expects($this->any()) ->method('setIsUrlNotice') ->with(true); - - $url = $path . '/' . (!empty($arguments) ? $arguments['order_id'] : ''); - $this->helper->expects($this->atLeastOnce()) - ->method('getUrl') - ->with($path, $arguments) - ->will($this->returnValue($url)); - $this->response->expects($this->atLeastOnce()) - ->method('setRedirect') - ->with($url); + $this->resultRedirect->expects($this->once()) + ->method('setPath') + ->with('sales/order/view', $arguments); } } diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index 29a1f4a9c666e..c1ad5bdcfc068 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -33,6 +33,7 @@ * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.ExcessivePublicCount) + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) * @since 100.0.2 */ class Store extends AbstractExtensibleModel implements @@ -897,7 +898,10 @@ public function setCurrentCurrencyCode($code) if (in_array($code, $this->getAvailableCurrencyCodes())) { $this->_getSession()->setCurrencyCode($code); - $defaultCode = $this->_storeManager->getWebsite()->getDefaultStore()->getDefaultCurrency()->getCode(); + $defaultCode = ($this->_storeManager->getStore() !== null) + ? $this->_storeManager->getStore()->getDefaultCurrency()->getCode() + : $this->_storeManager->getWebsite()->getDefaultStore()->getDefaultCurrency()->getCode(); + $this->_httpContext->setValue(Context::CONTEXT_CURRENCY, $code, $defaultCode); } return $this; diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml index 023d5fc3587fb..1a7f24ed2aaa5 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminStoreGroupCreateActionGroup.xml @@ -24,4 +24,24 @@ <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> <see userInput="You saved the store." stepKey="seeSavedMessage" /> </actionGroup> + + <actionGroup name="AdminAddCustomWebSiteToStoreGroup"> + <arguments> + <argument name="storeGroup" defaultValue="customStoreGroup"/> + <argument name="website" defaultValue="customWebsite"/> + </arguments> + <amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/> + <click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/> + <fillField userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" stepKey="fillSearchStoreGroupField"/> + <click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/> + <see userInput="{{storeGroup.name}}" selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="verifyThatCorrectStoreGroupFound"/> + <click selector="{{AdminStoresGridSection.storeGrpNameInFirstRow}}" stepKey="clickEditExistingStoreRow"/> + <waitForPageLoad stepKey="waitForStoreGroupPageLoad" /> + <selectOption selector="{{AdminNewStoreGroupSection.storeGrpWebsiteDropdown}}" userInput="{{website.name}}" stepKey="selectWebsite" /> + <selectOption selector="{{AdminNewStoreGroupSection.storeRootCategoryDropdown}}" userInput="Default Category" stepKey="chooseRootCategory" /> + <click selector="{{AdminNewStoreGroupActionsSection.saveButton}}" stepKey="clickSaveStoreGroup" /> + <conditionalClick selector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" dependentSelector="{{AdminNewStoreGroupSection.acceptNewStoreGroupCreation}}" visible="true" stepKey="clickAcceptNewStoreGroupCreationButton"/> + <waitForElementVisible selector="{{AdminStoresGridSection.storeFilterTextField}}" stepKey="waitForPageReload"/> + <see userInput="You saved the store." stepKey="seeSavedMessage" /> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Store/Test/Mftf/Data/StoreData.xml b/app/code/Magento/Store/Test/Mftf/Data/StoreData.xml index 9c418e9ebd496..390fb5bfef53b 100644 --- a/app/code/Magento/Store/Test/Mftf/Data/StoreData.xml +++ b/app/code/Magento/Store/Test/Mftf/Data/StoreData.xml @@ -65,6 +65,80 @@ <data key="name" unique="suffix">StoreView</data> <data key="code" unique="suffix">StoreViewCode</data> </entity> + + <!-- For creation 10 Store Views--> + <entity name="storeViewData" type="store"> + <data key="group_id">1</data> + <data key="name" unique="suffix">storeView</data> + <data key="code" unique="suffix">storeView</data> + <data key="is_active">1</data> + <data key="store_id">null</data> + <data key="store_type">store</data> + <data key="store_action">add</data> + </entity> + <entity name="storeViewData1" type="store"> + <data key="group_id">1</data> + <data key="name" unique="suffix">storeView</data> + <data key="code" unique="suffix">storeView</data> + <data key="is_active">1</data> + <data key="store_id">null</data> + <data key="store_type">store</data> + <data key="store_action">add</data> + </entity> + <entity name="storeViewData2" type="store"> + <data key="group_id">1</data> + <data key="name" unique="suffix">storeView</data> + <data key="code" unique="suffix">storeView</data> + <data key="is_active">1</data> + <data key="store_id">null</data> + <data key="store_type">store</data> + <data key="store_action">add</data> + </entity> + <entity name="storeViewData3" type="store"> + <data key="group_id">1</data> + <data key="name" unique="suffix">storeView</data> + <data key="code" unique="suffix">storeView</data> + <data key="is_active">1</data> + <data key="store_id">null</data> + <data key="store_type">store</data> + <data key="store_action">add</data> + </entity> + <entity name="storeViewData4" type="store"> + <data key="group_id">1</data> + <data key="name" unique="suffix">storeView</data> + <data key="code" unique="suffix">storeView</data> + <data key="is_active">1</data> + <data key="store_id">null</data> + <data key="store_type">store</data> + <data key="store_action">add</data> + </entity> + <entity name="storeViewData5" type="store"> + <data key="group_id">1</data> + <data key="name" unique="suffix">storeView</data> + <data key="code" unique="suffix">storeView</data> + <data key="is_active">1</data> + <data key="store_id">null</data> + <data key="store_type">store</data> + <data key="store_action">add</data> + </entity> + <entity name="storeViewData6" type="store"> + <data key="group_id">1</data> + <data key="name" unique="suffix">storeView</data> + <data key="code" unique="suffix">storeView</data> + <data key="is_active">1</data> + <data key="store_id">null</data> + <data key="store_type">store</data> + <data key="store_action">add</data> + </entity> + <entity name="storeViewData7" type="store"> + <data key="group_id">1</data> + <data key="name" unique="suffix">storeView</data> + <data key="code" unique="suffix">storeView</data> + <data key="is_active">1</data> + <data key="store_id">null</data> + <data key="store_type">store</data> + <data key="store_action">add</data> + </entity> <entity name="SecondStoreUnique" type="store"> <data key="name" unique="suffix">Second Store View </data> <data key="code" unique="suffix">second_store_view_</data> diff --git a/app/code/Magento/Store/Test/Mftf/Section/AdminNewStoreGroupSection.xml b/app/code/Magento/Store/Test/Mftf/Section/AdminNewStoreGroupSection.xml index ea5d9aab8b26d..fb98c66983776 100644 --- a/app/code/Magento/Store/Test/Mftf/Section/AdminNewStoreGroupSection.xml +++ b/app/code/Magento/Store/Test/Mftf/Section/AdminNewStoreGroupSection.xml @@ -11,5 +11,6 @@ <element name="storeGrpNameTextField" type="input" selector="#group_name"/> <element name="storeGrpCodeTextField" type="input" selector="#group_code"/> <element name="storeRootCategoryDropdown" type="select" selector="#group_root_category_id"/> + <element name="acceptNewStoreGroupCreation" type="button" selector=".action-primary.action-accept" /> </section> </sections> diff --git a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml index 8d4400b3d0477..e00c41d371c9e 100644 --- a/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml +++ b/app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml @@ -21,7 +21,7 @@ $stores = $block->getStoresSortedBySortOrder(); <th class="col-draggable"></th> <th class="col-default"><span><?= $block->escapeHtml(__('Is Default')) ?></span></th> <?php foreach ($stores as $_store): ?> - <th class="col-swatch col-<%- data.id %> + <th class="col-swatch col-swatch-min-width col-<%- data.id %> <?php if ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> _required<?php endif; ?>" colspan="2"> <span><?= $block->escapeHtml($_store->getName()) ?></span> @@ -75,7 +75,7 @@ $stores = $block->getStoresSortedBySortOrder(); </td> <?php foreach ($stores as $_store): ?> <?php $storeId = (int)$_store->getId(); ?> - <td class="col-swatch col-<%- data.id %>"> + <td class="col-swatch col-swatch-min-width col-<%- data.id %>"> <input class="input-text swatch-text-field-<?= /* @noEscape */ $storeId ?> <?php if ($storeId == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> required-option required-unique<?php endif; ?>" @@ -83,7 +83,7 @@ $stores = $block->getStoresSortedBySortOrder(); type="text" value="<%- data.swatch<?= /* @noEscape */ $storeId ?> %>" placeholder="<?= $block->escapeHtml(__("Swatch")) ?>"/> </td> - <td class="swatch-col-<%- data.id %>"> + <td class="col-swatch-min-width swatch-col-<%- data.id %>"> <input name="optiontext[value][<%- data.id %>][<?= /* @noEscape */ $storeId ?>]" value="<%- data.store<?= /* @noEscape */ $storeId ?> %>" class="input-text<?php if ($storeId == \Magento\Store\Model\Store::DEFAULT_STORE_ID): ?> required-option<?php endif; ?>" diff --git a/app/code/Magento/Swatches/view/adminhtml/web/css/swatches.css b/app/code/Magento/Swatches/view/adminhtml/web/css/swatches.css index d170ed0345a03..1383634ef424c 100644 --- a/app/code/Magento/Swatches/view/adminhtml/web/css/swatches.css +++ b/app/code/Magento/Swatches/view/adminhtml/web/css/swatches.css @@ -149,6 +149,10 @@ width: 50px; } +.col-swatch-min-width { + min-width: 30px; +} + .swatches-visual-col.unavailable:after { content: ''; position: absolute; diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml index 596b72070bf7e..3986ede9acf63 100644 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml @@ -128,12 +128,12 @@ <!--Select Configuration menu from Store--> <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES" /> <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{StoresSubmenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> <waitForPageLoad stepKey="waitForSales"/> <!--Double click the same to fix flaky issue with redirection to Dashboard--> <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1" /> <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{StoresSubmenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> <waitForPageLoad stepKey="waitForSales1" time="5"/> <!--Change default tax class for Shipping on Taxable Goods--> <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales" /> @@ -156,12 +156,12 @@ <!--Select Configuration menu from Store--> <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES" /> <waitForPageLoad stepKey="waitForConfiguration"/> - <click selector="{{StoresSubmenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations"/> <waitForPageLoad stepKey="waitForSales"/> <!--Double click the same to fix flaky issue with redirection to Dashboard--> <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1" /> <waitForPageLoad stepKey="waitForConfiguration1"/> - <click selector="{{StoresSubmenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <click selector="{{AdminMenuSection.configuration}}" stepKey="clickOnConfigurations1"/> <waitForPageLoad stepKey="waitForSales1"/> <!--Change default tax class for Shipping on Taxable Goods--> <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales" /> diff --git a/app/code/Magento/Theme/etc/di.xml b/app/code/Magento/Theme/etc/di.xml index 148267feeaad0..62f51e74b6007 100644 --- a/app/code/Magento/Theme/etc/di.xml +++ b/app/code/Magento/Theme/etc/di.xml @@ -273,7 +273,7 @@ <type name="Magento\Config\App\Config\Source\DumpConfigSourceAggregated"> <plugin name="designConfigTheme" type="Magento\Theme\Model\Design\Config\Plugin\Dump" sortOrder="50"/> </type> - <type name="\Magento\Theme\Model\Design\Config\Plugin\Dump"> + <type name="Magento\Theme\Model\Design\Config\Plugin\Dump"> <arguments> <argument name="themeList" xsi:type="object">Magento\Theme\Model\ResourceModel\Theme\Collection</argument> </arguments> diff --git a/app/code/Magento/Ui/view/base/web/js/grid/editing/client.js b/app/code/Magento/Ui/view/base/web/js/grid/editing/client.js index f68a6f97d964f..ca82ff81d3b6f 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/editing/client.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/editing/client.js @@ -54,7 +54,7 @@ define([ /** * Proxy save method which might invoke - * data valiation prior to its' saving. + * data validation prior to its' saving. * * @param {Object} data - Data to be processed. * @returns {jQueryPromise} @@ -128,7 +128,7 @@ define([ /** * Handles ajax success callback. * - * @param {jQueryPromise} promise - Promise to be resoloved. + * @param {jQueryPromise} promise - Promise to be resolved. * @param {*} data - See 'jquery' ajax success callback. */ onSuccess: function (promise, data) { diff --git a/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js b/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js index a4785aea03743..ece49cc8fe27c 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/editing/editor.js @@ -357,7 +357,7 @@ define([ /** * Resets specific records' data - * to the data present in asscotiated row. + * to the data present in associated row. * * @param {(Number|String)} id - See 'getId' method. * @param {Boolean} [isIndex=false] - See 'getId' method. @@ -403,7 +403,7 @@ define([ /** * Disables editing of specified fields. * - * @param {Array} fields - An array of fields indeces to be disabled. + * @param {Array} fields - An array of fields indexes to be disabled. * @returns {Editor} Chainable. */ disableFields: function (fields) { diff --git a/app/code/Magento/Ui/view/base/web/js/grid/editing/record.js b/app/code/Magento/Ui/view/base/web/js/grid/editing/record.js index c648875e62d7c..9b8998368c5ff 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/editing/record.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/editing/record.js @@ -264,7 +264,7 @@ define([ /** * Validates all of the available fields. * - * @returns {Array} An array with validatation results. + * @returns {Array} An array with validation results. */ validate: function () { return this.elems.map('validate'); @@ -306,7 +306,7 @@ define([ }, /** - * Updates 'fields' array filling it with available edtiors + * Updates 'fields' array filling it with available editors * or with column instances if associated field is not present. * * @returns {Record} Chainable. diff --git a/app/code/Magento/Ups/Model/Carrier.php b/app/code/Magento/Ups/Model/Carrier.php index 06f68db05398f..43efb6a91c01f 100644 --- a/app/code/Magento/Ups/Model/Carrier.php +++ b/app/code/Magento/Ups/Model/Carrier.php @@ -332,6 +332,14 @@ public function setRequest(RateRequest $request) $destCountry = self::GUAM_COUNTRY_ID; } + // For UPS, Las Palmas and Santa Cruz de Tenerife will be represented by Canary Islands country + if ($destCountry === self::SPAIN_COUNTRY_ID && + ($request->getDestRegionCode() === self::LAS_PALMAS_REGION_ID + || $request->getDestRegionCode() === self::SANTA_CRUZ_DE_TENERIFE_REGION_ID) + ) { + $destCountry = self::CANARY_ISLANDS_COUNTRY_ID; + } + $country = $this->_countryFactory->create()->load($destCountry); $rowRequest->setDestCountry($country->getData('iso2_code') ?: $destCountry); @@ -1700,6 +1708,7 @@ public function getCustomizableContainerTypes() /** * Get delivery confirmation level based on origin/destination + * * Return null if delivery confirmation is not acceptable * * @param string|null $countyDestination diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminCreateRoleSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminCreateRoleSection.xml similarity index 84% rename from app/code/Magento/Braintree/Test/Mftf/Section/AdminCreateRoleSection.xml rename to app/code/Magento/User/Test/Mftf/Section/AdminCreateRoleSection.xml index 1158f471d51f0..eb8344008794f 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminCreateRoleSection.xml +++ b/app/code/Magento/User/Test/Mftf/Section/AdminCreateRoleSection.xml @@ -5,7 +5,8 @@ * See COPYING.txt for license details. */ --> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminCreateRoleSection"> <element name="create" type="button" selector="#add"/> <element name="name" type="button" selector="#role_name"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminDeleteRoleSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminDeleteRoleSection.xml similarity index 64% rename from app/code/Magento/Braintree/Test/Mftf/Section/AdminDeleteRoleSection.xml rename to app/code/Magento/User/Test/Mftf/Section/AdminDeleteRoleSection.xml index 220c9a444b02f..d3b19a3f00bcf 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminDeleteRoleSection.xml +++ b/app/code/Magento/User/Test/Mftf/Section/AdminDeleteRoleSection.xml @@ -5,8 +5,9 @@ * See COPYING.txt for license details. */ --> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> - <section name="AdminDeleteRoleSection"> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> +<section name="AdminDeleteRoleSection"> <element name="theRole" selector="//td[contains(text(), 'Role')]" type="button"/> <element name="current_pass" type="button" selector="#current_password"/> <element name="delete" selector="//button/span[contains(text(), 'Delete Role')]" type="button"/> diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminEditUserSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminEditUserSection.xml index 5b866b45e2fbe..64068a0a5ef58 100644 --- a/app/code/Magento/User/Test/Mftf/Section/AdminEditUserSection.xml +++ b/app/code/Magento/User/Test/Mftf/Section/AdminEditUserSection.xml @@ -5,8 +5,12 @@ * See COPYING.txt for license details. */ --> -<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminEditUserSection"> + <element name="system" type="input" selector="#menu-magento-backend-system"/> + <element name="allUsers" type="input" selector="//span[contains(text(), 'All Users')]"/> + <element name="create" type="input" selector="#add"/> <element name="usernameTextField" type="input" selector="#user_username"/> <element name="firstNameTextField" type="input" selector="#user_firstname"/> <element name="lastNameTextField" type="input" selector="#user_lastname"/> diff --git a/app/code/Magento/Wishlist/Controller/Index/Update.php b/app/code/Magento/Wishlist/Controller/Index/Update.php index 056d58b4c70be..b56aa4b5b3c8d 100755 --- a/app/code/Magento/Wishlist/Controller/Index/Update.php +++ b/app/code/Magento/Wishlist/Controller/Index/Update.php @@ -6,10 +6,14 @@ namespace Magento\Wishlist\Controller\Index; use Magento\Framework\App\Action; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\Controller\ResultFactory; -class Update extends \Magento\Wishlist\Controller\AbstractIndex +/** + * Class Update + */ +class Update extends \Magento\Wishlist\Controller\AbstractIndex implements HttpPostActionInterface { /** * @var \Magento\Wishlist\Controller\WishlistProviderInterface @@ -83,8 +87,6 @@ public function execute() )->defaultCommentString() ) { $description = ''; - } elseif (!strlen($description)) { - $description = $item->getDescription(); } $qty = null; diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml new file mode 100644 index 0000000000000..800b0a060edac --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfProdAddToCartWishListWithUnselectedAttrTest.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="ConfProdAddToCartWishListWithUnselectedAttrTest"> + <annotations> + <features value="Wishlist"/> + <group value="wishlist"/> + <title value="Adding configurable product to Cart from Wish List with unselected attributes"/> + <description value="Verify adding configurable product to Cart from Wish List when attributes is unselected"/> + <severity value="AVERAGE"/> + <testCaseId value="MAGETWO-95897"/> + <useCaseId value="MAGETWO-95837"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> + <createData entity="ApiCategory" stepKey="createCategory"/> + <!--Create Configurable product--> + <actionGroup ref="createConfigurableProduct" stepKey="createProduct"> + <argument name="product" value="_defaultProduct"/> + <argument name="category" value="$$createCategory$$"/> + </actionGroup> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + </before> + <after> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <!-- Delete the first simple product --> + <actionGroup stepKey="deleteProduct1" ref="deleteProductBySku"> + <argument name="sku" value="{{_defaultProduct.sku}}"/> + </actionGroup> + <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" + dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Login as customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForLogin"/> + + <!--Go To Created Product Page--> + <amOnPage stepKey="goToCreatedProductPage" url="{{_defaultProduct.urlKey}}.html"/> + <waitForPageLoad stepKey="waitForProductPageLoad2"/> + + <seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="checkDropDownProductOption"/> + <selectOption userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> + <selectOption userInput="{{colorProductAttribute2.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption2"/> + <click selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" stepKey="clickDropDownProductOption"/> + + <!--Click Add to Wish List link--> + <click selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="addFirstPnroductToWishlist"/> + + <!--Assert Correct Error Message--> + <see userInput="This is a required field" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsError}}" stepKey="seeError"/> + </test> +</tests> diff --git a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js index cab130f7c2104..7a166b47256cb 100644 --- a/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js +++ b/app/code/Magento/Wishlist/view/frontend/web/js/add-to-wishlist.js @@ -154,18 +154,12 @@ define([ $.each(elementValue, function (key, option) { data[elementName + '[' + option + ']'] = option; }); + } else if (elementName.substr(elementName.length - 2) == '[]') { //eslint-disable-line eqeqeq, max-depth + elementName = elementName.substring(0, elementName.length - 2); + + data[elementName + '[' + elementValue + ']'] = elementValue; } else { - if (elementValue) { //eslint-disable-line no-lonely-if - if (elementName.substr(elementName.length - 2) == '[]') { //eslint-disable-line eqeqeq, max-depth - elementName = elementName.substring(0, elementName.length - 2); - - if (elementValue) { //eslint-disable-line max-depth - data[elementName + '[' + elementValue + ']'] = elementValue; - } - } else { - data[elementName] = elementValue; - } - } + data[elementName] = elementValue; } return data; diff --git a/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less index 3355950254072..ffbbaeb084162 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Catalog/web/css/source/_module.less @@ -15,6 +15,14 @@ } } +.catalog-category-edit { + .admin__grid-control { + .admin__grid-control-value { + display: none; + } + } +} + .product-composite-configure-inner { .admin__control-text { &.qty { diff --git a/app/design/adminhtml/Magento/backend/Magento_Sales/web/css/source/module/_order.less b/app/design/adminhtml/Magento/backend/Magento_Sales/web/css/source/module/_order.less index 1e76679f594c1..fa1ae25628986 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Sales/web/css/source/module/_order.less +++ b/app/design/adminhtml/Magento/backend/Magento_Sales/web/css/source/module/_order.less @@ -92,6 +92,14 @@ margin: 0; padding: 0; } + .admin__data-grid-pager-wrap{ + .selectmenu { + margin-bottom: 10px; + } + } + .data-grid-search-control-wrap { + margin-bottom: 10px; + } } // diff --git a/app/design/adminhtml/Magento/backend/web/css/source/components/_modals_extend.less b/app/design/adminhtml/Magento/backend/web/css/source/components/_modals_extend.less index 95d7f8f65fdc1..efc747e4d714a 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/components/_modals_extend.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/components/_modals_extend.less @@ -146,13 +146,13 @@ } .action-close { - padding: @modal-popup__padding; + padding: @modal-popup__padding - 2; &:active, &:focus { background: transparent; - padding-right: @modal-popup__padding + (@modal-action-close__font-size - @modal-action-close__active__font-size) / 2; - padding-top: @modal-popup__padding + (@modal-action-close__font-size - @modal-action-close__active__font-size) / 2; + padding-right: @modal-popup__padding - 2; + padding-top: @modal-popup__padding - 2; } } } diff --git a/app/design/frontend/Magento/blank/Magento_Wishlist/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Wishlist/web/css/source/_module.less index 3746df14b9c62..eab36e9a837f2 100644 --- a/app/design/frontend/Magento/blank/Magento_Wishlist/web/css/source/_module.less +++ b/app/design/frontend/Magento/blank/Magento_Wishlist/web/css/source/_module.less @@ -212,6 +212,7 @@ &-actions { display: block; + float: left; .action { margin-right: 15px; diff --git a/app/design/frontend/Magento/blank/web/css/source/_navigation.less b/app/design/frontend/Magento/blank/web/css/source/_navigation.less index 4499886ef0f10..21b7315779764 100644 --- a/app/design/frontend/Magento/blank/web/css/source/_navigation.less +++ b/app/design/frontend/Magento/blank/web/css/source/_navigation.less @@ -131,12 +131,18 @@ ); } } - .switcher-dropdown { .lib-list-reset-styles(); + display: none; padding: @indent__s 0; } - + .switcher-options { + &.active { + .switcher-dropdown { + display: block; + } + } + } .header.links { .lib-list-reset-styles(); border-bottom: 1px solid @color-gray82; @@ -207,7 +213,7 @@ } .nav-toggle { - &:after{ + &:after { background: rgba(0, 0, 0, @overlay__opacity); content: ''; display: block; diff --git a/app/design/frontend/Magento/luma/Magento_Bundle/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Bundle/web/css/source/_module.less index 43ae23bab7895..eeb17653c877b 100644 --- a/app/design/frontend/Magento/luma/Magento_Bundle/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Bundle/web/css/source/_module.less @@ -253,7 +253,7 @@ .box-tocart { .action.primary { margin-right: 1%; - width: 49%; + width: auto; } } 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 5aaf0cd02fab9..c7d659810f522 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 @@ -492,6 +492,17 @@ } } } + + .cart.table-wrapper, + .order-items.table-wrapper { + .col.price, + .col.qty, + .col.subtotal, + .col.msrp { + text-align: left; + } + } + } // diff --git a/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/_module.less index a3896e41c94bc..e5d03fb9f2fcb 100644 --- a/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Wishlist/web/css/source/_module.less @@ -221,6 +221,7 @@ &-actions { display: block; + float: left; .action { margin-right: 15px; diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml index 521d7d68ac4a6..5cb5b4db72769 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Repository/SalesRule.xml @@ -271,7 +271,7 @@ <field name="coupon_type" xsi:type="string">No Coupon</field> <field name="sort_order" xsi:type="string">1</field> <field name="is_rss" xsi:type="string">Yes</field> - <field name="conditions_serialized" xsi:type="string">[Total Items Quantity|equals or greater than|3]{Product attribute combination|FOUND|ALL|:[[Category|is|2]]}</field> + <field name="conditions_serialized" xsi:type="string">[Total Items Quantity|equals or greater than|3]</field> <field name="simple_action" xsi:type="string">Percent of product price discount</field> <field name="discount_amount" xsi:type="string">25</field> <field name="apply_to_shipping" xsi:type="string">No</field> diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ApplySeveralSalesRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ApplySeveralSalesRuleEntityTest.xml index e160fef609545..3dfe4cf118552 100644 --- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ApplySeveralSalesRuleEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/ApplySeveralSalesRuleEntityTest.xml @@ -31,7 +31,6 @@ <constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleConditionIsApplied" /> </variation> <variation name="ApplySeveralSalesRuleEntityTestVariation3" summary="Rules with different priority, both are applied"> - <data name="tag" xsi:type="string">stable:no</data> <data name="salesRules/rule1" xsi:type="string">active_sales_rule_product_attribute</data> <data name="salesRules/rule2" xsi:type="string">active_sales_total_items</data> <data name="cartPrice/sub_total" xsi:type="string">250.00</data> @@ -44,7 +43,6 @@ <constraint name="Magento\SalesRule\Test\Constraint\AssertCartPriceRuleConditionIsApplied" /> </variation> <variation name="ApplySeveralSalesRuleEntityTestVariation4" summary="Rules with different priority, none are applied"> - <data name="tag" xsi:type="string">to_maintain:yes</data> <data name="salesRules/rule1" xsi:type="string">active_sales_rule_row_total</data> <data name="salesRules/rule2" xsi:type="string">active_sales_total_items</data> <data name="productForSalesRule1/dataset" xsi:type="string">simple_for_salesrule_1</data> diff --git a/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php index 794fce17480fa..a5c69bcd3239e 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Model/CustomerMetadataTest.php @@ -239,10 +239,10 @@ public function testGetCustomerAttributeMetadata() $this->assertNotEmpty($attributes); // remove odd extension attributes - $allAtrributes = $expectAttrsWithVals; - $allAtrributes['created_at'] = $attributes['created_at']; - $allAtrributes['updated_at'] = $attributes['updated_at']; - $attributes = array_intersect_key($attributes, $allAtrributes); + $allAttributes = $expectAttrsWithVals; + $allAttributes['created_at'] = $attributes['created_at']; + $allAttributes['updated_at'] = $attributes['updated_at']; + $attributes = array_intersect_key($attributes, $allAttributes); foreach ($attributes as $attributeCode => $attributeValue) { $this->assertNotNull($attributeCode); diff --git a/lib/internal/LinLibertineFont/ChangeLog.txt b/lib/internal/LinLibertineFont/ChangeLog.txt index 8dc2c56567a4b..83b8792e71eda 100644 --- a/lib/internal/LinLibertineFont/ChangeLog.txt +++ b/lib/internal/LinLibertineFont/ChangeLog.txt @@ -952,7 +952,7 @@ Changes to version 0.5.8 regular(|) & italic(/) (20040315) Changes to version 0.5.7 regular(|) & italic(/) (20040315) -N is now 66pt wider -^ {Ascicircum} is now better -- {exclamdown} is now availible +- {exclamdown} is now available - {currency} has been added | "-" hyphen is the same as softhyphen. length is now 510pt -bars have been made diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig.php b/lib/internal/Magento/Framework/App/DeploymentConfig.php index 615c295675adc..40b03b068d6ab 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig.php @@ -70,6 +70,11 @@ public function get($key = null, $defaultValue = null) if ($key === null) { return $this->flatData; } + + if (array_key_exists($key, $this->flatData) && $this->flatData[$key] === null) { + return ''; + } + return $this->flatData[$key] ?? $defaultValue; } @@ -146,6 +151,8 @@ private function load() } /** + * Array keys conversion + * * Convert associative array of arbitrary depth to a flat associative array with concatenated key path as keys * each level of array is accessible by path key * diff --git a/lib/internal/Magento/Framework/DB/Adapter/AdapterInterface.php b/lib/internal/Magento/Framework/DB/Adapter/AdapterInterface.php index 5c9bc9c2fb2d7..f654fd263f605 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/AdapterInterface.php +++ b/lib/internal/Magento/Framework/DB/Adapter/AdapterInterface.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Framework\DB\Adapter; use Magento\Framework\DB\Ddl\Table; @@ -365,6 +366,7 @@ public function getIndexList($tableName, $schemaName = null); /** * Add new Foreign Key to table + * * If Foreign Key with same name is exist - it will be deleted * * @param string $fkName @@ -373,7 +375,6 @@ public function getIndexList($tableName, $schemaName = null); * @param string $refTableName * @param string $refColumnName * @param string $onDelete - * @param string $onUpdate * @param boolean $purge trying remove invalid data * @param string $schemaName * @param string $refSchemaName @@ -484,6 +485,7 @@ public function insert($table, array $bind); /** * Inserts a table row with specified data + * * Special for Zero values to identity column * * @param string $table @@ -502,9 +504,9 @@ public function insertForce($table, array $bind); * If the $where parameter is an array of multiple clauses, they will be joined by AND, with each clause wrapped in * parenthesis. If you wish to use an OR, you must give a single clause that is an instance of {@see Zend_Db_Expr} * - * @param mixed $table The table to update. - * @param array $bind Column-value pairs. - * @param mixed $where UPDATE WHERE clause(s). + * @param mixed $table The table to update. + * @param array $bind Column-value pairs. + * @param mixed $where UPDATE WHERE clause(s). * @return int The number of affected rows. */ public function update($table, array $bind, $where = ''); @@ -512,8 +514,8 @@ public function update($table, array $bind, $where = ''); /** * Deletes table rows based on a WHERE clause. * - * @param mixed $table The table to update. - * @param mixed $where DELETE WHERE clause(s). + * @param mixed $table The table to update. + * @param mixed $where DELETE WHERE clause(s). * @return int The number of affected rows. */ public function delete($table, $where = ''); @@ -521,31 +523,33 @@ public function delete($table, $where = ''); /** * Prepares and executes an SQL statement with bound data. * - * @param mixed $sql The SQL statement with placeholders. + * @param mixed $sql The SQL statement with placeholders. * May be a string or \Magento\Framework\DB\Select. - * @param mixed $bind An array of data or data itself to bind to the placeholders. + * @param mixed $bind An array of data or data itself to bind to the placeholders. * @return \Zend_Db_Statement_Interface */ public function query($sql, $bind = []); /** * Fetches all SQL result rows as a sequential array. + * * Uses the current fetchMode for the adapter. * - * @param string|\Magento\Framework\DB\Select $sql An SQL SELECT statement. - * @param mixed $bind Data to bind into SELECT placeholders. - * @param mixed $fetchMode Override current fetch mode. + * @param string|\Magento\Framework\DB\Select $sql An SQL SELECT statement. + * @param mixed $bind Data to bind into SELECT placeholders. + * @param mixed $fetchMode Override current fetch mode. * @return array */ public function fetchAll($sql, $bind = [], $fetchMode = null); /** * Fetches the first row of the SQL result. + * * Uses the current fetchMode for the adapter. * * @param string|\Magento\Framework\DB\Select $sql An SQL SELECT statement. * @param mixed $bind Data to bind into SELECT placeholders. - * @param mixed $fetchMode Override current fetch mode. + * @param mixed $fetchMode Override current fetch mode. * @return array */ public function fetchRow($sql, $bind = [], $fetchMode = null); @@ -622,9 +626,9 @@ public function quote($value, $type = null); * // $safe = "WHERE date < '2005-01-02'" * </code> * - * @param string $text The text with a placeholder. - * @param mixed $value The value to quote. - * @param string $type OPTIONAL SQL datatype + * @param string $text The text with a placeholder. + * @param mixed $value The value to quote. + * @param string $type OPTIONAL SQL datatype * @param integer $count OPTIONAL count of placeholders to replace * @return string An SQL-safe quoted value placed into the original text. */ @@ -633,7 +637,7 @@ public function quoteInto($text, $value, $type = null, $count = null); /** * Quotes an identifier. * - * Accepts a string representing a qualified indentifier. For Example: + * Accepts a string representing a qualified identifier. For Example: * <code> * $adapter->quoteIdentifier('myschema.mytable') * </code> @@ -721,7 +725,8 @@ public function disallowDdlCache(); /** * Reset cached DDL data from cache - * if table name is null - reset all cached DDL data + * + * If table name is null - reset all cached DDL data * * @param string $tableName * @param string $schemaName OPTIONAL @@ -741,6 +746,7 @@ public function saveDdlCache($tableCacheKey, $ddlType, $data); /** * Load DDL data from cache + * * Return false if cache does not exists * * @param string $tableCacheKey the table cache key @@ -784,6 +790,7 @@ public function prepareSqlCondition($fieldName, $condition); /** * Prepare value for save in column + * * Return converted to column data type value * * @param array $column the column describe array @@ -813,6 +820,7 @@ public function getIfNullSql($expression, $value = 0); /** * Generate fragment of SQL, that combine together (concatenate) the results from data array + * * All arguments in data must be quoted * * @param array $data @@ -823,6 +831,7 @@ public function getConcatSql(array $data, $separator = null); /** * Generate fragment of SQL that returns length of character string + * * The string argument must be quoted * * @param string $string @@ -931,6 +940,7 @@ public function getDateExtractSql($date, $unit); /** * Retrieve valid table name + * * Check table name length and allowed symbols * * @param string $tableName @@ -950,6 +960,7 @@ public function getTriggerName($tableName, $time, $event); /** * Retrieve valid index name + * * Check index name length and allowed symbols * * @param string $tableName @@ -961,6 +972,7 @@ public function getIndexName($tableName, $fields, $indexType = ''); /** * Retrieve valid foreign key name + * * Check foreign key name length and allowed symbols * * @param string $priTableName @@ -1047,6 +1059,7 @@ public function supportStraightJoin(); /** * Adds order by random to select object + * * Possible using integer field for optimization * * @param \Magento\Framework\DB\Select $select @@ -1074,6 +1087,7 @@ public function getPrimaryKeyName($tableName, $schemaName = null); /** * Converts fetched blob into raw binary PHP data. + * * Some DB drivers return blobs as hex-coded strings, so we need to process them. * * @param mixed $value @@ -1114,6 +1128,8 @@ public function dropTrigger($triggerName, $schemaName = null); public function getTables($likeCondition = null); /** + * Generates case SQL fragment + * * Generate fragment of SQL, that check value against multiple condition cases * and return different result depends on them * diff --git a/lib/internal/Magento/Framework/Option/ArrayPool.php b/lib/internal/Magento/Framework/Option/ArrayPool.php index 5ac349d99b82e..11e1b46ff0363 100644 --- a/lib/internal/Magento/Framework/Option/ArrayPool.php +++ b/lib/internal/Magento/Framework/Option/ArrayPool.php @@ -28,13 +28,14 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan * * @param string $model * @throws \InvalidArgumentException - * @return \Magento\Framework\Option\ArrayInterface + * @return \Magento\Framework\Data\OptionSourceInterface */ public function get($model) { $modelInstance = $this->_objectManager->get($model); - if (false == $modelInstance instanceof \Magento\Framework\Option\ArrayInterface) { - throw new \InvalidArgumentException($model . 'doesn\'t implement \Magento\Framework\Option\ArrayInterface'); + if (false == $modelInstance instanceof \Magento\Framework\Data\OptionSourceInterface) { + throw new \InvalidArgumentException($model + . 'doesn\'t implement \Magento\Framework\Data\OptionSourceInterface'); } return $modelInstance; } diff --git a/phpserver/README.md b/phpserver/README.md index 414ad77ae6b33..563d2ed7c9fc9 100644 --- a/phpserver/README.md +++ b/phpserver/README.md @@ -31,7 +31,7 @@ For more informations about the installation process using the CLI, you can cons ### How to run Magento -Example usage: ```php -S 127.0.0.1:8082 -t ./pub/ ../phpserver/router.php``` +Example usage: ```php -S 127.0.0.1:8082 -t ./pub/ ./phpserver/router.php``` ### What exactly the script does diff --git a/setup/src/Magento/Setup/Console/Command/InstallCommand.php b/setup/src/Magento/Setup/Console/Command/InstallCommand.php index 74c2e3b24234c..cc1cca74ed6df 100644 --- a/setup/src/Magento/Setup/Console/Command/InstallCommand.php +++ b/setup/src/Magento/Setup/Console/Command/InstallCommand.php @@ -183,7 +183,7 @@ protected function configure() self::INPUT_KEY_INTERACTIVE_SETUP, self::INPUT_KEY_INTERACTIVE_SETUP_SHORTCUT, InputOption::VALUE_NONE, - 'Interactive Magento instalation' + 'Interactive Magento installation' ), new InputOption( OperationsExecutor::KEY_SAFE_MODE,