From 7539afebec222583db32eea1b86f2f362d0104ef Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza Date: Tue, 26 Mar 2019 09:36:01 +0100 Subject: [PATCH 001/230] Convert OnePageCheckoutJsValidationTest to MFTF --- ...refrontOnePageCheckoutJsValidationTest.xml | 37 +++++++++++++++++++ .../OnePageCheckoutJsValidationTest.xml | 1 + 2 files changed, 38 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml new file mode 100644 index 000000000000..b699ecdc5a15 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml @@ -0,0 +1,37 @@ + + + + + + + + + <description value="Js validation error messages must be absent for required fields after checkout start."/> + <group value="shoppingCart"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <createData entity="ApiSimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart"/> + <waitForPageLoad stepKey="waitForCheckoutPage"/> + </before> + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + </after> + + <dontSeeElement selector="div .field-error" stepKey="dontSeeValidationErrors"/> + </test> +</tests> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml index 75603d12cbe3..65ae2dd442d7 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml @@ -12,6 +12,7 @@ <data name="tag" xsi:type="string">severity:S2</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="checkoutMethod" xsi:type="string">guest</data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Checkout\Test\Constraint\AssertShippingAddressJsValidationMessagesIsAbsent" /> </variation> </testCase> From 2567e0609b911adf6ea3ad7f78c3cbf67506ec25 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 2 Apr 2019 18:12:56 +0300 Subject: [PATCH 002/230] Adjusting some typos --- .../Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml | 4 ++-- app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml index 610676b35045..4d36cd0669b8 100644 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml @@ -9,7 +9,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="CreateCustomVariableActionGroup"> - <amOnPage url="admin/admin/system_variable/new/" stepKey="goToNewCustomVarialePage" /> + <amOnPage url="admin/admin/system_variable/new/" stepKey="goToNewCustomVariablePage" /> <waitForPageLoad stepKey="waitForPageLoad" /> <fillField selector="{{CustomVariableSection.variableCode}}" userInput="{{customVariable.code}}" stepKey="fillVariableCode" /> <fillField selector="{{CustomVariableSection.variableName}}" userInput="{{customVariable.name}}" stepKey="fillVariableName" /> @@ -18,7 +18,7 @@ <click selector="{{CustomVariableSection.saveCustomVariable}}" stepKey="clickSaveVariable"/> </actionGroup> <actionGroup name="DeleteCustomVariableActionGroup"> - <amOnPage url="admin/admin/system_variable/" stepKey="goToVarialeGrid" /> + <amOnPage url="admin/admin/system_variable/" stepKey="goToVariableGrid" /> <waitForPageLoad stepKey="waitForPageLoad1" /> <click selector="{{CustomVariableSection.GridCustomVariableCode(customVariable.code)}}" stepKey="goToCustomVariableEditPage" /> <waitForPageLoad stepKey="waitForPageLoad2" /> diff --git a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml index 7b7fd768f0ab..4ce0d244560f 100644 --- a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml +++ b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml @@ -11,8 +11,8 @@ <entity name="_defaultVariable" type="cms_page"> <data key="city"> Austin </data> </entity> - <entity name="customVariable" type="cms_page"> - <data key="code" unique="suffix">variale-code</data> + <entity name="customVariable" type="variable"> + <data key="code" unique="suffix">variable-code</data> <data key="name">Test Variable</data> <data key="html"> Sample Variable </data> <data key="plain">variable-plain-</data> From d7fc607450c72b9982449f9a2d2d8c8341620f1c Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 2 Apr 2019 19:33:01 +0300 Subject: [PATCH 003/230] Marking the variation as migrated to MFTF --- .../Variable/Test/TestCase/CreateCustomVariableEntityTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/CreateCustomVariableEntityTest.xml b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/CreateCustomVariableEntityTest.xml index d118e835c6c6..9f3fb647575e 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/CreateCustomVariableEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/CreateCustomVariableEntityTest.xml @@ -13,6 +13,7 @@ <data name="customVariable/data/name" xsi:type="string">variableName%isolation%</data> <data name="customVariable/data/html_value" xsi:type="string"><h1>variableName%isolation%</h1></data> <data name="customVariable/data/plain_value" xsi:type="string"><p>variablePlainText%isolation%</p></data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Variable\Test\Constraint\AssertCustomVariableSuccessSaveMessage" /> <constraint name="Magento\Variable\Test\Constraint\AssertCustomVariableInGrid" /> <constraint name="Magento\Variable\Test\Constraint\AssertCustomVariableForm" /> From 331b78ced63482627260c38c2e373459c3ee1ff1 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 2 Apr 2019 20:17:47 +0300 Subject: [PATCH 004/230] Convert CreateCustomVariableEntityTest to MFTF --- .../AdminAssertSuccessAddedActionGroup.xml | 16 ++++++++ .../FilterVariablesGridActionGroup.xml | 22 +++++++++++ .../NavigateToNewVariablePageActionGroup.xml | 15 ++++++++ .../NavigateToVariablesPageActionGroup.xml | 15 ++++++++ .../Test/Mftf/Page/AdminNewVariablePage.xml | 14 +++++++ .../Test/Mftf/Page/AdminVariablesPage.xml | 16 ++++++++ .../Section/AdminVariableMessagesSection.xml | 15 ++++++++ .../Section/AdminVariablesFilterSection.xml | 17 +++++++++ .../Section/AdminVariablesGridSection.xml | 15 ++++++++ .../Test/CreateCustomVariableEntityTest.xml | 37 +++++++++++++++++++ 10 files changed, 182 insertions(+) create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminAssertSuccessAddedActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/FilterVariablesGridActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToNewVariablePageActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToVariablesPageActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/Page/AdminNewVariablePage.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/Page/AdminVariablesPage.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/Section/AdminVariableMessagesSection.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesGridSection.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminAssertSuccessAddedActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminAssertSuccessAddedActionGroup.xml new file mode 100644 index 000000000000..fd1f7870896e --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminAssertSuccessAddedActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertSuccessMessageActionGroup" > + <see userInput="You saved the custom variable." selector="{{AdminVariableMessagesSection.successMessage}}" stepKey="seeMessage"/> + </actionGroup> + <actionGroup name="AdminSeeVariableInGridActionGroup"> + <see selector="{{AdminVariablesGridSection.rowByValue(customVariable.code)}}" userInput="{{customVariable.code}}" stepKey="seeVariableCodeInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/FilterVariablesGridActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/FilterVariablesGridActionGroup.xml new file mode 100644 index 000000000000..b40725eb781c --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/FilterVariablesGridActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="FilterVariablesGridActionGroup"> + <arguments> + <argument name="field" type="string"/> + <argument name="value" type="string"/> + </arguments> + <fillField selector="{{field}}" userInput="{{value}}" stepKey="fillVariableAttributeInFilter"/> + <click selector="{{AdminVariablesFilterSection.searchButton}}" stepKey="clickSearchButton"/> + </actionGroup> + <actionGroup name="ResetFilterVariablesGridActionGroup"> + <click selector="{{AdminVariablesFilterSection.resetFilterButton}}" stepKey="clickResetButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToNewVariablePageActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToNewVariablePageActionGroup.xml new file mode 100644 index 000000000000..ee80bcc86131 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToNewVariablePageActionGroup.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="NavigateToNewVariablePageActionGroup"> + <amOnPage url="{{AdminNewVariablePage.url}}" stepKey="openNewVariablePage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToVariablesPageActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToVariablesPageActionGroup.xml new file mode 100644 index 000000000000..f4c00b7b6039 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToVariablesPageActionGroup.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="NavigateToVariablesPage"> + <amOnPage url="{{AdminVariablesPage.url}}" stepKey="openVariablesGridPage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/Page/AdminNewVariablePage.xml b/app/code/Magento/Variable/Test/Mftf/Page/AdminNewVariablePage.xml new file mode 100644 index 000000000000..6d09424e44d2 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Page/AdminNewVariablePage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminNewVariablePage" url="/admin/system_variable/new/" area="admin" module="Magento_Variable"> + <section name="AdminNewVariableSection"/> + </page> +</pages> diff --git a/app/code/Magento/Variable/Test/Mftf/Page/AdminVariablesPage.xml b/app/code/Magento/Variable/Test/Mftf/Page/AdminVariablesPage.xml new file mode 100644 index 000000000000..ceb53072b7cf --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Page/AdminVariablesPage.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminVariablesPage" url="/admin/system_variable/index/" area="admin" module="Magento_Variable"> + <section name="AdminVariableMessagesSection"/> + <section name="AdminVariablesFilterSection"/> + <section name="AdminVariablesGridSection"/> + </page> +</pages> diff --git a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableMessagesSection.xml b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableMessagesSection.xml new file mode 100644 index 000000000000..0acebbd8be88 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableMessagesSection.xml @@ -0,0 +1,15 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminVariableMessagesSection"> + <element name="successMessage" type="text" selector=".message-success"/> + <element name="errorMessage" type="text" selector=".message.message-error.error"/> + </section> +</sections> diff --git a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml new file mode 100644 index 000000000000..3976a5f63e1a --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml @@ -0,0 +1,17 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminVariablesFilterSection"> + <element name="searchButton" type="button" selector="button.action-default[title='Search']"/> + <element name="resetFilterButton" type="button" selector="button.action-reset[title='Reset Filter']"/> + <element name="codeFilter" type="input" selector="input.admin__control-text[name='code']"/> + <element name="nameFilter" type="input" selector="input.admin__control-text[name='name']"/> + </section> +</sections> diff --git a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesGridSection.xml b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesGridSection.xml new file mode 100644 index 000000000000..be91edf59d9c --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesGridSection.xml @@ -0,0 +1,15 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminVariablesGridSection"> + <element name="variablesGrid" type="text" selector="table[data-role='grid']"/> + <element name="rowByValue" type="text" selector="//td[text()[contains(.,'{{var}}')]]" parameterized="true" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml new file mode 100644 index 000000000000..41bbff38e667 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml @@ -0,0 +1,37 @@ +<?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="CreateCustomVariableEntityTest"> + <annotations> + <features value="Variable"/> + <stories value="Create Custom Variable."/> + <title value="Create Custom Variable."/> + <description value="Test for creating a custom variable."/> + <severity value="MAJOR"/> + <group value="variable"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <actionGroup ref="CreateCustomVariableActionGroup" stepKey="createCustomVariable"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <actionGroup ref="AdminAssertSuccessMessageActionGroup" stepKey="seeSuccessMessage"/> + <actionGroup ref="FilterVariablesGridActionGroup" stepKey="filterVariablesGridByNewVariableCode" > + <argument name="field" value="{{AdminVariablesFilterSection.codeFilter}}"/> + <argument name="value" value="{{customVariable.code}}"/> + </actionGroup> + <actionGroup ref="AdminSeeVariableInGridActionGroup" stepKey="seeNewVariableInGrid"/> + <after> + <actionGroup ref="ResetFilterVariablesGridActionGroup" stepKey="resetVariablesGrid"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + </test> +</tests> From b5afedf5f51503733975373ea925cf43f2289229 Mon Sep 17 00:00:00 2001 From: Leandry <leandry@atwix.com> Date: Wed, 3 Apr 2019 13:22:34 +0300 Subject: [PATCH 005/230] Convert LockAdminUserWhenCreatingNewIntegrationTest to MFTF --- .../Mftf/Section/AdminLoginFormSection.xml | 1 + .../Mftf/Data/AdminNewIntegrationData.xml | 14 +++ .../Mftf/Page/AdminNewIntegrationPage.xml | 14 +++ .../Section/AdminNewIntegrationSection.xml | 16 ++++ ...ewIntegrationRequiredFieldsActionGroup.xml | 25 ++++++ ...dminUserWhenCreatingNewIntegrationTest.xml | 85 +++++++++++++++++++ 6 files changed, 155 insertions(+) create mode 100644 app/code/Magento/Integration/Test/Mftf/Data/AdminNewIntegrationData.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml create mode 100644 app/code/Magento/Security/Test/Mftf/ActionGroup/AdminNewIntegrationRequiredFieldsActionGroup.xml create mode 100644 app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenCreatingNewIntegrationTest.xml diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml index 3b10fac7bb9d..58efb66747b1 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml @@ -12,5 +12,6 @@ <element name="username" type="input" selector="#username"/> <element name="password" type="input" selector="#login"/> <element name="signIn" type="button" selector=".actions .action-primary" timeout="30"/> + <element name="error" type="text" selector=".message.message-error.error"/> </section> </sections> diff --git a/app/code/Magento/Integration/Test/Mftf/Data/AdminNewIntegrationData.xml b/app/code/Magento/Integration/Test/Mftf/Data/AdminNewIntegrationData.xml new file mode 100644 index 000000000000..1307320ffb8f --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/Data/AdminNewIntegrationData.xml @@ -0,0 +1,14 @@ +<?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="AdminNewIntegrationData" type="admin"> + <data key="integrationName" unique="prefix">_Integration</data> + </entity> +</entities> diff --git a/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml b/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml new file mode 100644 index 000000000000..c4b0695a05bf --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminNewIntegrationPage" url="admin/integration/new/" area="admin" module="Magento_Integration"> + <section name="AdminNewIntegrationSection"/> + </page> +</pages> diff --git a/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml b/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml new file mode 100644 index 000000000000..7a193df73063 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml @@ -0,0 +1,16 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminNewIntegrationSection"> + <element name="integrationName" type="input" selector="#integration_properties_name"/> + <element name="currentPassword" type="input" selector="#integration_properties_current_password"/> + <element name="save" type="button" selector="#save-split-button-button"/> + </section> +</sections> diff --git a/app/code/Magento/Security/Test/Mftf/ActionGroup/AdminNewIntegrationRequiredFieldsActionGroup.xml b/app/code/Magento/Security/Test/Mftf/ActionGroup/AdminNewIntegrationRequiredFieldsActionGroup.xml new file mode 100644 index 000000000000..bb35660ca8ed --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/ActionGroup/AdminNewIntegrationRequiredFieldsActionGroup.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminNewIntegrationRequiredFieldsActionGroup"> + <arguments> + <argument name="integrationName" type="string" /> + <argument name="currentAdminPassword" type="string" /> + <argument name="message" type="string" defaultValue="The integration '{{AdminNewIntegrationData.integrationName}}' has been saved." /> + <argument name="messageSelector" type="string" defaultValue="{{AdminMessagesSection.success}}" /> + </arguments> + <!-- Fill all Required Fields. --> + <fillField selector="{{AdminNewIntegrationSection.integrationName}}" userInput="{{integrationName}}" stepKey="fillIntegrationName"/> + <fillField selector="{{AdminNewIntegrationSection.currentPassword}}" userInput="{{currentAdminPassword}}" stepKey="fillCurrentUserPassword"/> + <scrollToTopOfPage stepKey="ScrollToTopOfPage"/> + <click selector="{{AdminNewIntegrationSection.save}}" stepKey="saveNewIntegration"/> + <waitForPageLoad stepKey="waitForSaveResultLoad"/> + <see userInput="{{message}}" selector="{{messageSelector}}" stepKey="verifyMessage" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenCreatingNewIntegrationTest.xml b/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenCreatingNewIntegrationTest.xml new file mode 100644 index 000000000000..fcef652dfeb9 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenCreatingNewIntegrationTest.xml @@ -0,0 +1,85 @@ +<?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="LockAdminUserWhenCreatingNewIntegrationTest"> + <annotations> + <features value="Security"/> + <stories value="Runs Lock admin user when creating new integration test."/> + <title value="Lock admin user when creating new integration"/> + <description value="Runs Lock admin user when creating new integration test."/> + <severity value="MAJOR"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <!-- Log in to Admin Panel --> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Unlock Admin user --> + <magentoCLI command="admin:user:unlock {{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey="unlockAdminUser"/> + </after> + + <!-- Open Admin New Integration Page --> + <amOnPage url="{{AdminNewIntegrationPage.url}}" stepKey="amOnNewAdminIntegrationPage"/> + <waitForPageLoad stepKey="waitForNewAdminIntegrationPageLoad"/> + + <!-- Perform add new admin user 6 specified number of times. + "The password entered for the current user is invalid. Verify the password and try again." appears after each attempt.--> + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationFirstAttempt"> + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + </actionGroup> + + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationSecondAttempt"> + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + </actionGroup> + + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationThirdAttempt"> + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + </actionGroup> + + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationFourthAttempt"> + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + </actionGroup> + + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationFifthAttempt"> + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + </actionGroup> + + <!-- Last invalid current password save integration attempt and check logout error --> + <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationLastAttempt"> + <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + <argument name="messageSelector" value="{{AdminLoginFormSection.error}}" /> + <argument name="message" value="Your account is temporarily disabled. Please try again later." /> + </actionGroup> + + <!-- Try to login as admin and check error --> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> + <waitForPageLoad stepKey="waitForError"/> + <see selector="{{AdminLoginFormSection.error}}" userInput="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later" + stepKey="seeLoginUserError"/> + </test> +</tests> From 421d73655d8c05771f312382e2d397cb99ec3fe0 Mon Sep 17 00:00:00 2001 From: Leandry <leandry@atwix.com> Date: Wed, 3 Apr 2019 13:26:59 +0300 Subject: [PATCH 006/230] add mftf_migrated:yes tag to old test --- .../TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml index f3012d9a2e2c..d9c45881b59d 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml @@ -18,6 +18,7 @@ <data name="integration/data/current_password" xsi:type="string">incorrect password</data> <data name="integration/data/resource_access" xsi:type="string">All</data> <data name="attempts" xsi:type="string">4</data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Security\Test\Constraint\AssertUserIsLocked" /> </variation> </testCase> From d20307729a50eb0087c50586cda8331fb60dbbaf Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 3 Apr 2019 13:50:30 +0300 Subject: [PATCH 007/230] Reverting the customVariable type --- app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml index 4ce0d244560f..1160b7902661 100644 --- a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml +++ b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml @@ -11,7 +11,7 @@ <entity name="_defaultVariable" type="cms_page"> <data key="city"> Austin </data> </entity> - <entity name="customVariable" type="variable"> + <entity name="customVariable" type="cms_page"> <data key="code" unique="suffix">variable-code</data> <data key="name">Test Variable</data> <data key="html"> Sample Variable </data> From ca67289a8ce2706e650d4cbff655a4e15902e5cd Mon Sep 17 00:00:00 2001 From: Leandry <leandry@atwix.com> Date: Wed, 3 Apr 2019 19:27:23 +0300 Subject: [PATCH 008/230] Convert LockAdminUserWhenEditingUserTest to MFTF --- .../Mftf/Section/AdminLoginFormSection.xml | 1 + .../Test/LockAdminUserWhenEditingUserTest.xml | 117 ++++++++++++++++++ .../ActionGroup/AdminEditUserActionGroup.xml | 53 ++++++++ .../Mftf/Section/AdminEditUserSection.xml | 1 + .../LockAdminUserWhenEditingUserTest.xml | 1 + 5 files changed, 173 insertions(+) create mode 100644 app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenEditingUserTest.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminEditUserActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml index 3b10fac7bb9d..58efb66747b1 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml @@ -12,5 +12,6 @@ <element name="username" type="input" selector="#username"/> <element name="password" type="input" selector="#login"/> <element name="signIn" type="button" selector=".actions .action-primary" timeout="30"/> + <element name="error" type="text" selector=".message.message-error.error"/> </section> </sections> diff --git a/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenEditingUserTest.xml b/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenEditingUserTest.xml new file mode 100644 index 000000000000..a7952cdb6e88 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenEditingUserTest.xml @@ -0,0 +1,117 @@ +<?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="LockAdminUserWhenEditingUserTest"> + <annotations> + <features value="Security"/> + <stories value="Runs Lock admin user when creating new user test."/> + <title value="Lock admin user when creating new user"/> + <description value="Runs Lock admin user when creating new user test."/> + <severity value="MAJOR"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="Admin3" stepKey="user"/> + <!-- Log in to Admin Panel --> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Unlock Admin user --> + <magentoCLI command="admin:user:unlock {{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey="unlockAdminUser"/> + <!-- TODO Need to create delete operation for data entity="Admin3" + <deleteData createDataKey="user" stepKey="removeAdminUser"/>--> + </after> + + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserFirstAttempt"> + <argument name="adminUser" value="$$user.username$$"/> + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> + <argument name="adminLastname" value="NEW$$user.lastname$$"/> + <argument name="adminEmail" value="new$$user.email$$"/> + <argument name="adminPassword" value="NEW$$user.password$$"/> + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="adminUserRole" value="1"/> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> + </actionGroup> + + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserSecondAttempt"> + <argument name="adminUser" value="$$user.username$$"/> + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> + <argument name="adminLastname" value="NEW$$user.lastname$$"/> + <argument name="adminEmail" value="new$$user.email$$"/> + <argument name="adminPassword" value="NEW$$user.password$$"/> + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="adminUserRole" value="1"/> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> + </actionGroup> + + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserThirdAttempt"> + <argument name="adminUser" value="$$user.username$$"/> + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> + <argument name="adminLastname" value="NEW$$user.lastname$$"/> + <argument name="adminEmail" value="new$$user.email$$"/> + <argument name="adminPassword" value="NEW$$user.password$$"/> + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="adminUserRole" value="1"/> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> + </actionGroup> + + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserFourthAttempt"> + <argument name="adminUser" value="$$user.username$$"/> + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> + <argument name="adminLastname" value="NEW$$user.lastname$$"/> + <argument name="adminEmail" value="new$$user.email$$"/> + <argument name="adminPassword" value="NEW$$user.password$$"/> + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="adminUserRole" value="1"/> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> + </actionGroup> + + <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserFifthAttempt"> + <argument name="adminUser" value="$$user.username$$"/> + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> + <argument name="adminLastname" value="NEW$$user.lastname$$"/> + <argument name="adminEmail" value="new$$user.email$$"/> + <argument name="adminPassword" value="NEW$$user.password$$"/> + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="adminUserRole" value="1"/> + <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> + </actionGroup> + + <actionGroup ref="AdminEditUserActionGroup" stepKey="openEditLastPage"> + <argument name="adminUser" value="$$user.username$$"/> + <argument name="adminFirstname" value="NEW$$user.firstname$$"/> + <argument name="adminLastname" value="NEW$$user.lastname$$"/> + <argument name="adminEmail" value="new$$user.email$$"/> + <argument name="adminPassword" value="NEW$$user.password$$"/> + <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="adminUserRole" value="1"/> + <argument name="messageSelector" value="{{AdminLoginFormSection.error}}" /> + <argument name="message" value="Your account is temporarily disabled. Please try again later." /> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> + </actionGroup> + + <!-- Try to login as admin and check error --> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> + <waitForPageLoad stepKey="waitForError"/> + <see selector="{{AdminLoginFormSection.error}}" userInput="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later" + stepKey="seeLoginUserError"/> + </test> +</tests> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminEditUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminEditUserActionGroup.xml new file mode 100644 index 000000000000..7af34fe65947 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminEditUserActionGroup.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminEditUserActionGroup"> + <arguments> + <argument name="adminUser" type="string" /> + <argument name="adminFirstname" type="string" /> + <argument name="adminLastname" type="string" /> + <argument name="adminEmail" type="string" /> + <argument name="adminPassword" type="string" /> + <argument name="adminPasswordConfirmation" type="string" /> + <argument name="currentAdminPassword" type="string" /> + <argument name="adminUserRole" type="string"/> + <argument name="message" type="string" defaultValue="You saved the user." /> + <argument name="messageSelector" type="string" defaultValue="{{AdminMessagesSection.success}}" /> + </arguments> + + <!-- Navigate to edit user page --> + <amOnPage url="{{AdminUsersPage.url}}" stepKey="openAdminUsersPage"/> + <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{adminUser}}" stepKey="fillSearchUsernameFilter"/> + <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch" /> + <waitForPageLoad stepKey="waitForGridToLoad"/> + <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{adminUser}}" stepKey="seeUser" /> + <click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="openUserEdit"/> + <waitForPageLoad stepKey="waitForUserEditPageLoad"/> + + <!-- Edit admin User data --> + <fillField selector="{{AdminEditUserSection.usernameTextField}}" userInput="{{adminUser}}" stepKey="fillUser"/> + <fillField selector="{{AdminEditUserSection.firstNameTextField}}" userInput="{{adminFirstname}}" stepKey="fillFirstName"/> + <fillField selector="{{AdminEditUserSection.lastNameTextField}}" userInput="{{adminLastname}}" stepKey="fillLastName"/> + <fillField selector="{{AdminEditUserSection.emailTextField}}" userInput="{{adminEmail}}" stepKey="fillEmail"/> + <fillField selector="{{AdminEditUserSection.passwordTextField}}" userInput="{{adminPassword}}" stepKey="fillPassword"/> + <fillField selector="{{AdminEditUserSection.pwConfirmationTextField}}" userInput="{{adminPasswordConfirmation}}" stepKey="fillPasswordConfirmation"/> + <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{currentAdminPassword}}" stepKey="fillCurrentUserPassword"/> + <scrollToTopOfPage stepKey="ScrollToTopOfPage"/> + + <!-- Set admin User Role --> + <click selector="{{AdminEditUserSection.userRoleTab}}" stepKey="openUserRoleTab"/> + <click selector="{{AdminEditUserSection.administratorRoleRadio(adminUserRole)}}" stepKey="assignRole"/> + + <!-- Save User --> + <click selector="{{AdminEditUserSection.saveButton}}" stepKey="saveUser"/> + <waitForPageLoad stepKey="waitForSaveResultLoad"/> + <see userInput="{{message}}" selector="{{messageSelector}}" stepKey="verifyMessage" /> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminEditUserSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminEditUserSection.xml index 64068a0a5ef5..90a0ccd5ffa0 100644 --- a/app/code/Magento/User/Test/Mftf/Section/AdminEditUserSection.xml +++ b/app/code/Magento/User/Test/Mftf/Section/AdminEditUserSection.xml @@ -19,6 +19,7 @@ <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="administratorRoleRadio" type="radio" selector="//*[@id='permissionsUserRolesGrid_table']//td[{{role}}]/input" parameterized="true"/> <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']"/> diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.xml index bc4a8641d68f..c5728da99a7a 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.xml @@ -19,6 +19,7 @@ <data name="user/data/password_confirmation" xsi:type="string">123123qq</data> <data name="user/data/current_password" xsi:type="string">incorrect password</data> <data name="attempts" xsi:type="string">4</data> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Security\Test\Constraint\AssertUserIsLocked" /> </variation> </testCase> From bb03bcf96b7a166ccd43a41369cf5b51f06c8b54 Mon Sep 17 00:00:00 2001 From: Leandry <leandry@atwix.com> Date: Thu, 11 Apr 2019 22:45:05 +0300 Subject: [PATCH 009/230] Refactoring --- .../AssertAdminNotSuccessLoginActionGroup.xml | 19 +++++ .../AssertMessageOnBackendActionGroup.xml | 18 ++++ .../Mftf/Section/AdminMessagesSection.xml | 1 + ...lIntegrationRequiredFieldsActionGroup.xml} | 12 +-- ...AdminOpenNewIntegrationPageActionGroup.xml | 14 +++ .../AssertSaveIntegrationActionGroup.xml | 14 +++ ...ntegrationData.xml => IntegrationData.xml} | 4 +- ...dminUserWhenCreatingNewIntegrationTest.xml | 76 +++++++++++++++++ ...dminUserWhenCreatingNewIntegrationTest.xml | 85 ------------------- ...dminUserWhenCreatingNewIntegrationTest.xml | 3 +- 10 files changed, 148 insertions(+), 98 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminNotSuccessLoginActionGroup.xml create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnBackendActionGroup.xml rename app/code/Magento/{Security/Test/Mftf/ActionGroup/AdminNewIntegrationRequiredFieldsActionGroup.xml => Integration/Test/Mftf/ActionGroup/AdminFillIntegrationRequiredFieldsActionGroup.xml} (54%) create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminOpenNewIntegrationPageActionGroup.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertSaveIntegrationActionGroup.xml rename app/code/Magento/Integration/Test/Mftf/Data/{AdminNewIntegrationData.xml => IntegrationData.xml} (72%) create mode 100644 app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml delete mode 100644 app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenCreatingNewIntegrationTest.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminNotSuccessLoginActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminNotSuccessLoginActionGroup.xml new file mode 100644 index 000000000000..f932924edbd7 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminNotSuccessLoginActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminNotSuccessLoginActionGroup"> + <arguments> + <argument name="message" type="string" defaultValue="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later"/> + </arguments> + <waitForPageLoad stepKey="waitForPageReload"/> + <see selector="{{AdminLoginFormSection.error}}" userInput="{{message}}" + stepKey="seeLoginAdminError"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnBackendActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnBackendActionGroup.xml new file mode 100644 index 000000000000..b75fcd47c61b --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnBackendActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertMessageOnBackendActionGroup"> + <arguments> + <argument name="message" type="string" defaultValue="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="messageType" type="string" defaultValue="error" /> + </arguments> + <see userInput="{{message}}" selector="{{AdminMessagesSection.messageByType(messageType)}}" stepKey="verifyMessage" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminMessagesSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminMessagesSection.xml index 88e740d689cd..be3ef92acf0a 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminMessagesSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminMessagesSection.xml @@ -13,5 +13,6 @@ <element name="nthSuccess" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/> <element name="error" type="text" selector="#messages div.message-error"/> <element name="notice" type="text" selector=".message.message-notice.notice"/> + <element name="messageByType" type="text" selector="#messages div.message-{{messageType}}" parameterized="true" /> </section> </sections> diff --git a/app/code/Magento/Security/Test/Mftf/ActionGroup/AdminNewIntegrationRequiredFieldsActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationRequiredFieldsActionGroup.xml similarity index 54% rename from app/code/Magento/Security/Test/Mftf/ActionGroup/AdminNewIntegrationRequiredFieldsActionGroup.xml rename to app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationRequiredFieldsActionGroup.xml index bb35660ca8ed..d1dc2996ee2e 100644 --- a/app/code/Magento/Security/Test/Mftf/ActionGroup/AdminNewIntegrationRequiredFieldsActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationRequiredFieldsActionGroup.xml @@ -7,19 +7,13 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminNewIntegrationRequiredFieldsActionGroup"> + <actionGroup name="AdminFillIntegrationRequiredFieldsActionGroup"> <arguments> - <argument name="integrationName" type="string" /> - <argument name="currentAdminPassword" type="string" /> - <argument name="message" type="string" defaultValue="The integration '{{AdminNewIntegrationData.integrationName}}' has been saved." /> - <argument name="messageSelector" type="string" defaultValue="{{AdminMessagesSection.success}}" /> + <argument name="integrationName" type="string" defaultValue="{{IntegrationData.name}}"/> + <argument name="currentAdminPassword" type="string" defaultValue="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" /> </arguments> - <!-- Fill all Required Fields. --> <fillField selector="{{AdminNewIntegrationSection.integrationName}}" userInput="{{integrationName}}" stepKey="fillIntegrationName"/> <fillField selector="{{AdminNewIntegrationSection.currentPassword}}" userInput="{{currentAdminPassword}}" stepKey="fillCurrentUserPassword"/> <scrollToTopOfPage stepKey="ScrollToTopOfPage"/> - <click selector="{{AdminNewIntegrationSection.save}}" stepKey="saveNewIntegration"/> - <waitForPageLoad stepKey="waitForSaveResultLoad"/> - <see userInput="{{message}}" selector="{{messageSelector}}" stepKey="verifyMessage" /> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminOpenNewIntegrationPageActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminOpenNewIntegrationPageActionGroup.xml new file mode 100644 index 000000000000..0ddb0664b979 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminOpenNewIntegrationPageActionGroup.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminOpenNewIntegrationPageActionGroup"> + <amOnPage url="{{AdminNewIntegrationPage.url}}" stepKey="amOnNewAdminIntegrationPage"/> + <waitForPageLoad stepKey="waitForNewAdminIntegrationPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertSaveIntegrationActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertSaveIntegrationActionGroup.xml new file mode 100644 index 000000000000..0c53f4455bef --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertSaveIntegrationActionGroup.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertSaveIntegrationActionGroup"> + <click selector="{{AdminNewIntegrationSection.save}}" stepKey="saveIntegration"/> + <waitForPageLoad stepKey="waitForSaveResultLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/Data/AdminNewIntegrationData.xml b/app/code/Magento/Integration/Test/Mftf/Data/IntegrationData.xml similarity index 72% rename from app/code/Magento/Integration/Test/Mftf/Data/AdminNewIntegrationData.xml rename to app/code/Magento/Integration/Test/Mftf/Data/IntegrationData.xml index 1307320ffb8f..3e7b6c49e2bc 100644 --- a/app/code/Magento/Integration/Test/Mftf/Data/AdminNewIntegrationData.xml +++ b/app/code/Magento/Integration/Test/Mftf/Data/IntegrationData.xml @@ -8,7 +8,7 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="AdminNewIntegrationData" type="admin"> - <data key="integrationName" unique="prefix">_Integration</data> + <entity name="IntegrationData" type="admin"> + <data key="name" unique="prefix">_Integration</data> </entity> </entities> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml new file mode 100644 index 000000000000..96ef122fd7a4 --- /dev/null +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml @@ -0,0 +1,76 @@ +<?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="AdminLockAdminUserWhenCreatingNewIntegrationTest"> + <annotations> + <features value="Security"/> + <stories value="Runs Lock admin user when creating new integration test."/> + <title value="Lock admin user when creating new integration"/> + <description value="Runs Lock admin user when creating new integration test."/> + <severity value="MAJOR"/> + <group value="security"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <!-- Log in to Admin Panel --> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Unlock Admin user --> + <magentoCLI command="admin:user:unlock {{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey="unlockAdminUser"/> + </after> + + <actionGroup ref="AdminOpenNewIntegrationPageActionGroup" stepKey="openNewIntegrationPage"/> + <!-- Perform add new admin user 6 specified number of times. + "The password entered for the current user is invalid. Verify the password and try again." appears after each attempt.--> + <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldFirstAttempt"> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + </actionGroup> + <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationFirstAttempt"/> + <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkFirstSaveIntegrationError"/> + + <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldSecondAttempt"> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + </actionGroup> + <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationSecondAttempt"/> + <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkSecondSaveIntegrationError"/> + + <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldThirdAttempt"> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + </actionGroup> + <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationThirdAttempt"/> + <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkThirdSaveIntegrationError"/> + + <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldFourthAttempt"> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + </actionGroup> + <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationFourthAttempt"/> + <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkFourthSaveIntegrationError"/> + + <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldFifthAttempt"> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + </actionGroup> + <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationFifthAttempt"/> + <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkFifthSaveIntegrationError"/> + + <!-- Last invalid current password save integration attempt and check logout error --> + <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldLastAttempt"> + <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> + </actionGroup> + <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationLastAttempt"/> + <actionGroup ref="AssertAdminNotSuccessLoginActionGroup" stepKey="checkFifthError"> + <argument name="message" value="Your account is temporarily disabled. Please try again later."/> + </actionGroup> + + <!-- Try to login as admin and check error --> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> + <actionGroup ref="AssertAdminNotSuccessLoginActionGroup" stepKey="checkLoginError"/> + </test> +</tests> diff --git a/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenCreatingNewIntegrationTest.xml b/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenCreatingNewIntegrationTest.xml deleted file mode 100644 index fcef652dfeb9..000000000000 --- a/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenCreatingNewIntegrationTest.xml +++ /dev/null @@ -1,85 +0,0 @@ -<?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="LockAdminUserWhenCreatingNewIntegrationTest"> - <annotations> - <features value="Security"/> - <stories value="Runs Lock admin user when creating new integration test."/> - <title value="Lock admin user when creating new integration"/> - <description value="Runs Lock admin user when creating new integration test."/> - <severity value="MAJOR"/> - <group value="security"/> - <group value="mtf_migrated"/> - </annotations> - <before> - <!-- Log in to Admin Panel --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - </before> - <after> - <!-- Unlock Admin user --> - <magentoCLI command="admin:user:unlock {{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey="unlockAdminUser"/> - </after> - - <!-- Open Admin New Integration Page --> - <amOnPage url="{{AdminNewIntegrationPage.url}}" stepKey="amOnNewAdminIntegrationPage"/> - <waitForPageLoad stepKey="waitForNewAdminIntegrationPageLoad"/> - - <!-- Perform add new admin user 6 specified number of times. - "The password entered for the current user is invalid. Verify the password and try again." appears after each attempt.--> - <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationFirstAttempt"> - <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> - <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - </actionGroup> - - <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationSecondAttempt"> - <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> - <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - </actionGroup> - - <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationThirdAttempt"> - <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> - <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - </actionGroup> - - <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationFourthAttempt"> - <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> - <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - </actionGroup> - - <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationFifthAttempt"> - <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> - <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - </actionGroup> - - <!-- Last invalid current password save integration attempt and check logout error --> - <actionGroup ref="AdminNewIntegrationRequiredFieldsActionGroup" stepKey="failedSaveIntegrationLastAttempt"> - <argument name="integrationName" value="{{AdminNewIntegrationData.integrationName}}" /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> - <argument name="messageSelector" value="{{AdminLoginFormSection.error}}" /> - <argument name="message" value="Your account is temporarily disabled. Please try again later." /> - </actionGroup> - - <!-- Try to login as admin and check error --> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> - <waitForPageLoad stepKey="waitForError"/> - <see selector="{{AdminLoginFormSection.error}}" userInput="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later" - stepKey="seeLoginUserError"/> - </test> -</tests> diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml index d9c45881b59d..13c38af94844 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenCreatingNewIntegrationTest.xml @@ -8,7 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Security\Test\TestCase\LockAdminUserWhenCreatingNewIntegrationTest" summary="Lock admin user after entering incorrect password while creating new integration"> <variation name="LockAdminUserWhenCreatingNewIntegrationTestVariation1"> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2, mftf_migrated:yes</data> <data name="configData" xsi:type="string">user_lockout_failures</data> <data name="customAdmin/dataset" xsi:type="string">custom_admin_with_default_role</data> <data name="integration/data/name" xsi:type="string">Integration%isolation%</data> @@ -18,7 +18,6 @@ <data name="integration/data/current_password" xsi:type="string">incorrect password</data> <data name="integration/data/resource_access" xsi:type="string">All</data> <data name="attempts" xsi:type="string">4</data> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Security\Test\Constraint\AssertUserIsLocked" /> </variation> </testCase> From 01c96b830d4738bee35509e1c687254b715b9ded Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 17 Apr 2019 13:35:49 +0300 Subject: [PATCH 010/230] Refactoring the Action Groups and the overall implementation --- .../AdminFilterGridActionGroup.xml} | 10 +++--- .../AdminResetFilterActionGroup.xml | 17 ++++++++++ .../ActionGroup/AssertMessageActionGroup.xml | 18 +++++++++++ .../AssertValueInGridActionGroup.xml | 16 ++++++++++ .../Mftf/Section/AdminGridTableSection.xml | 1 + .../AdminAssertSuccessAddedActionGroup.xml | 16 ---------- .../AdminCreateCustomVariableActionGroup.xml | 20 ++++++++++++ .../AdminDeleteCustomVariableActionGroup.xml | 22 +++++++++++++ .../CreateCustomVariableActionGroup.xml | 31 ------------------- .../Test/Mftf/Page/AdminNewVariablePage.xml | 2 +- .../Test/Mftf/Page/AdminVariablesPage.xml | 2 +- .../Section/AdminVariableMessagesSection.xml | 15 --------- .../Section/AdminVariablesFilterSection.xml | 2 -- .../Section/AdminVariablesGridSection.xml | 1 - .../Test/CreateCustomVariableEntityTest.xml | 19 ++++++++---- .../CreateCustomVariableEntityTest.xml | 3 +- 16 files changed, 114 insertions(+), 81 deletions(-) rename app/code/Magento/{Variable/Test/Mftf/ActionGroup/FilterVariablesGridActionGroup.xml => Backend/Test/Mftf/ActionGroup/AdminFilterGridActionGroup.xml} (59%) create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetFilterActionGroup.xml create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageActionGroup.xml create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInGridActionGroup.xml delete mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminAssertSuccessAddedActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminCreateCustomVariableActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminDeleteCustomVariableActionGroup.xml delete mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml delete mode 100644 app/code/Magento/Variable/Test/Mftf/Section/AdminVariableMessagesSection.xml diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/FilterVariablesGridActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterGridActionGroup.xml similarity index 59% rename from app/code/Magento/Variable/Test/Mftf/ActionGroup/FilterVariablesGridActionGroup.xml rename to app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterGridActionGroup.xml index b40725eb781c..dea1038159fc 100644 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/FilterVariablesGridActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterGridActionGroup.xml @@ -8,15 +8,13 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="FilterVariablesGridActionGroup"> + <actionGroup name="AdminFilterGridActionGroup"> <arguments> <argument name="field" type="string"/> <argument name="value" type="string"/> + <argument name="button" type="string" defaultValue="{{AdminSecondaryGridSection.searchButton}}"/> </arguments> - <fillField selector="{{field}}" userInput="{{value}}" stepKey="fillVariableAttributeInFilter"/> - <click selector="{{AdminVariablesFilterSection.searchButton}}" stepKey="clickSearchButton"/> - </actionGroup> - <actionGroup name="ResetFilterVariablesGridActionGroup"> - <click selector="{{AdminVariablesFilterSection.resetFilterButton}}" stepKey="clickResetButton"/> + <fillField selector="{{field}}" userInput="{{value}}" stepKey="fillFieldInFilter"/> + <click selector="{{button}}" stepKey="clickSearchButton"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetFilterActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetFilterActionGroup.xml new file mode 100644 index 000000000000..0b778cae0be5 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetFilterActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminResetFilterActionGroup"> + <arguments> + <argument name="selector" type="string" defaultValue="{{AdminSecondaryGridSection.resetFilters}}"/> + </arguments> + <click selector="{{selector}}" stepKey="clickResetButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageActionGroup.xml new file mode 100644 index 000000000000..25e716a13948 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertMessageActionGroup"> + <arguments> + <argument name="message" type="string" /> + <argument name="messageType" type="string" defaultValue="success" /> + </arguments> + <see userInput="{{message}}" selector=".messages .message-{{messageType}}" stepKey="verifyMessage" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInGridActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInGridActionGroup.xml new file mode 100644 index 000000000000..20efab26455f --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInGridActionGroup.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertValueInGridActionGroup"> + <arguments> + <argument name="value" type="string" /> + </arguments> + <see selector="{{AdminGridTableSection.rowByValue(value)}}" userInput="{{value}}" stepKey="seeValueInGrid"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml index cc92e530cf3d..bb3cf57e4d6e 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminGridTableSection"> <element name="row" type="text" selector="table.data-grid tbody tr[data-role=row]:nth-of-type({{row}})" parameterized="true"/> + <element name="rowByValue" type="text" selector="//tr[@data-role='row'] //td[contains(., '{{var}}')]" parameterized="true" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminAssertSuccessAddedActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminAssertSuccessAddedActionGroup.xml deleted file mode 100644 index fd1f7870896e..000000000000 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminAssertSuccessAddedActionGroup.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminAssertSuccessMessageActionGroup" > - <see userInput="You saved the custom variable." selector="{{AdminVariableMessagesSection.successMessage}}" stepKey="seeMessage"/> - </actionGroup> - <actionGroup name="AdminSeeVariableInGridActionGroup"> - <see selector="{{AdminVariablesGridSection.rowByValue(customVariable.code)}}" userInput="{{customVariable.code}}" stepKey="seeVariableCodeInGrid"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminCreateCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminCreateCustomVariableActionGroup.xml new file mode 100644 index 000000000000..21d98617d9a4 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminCreateCustomVariableActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCreateCustomVariableActionGroup"> + <amOnPage url="admin/admin/system_variable/new/" stepKey="goToNewCustomVariablePage"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <fillField selector="{{CustomVariableSection.variableCode}}" userInput="{{customVariable.code}}" stepKey="fillVariableCode"/> + <fillField selector="{{CustomVariableSection.variableName}}" userInput="{{customVariable.name}}" stepKey="fillVariableName"/> + <fillField selector="{{CustomVariableSection.variableHTML}}" userInput="{{customVariable.html}}" stepKey="fillVariableHtml"/> + <fillField selector="{{CustomVariableSection.variablePlain}}" userInput="{{customVariable.plain}}" stepKey="fillVariablePlain"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveVariable"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminDeleteCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminDeleteCustomVariableActionGroup.xml new file mode 100644 index 000000000000..bbd17b2ed39e --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminDeleteCustomVariableActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminDeleteCustomVariableActionGroup"> + <amOnPage url="admin/admin/system_variable/" stepKey="goToVariableGrid"/> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <click selector="{{CustomVariableSection.GridCustomVariableCode(customVariable.code)}}" stepKey="goToCustomVariableEditPage"/> + <waitForPageLoad stepKey="waitForPageLoad2"/> + <waitForElementVisible selector="{{CustomVariableSection.delete}}" stepKey="waitForDeleteBtn"/> + <click selector="{{CustomVariableSection.delete}}" stepKey="deleteCustomVariable"/> + <waitForText userInput="Are you sure you want to do this?" stepKey="waitForText"/> + <click selector="{{CustomVariableSection.confirmDelete}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml deleted file mode 100644 index 4d36cd0669b8..000000000000 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - <!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - --> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> -<actionGroup name="CreateCustomVariableActionGroup"> - <amOnPage url="admin/admin/system_variable/new/" stepKey="goToNewCustomVariablePage" /> - <waitForPageLoad stepKey="waitForPageLoad" /> - <fillField selector="{{CustomVariableSection.variableCode}}" userInput="{{customVariable.code}}" stepKey="fillVariableCode" /> - <fillField selector="{{CustomVariableSection.variableName}}" userInput="{{customVariable.name}}" stepKey="fillVariableName" /> - <fillField selector="{{CustomVariableSection.variableHTML}}" userInput="{{customVariable.html}}" stepKey="fillVariableHtml" /> - <fillField selector="{{CustomVariableSection.variablePlain}}" userInput="{{customVariable.plain}}" stepKey="fillVariablePlain" /> - <click selector="{{CustomVariableSection.saveCustomVariable}}" stepKey="clickSaveVariable"/> -</actionGroup> -<actionGroup name="DeleteCustomVariableActionGroup"> - <amOnPage url="admin/admin/system_variable/" stepKey="goToVariableGrid" /> - <waitForPageLoad stepKey="waitForPageLoad1" /> - <click selector="{{CustomVariableSection.GridCustomVariableCode(customVariable.code)}}" stepKey="goToCustomVariableEditPage" /> - <waitForPageLoad stepKey="waitForPageLoad2" /> - <waitForElementVisible selector="{{CustomVariableSection.delete}}" stepKey="waitForDeleteBtn" /> - <click selector="{{CustomVariableSection.delete}}" stepKey="deleteCustomVariable" /> - <waitForText userInput="Are you sure you want to do this?" stepKey="waitForText" /> - <click selector="{{CustomVariableSection.confirmDelete}}" stepKey="confirmDelete" /> - <waitForPageLoad stepKey="waitForPageLoad3" /> -</actionGroup> -</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/Page/AdminNewVariablePage.xml b/app/code/Magento/Variable/Test/Mftf/Page/AdminNewVariablePage.xml index 6d09424e44d2..bc5dff0feefa 100644 --- a/app/code/Magento/Variable/Test/Mftf/Page/AdminNewVariablePage.xml +++ b/app/code/Magento/Variable/Test/Mftf/Page/AdminNewVariablePage.xml @@ -9,6 +9,6 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminNewVariablePage" url="/admin/system_variable/new/" area="admin" module="Magento_Variable"> - <section name="AdminNewVariableSection"/> + <section name="AdminMessagesSection"/> </page> </pages> diff --git a/app/code/Magento/Variable/Test/Mftf/Page/AdminVariablesPage.xml b/app/code/Magento/Variable/Test/Mftf/Page/AdminVariablesPage.xml index ceb53072b7cf..b65c8c99b1b8 100644 --- a/app/code/Magento/Variable/Test/Mftf/Page/AdminVariablesPage.xml +++ b/app/code/Magento/Variable/Test/Mftf/Page/AdminVariablesPage.xml @@ -9,7 +9,7 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminVariablesPage" url="/admin/system_variable/index/" area="admin" module="Magento_Variable"> - <section name="AdminVariableMessagesSection"/> + <section name="AdminMessagesSection"/> <section name="AdminVariablesFilterSection"/> <section name="AdminVariablesGridSection"/> </page> diff --git a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableMessagesSection.xml b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableMessagesSection.xml deleted file mode 100644 index 0acebbd8be88..000000000000 --- a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableMessagesSection.xml +++ /dev/null @@ -1,15 +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="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="AdminVariableMessagesSection"> - <element name="successMessage" type="text" selector=".message-success"/> - <element name="errorMessage" type="text" selector=".message.message-error.error"/> - </section> -</sections> diff --git a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml index 3976a5f63e1a..8c3eb683184d 100644 --- a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml +++ b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml @@ -9,8 +9,6 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminVariablesFilterSection"> - <element name="searchButton" type="button" selector="button.action-default[title='Search']"/> - <element name="resetFilterButton" type="button" selector="button.action-reset[title='Reset Filter']"/> <element name="codeFilter" type="input" selector="input.admin__control-text[name='code']"/> <element name="nameFilter" type="input" selector="input.admin__control-text[name='name']"/> </section> diff --git a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesGridSection.xml b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesGridSection.xml index be91edf59d9c..0a58b9283965 100644 --- a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesGridSection.xml +++ b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesGridSection.xml @@ -10,6 +10,5 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminVariablesGridSection"> <element name="variablesGrid" type="text" selector="table[data-role='grid']"/> - <element name="rowByValue" type="text" selector="//td[text()[contains(.,'{{var}}')]]" parameterized="true" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml index 41bbff38e667..fb6328b6a305 100644 --- a/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml +++ b/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml @@ -21,16 +21,23 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> - <actionGroup ref="CreateCustomVariableActionGroup" stepKey="createCustomVariable"/> - <waitForPageLoad stepKey="waitForPageLoad"/> - <actionGroup ref="AdminAssertSuccessMessageActionGroup" stepKey="seeSuccessMessage"/> - <actionGroup ref="FilterVariablesGridActionGroup" stepKey="filterVariablesGridByNewVariableCode" > + <actionGroup ref="AdminCreateCustomVariableActionGroup" stepKey="createCustomVariable"/> + <actionGroup ref="AssertMessageActionGroup" stepKey="seeSuccessMessage"> + <argument name="message" value="You saved the custom variable."/> + </actionGroup> + <actionGroup ref="AdminFilterGridActionGroup" stepKey="filterVariablesGridByNewVariableCode" > <argument name="field" value="{{AdminVariablesFilterSection.codeFilter}}"/> <argument name="value" value="{{customVariable.code}}"/> </actionGroup> - <actionGroup ref="AdminSeeVariableInGridActionGroup" stepKey="seeNewVariableInGrid"/> + <actionGroup ref="AdminFilterGridActionGroup" stepKey="filterVariablesGridByNewVariableName" > + <argument name="field" value="{{AdminVariablesFilterSection.nameFilter}}"/> + <argument name="value" value="{{customVariable.name}}"/> + </actionGroup> + <actionGroup ref="AssertValueInGridActionGroup" stepKey="seeNewVariableInGrid"> + <argument name="value" value="{{customVariable.code}}"/> + </actionGroup> <after> - <actionGroup ref="ResetFilterVariablesGridActionGroup" stepKey="resetVariablesGrid"/> + <actionGroup ref="AdminResetFilterActionGroup" stepKey="resetVariablesGrid"/> <actionGroup ref="logout" stepKey="logout"/> </after> </test> diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/CreateCustomVariableEntityTest.xml b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/CreateCustomVariableEntityTest.xml index 9f3fb647575e..644055052658 100644 --- a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/CreateCustomVariableEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/CreateCustomVariableEntityTest.xml @@ -8,12 +8,11 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Variable\Test\TestCase\CreateCustomVariableEntityTest" summary="Create Custom Variable" ticketId="MAGETWO-23293"> <variation name="CreateCustomVariableEntityTestVariation1"> - <data name="tag" xsi:type="string">test_type:extended_acceptance_test</data> + <data name="tag" xsi:type="string">test_type:extended_acceptance_test, mftf_migrated:yes</data> <data name="customVariable/data/code" xsi:type="string">variableCode%isolation%</data> <data name="customVariable/data/name" xsi:type="string">variableName%isolation%</data> <data name="customVariable/data/html_value" xsi:type="string"><h1>variableName%isolation%</h1></data> <data name="customVariable/data/plain_value" xsi:type="string"><p>variablePlainText%isolation%</p></data> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Variable\Test\Constraint\AssertCustomVariableSuccessSaveMessage" /> <constraint name="Magento\Variable\Test\Constraint\AssertCustomVariableInGrid" /> <constraint name="Magento\Variable\Test\Constraint\AssertCustomVariableForm" /> From fe88f29623acb6f58453ff19fc9fc2b8f812e6ae Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 17 Apr 2019 18:30:20 +0300 Subject: [PATCH 011/230] Refactoring the Action Groups. Minor fixes --- .../AdminClickMainButtonActionGroup.xml | 19 +++++++++++++++++++ ...ml => AdminResetGridFilterActionGroup.xml} | 2 +- ... => AssertValueInAdminGridActionGroup.xml} | 2 +- .../Mftf/Section/AdminGridTableSection.xml | 2 +- ...dminFillFormCustomVariableActionGroup.xml} | 6 +----- ...nNavigateToNewVariablePageActionGroup.xml} | 2 +- ...AdminNavigateToVariablePageActionGroup.xml | 17 +++++++++++++++++ ...avigateToVariablesGridPageActionGroup.xml} | 2 +- .../Test/CreateCustomVariableEntityTest.xml | 16 ++++++++++------ 9 files changed, 52 insertions(+), 16 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickMainButtonActionGroup.xml rename app/code/Magento/Backend/Test/Mftf/ActionGroup/{AdminResetFilterActionGroup.xml => AdminResetGridFilterActionGroup.xml} (90%) rename app/code/Magento/Backend/Test/Mftf/ActionGroup/{AssertValueInGridActionGroup.xml => AssertValueInAdminGridActionGroup.xml} (90%) rename app/code/Magento/Variable/Test/Mftf/ActionGroup/{AdminCreateCustomVariableActionGroup.xml => AdminFillFormCustomVariableActionGroup.xml} (71%) rename app/code/Magento/Variable/Test/Mftf/ActionGroup/{NavigateToNewVariablePageActionGroup.xml => AdminNavigateToNewVariablePageActionGroup.xml} (87%) create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablePageActionGroup.xml rename app/code/Magento/Variable/Test/Mftf/ActionGroup/{NavigateToVariablesPageActionGroup.xml => AdminNavigateToVariablesGridPageActionGroup.xml} (87%) diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickMainButtonActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickMainButtonActionGroup.xml new file mode 100644 index 000000000000..6eef59695745 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickMainButtonActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickMainButtonActionGroup"> + <arguments> + <argument name="button" type="string" /> + </arguments> + <waitForElementVisible selector="{{button}}" stepKey="waitForButton"/> + <click selector="{{button}}" stepKey="clickButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetFilterActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetGridFilterActionGroup.xml similarity index 90% rename from app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetFilterActionGroup.xml rename to app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetGridFilterActionGroup.xml index 0b778cae0be5..7e22309493be 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetFilterActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetGridFilterActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminResetFilterActionGroup"> + <actionGroup name="AdminResetGridFilterActionGroup"> <arguments> <argument name="selector" type="string" defaultValue="{{AdminSecondaryGridSection.resetFilters}}"/> </arguments> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInGridActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInAdminGridActionGroup.xml similarity index 90% rename from app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInGridActionGroup.xml rename to app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInAdminGridActionGroup.xml index 20efab26455f..f3eec4446ae7 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInGridActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInAdminGridActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertValueInGridActionGroup"> + <actionGroup name="AssertValueInAdminGridActionGroup"> <arguments> <argument name="value" type="string" /> </arguments> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml index bb3cf57e4d6e..080f598480dc 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml @@ -10,6 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminGridTableSection"> <element name="row" type="text" selector="table.data-grid tbody tr[data-role=row]:nth-of-type({{row}})" parameterized="true"/> - <element name="rowByValue" type="text" selector="//tr[@data-role='row'] //td[contains(., '{{var}}')]" parameterized="true" timeout="30"/> + <element name="rowByValue" type="text" selector="//table[@class='data-grid']//tr[@data-role='row'] //td[contains(., '{{var}}')]" parameterized="true" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminCreateCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillFormCustomVariableActionGroup.xml similarity index 71% rename from app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminCreateCustomVariableActionGroup.xml rename to app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillFormCustomVariableActionGroup.xml index 21d98617d9a4..4dabe6f0ae19 100644 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminCreateCustomVariableActionGroup.xml +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillFormCustomVariableActionGroup.xml @@ -7,14 +7,10 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminCreateCustomVariableActionGroup"> - <amOnPage url="admin/admin/system_variable/new/" stepKey="goToNewCustomVariablePage"/> - <waitForPageLoad stepKey="waitForPageLoad"/> + <actionGroup name="AdminFillFormCustomVariableActionGroup"> <fillField selector="{{CustomVariableSection.variableCode}}" userInput="{{customVariable.code}}" stepKey="fillVariableCode"/> <fillField selector="{{CustomVariableSection.variableName}}" userInput="{{customVariable.name}}" stepKey="fillVariableName"/> <fillField selector="{{CustomVariableSection.variableHTML}}" userInput="{{customVariable.html}}" stepKey="fillVariableHtml"/> <fillField selector="{{CustomVariableSection.variablePlain}}" userInput="{{customVariable.plain}}" stepKey="fillVariablePlain"/> - <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveVariable"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToNewVariablePageActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToNewVariablePageActionGroup.xml similarity index 87% rename from app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToNewVariablePageActionGroup.xml rename to app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToNewVariablePageActionGroup.xml index ee80bcc86131..060a2a608b12 100644 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToNewVariablePageActionGroup.xml +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToNewVariablePageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="NavigateToNewVariablePageActionGroup"> + <actionGroup name="AdminNavigateToNewVariablePageActionGroup"> <amOnPage url="{{AdminNewVariablePage.url}}" stepKey="openNewVariablePage"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablePageActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablePageActionGroup.xml new file mode 100644 index 000000000000..4904b45a47e4 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablePageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminNavigateToVariablePageActionGroup"> + <arguments> + <argument name="code" type="string"/> + </arguments> + <click selector="{{CustomVariableSection.GridCustomVariableCode(code)}}" stepKey="goToCustomVariableEditPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToVariablesPageActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablesGridPageActionGroup.xml similarity index 87% rename from app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToVariablesPageActionGroup.xml rename to app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablesGridPageActionGroup.xml index f4c00b7b6039..cc57f6b83d49 100644 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/NavigateToVariablesPageActionGroup.xml +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablesGridPageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="NavigateToVariablesPage"> + <actionGroup name="AdminNavigateToVariablesGridPageActionGroup"> <amOnPage url="{{AdminVariablesPage.url}}" stepKey="openVariablesGridPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml index fb6328b6a305..cb843f64d341 100644 --- a/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml +++ b/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml @@ -21,7 +21,15 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> - <actionGroup ref="AdminCreateCustomVariableActionGroup" stepKey="createCustomVariable"/> + <after> + <actionGroup ref="AdminResetGridFilterActionGroup" stepKey="resetVariablesGrid"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateToNewVariablePageActionGroup" stepKey="goToNewVariableAdminPage"/> + <actionGroup ref="AdminFillFormCustomVariableActionGroup" stepKey="fillInCustomVariableData"/> + <actionGroup ref="AdminClickMainButtonActionGroup" stepKey="clickSaveCustomVariable"> + <argument name="button" value="{{AdminMainActionsSection.save}}"/> + </actionGroup> <actionGroup ref="AssertMessageActionGroup" stepKey="seeSuccessMessage"> <argument name="message" value="You saved the custom variable."/> </actionGroup> @@ -33,12 +41,8 @@ <argument name="field" value="{{AdminVariablesFilterSection.nameFilter}}"/> <argument name="value" value="{{customVariable.name}}"/> </actionGroup> - <actionGroup ref="AssertValueInGridActionGroup" stepKey="seeNewVariableInGrid"> + <actionGroup ref="AssertValueInAdminGridActionGroup" stepKey="seeNewVariableInGrid"> <argument name="value" value="{{customVariable.code}}"/> </actionGroup> - <after> - <actionGroup ref="AdminResetFilterActionGroup" stepKey="resetVariablesGrid"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> </test> </tests> From 9e5cde84d0b7a453c72e09ce196f846cdea57c8f Mon Sep 17 00:00:00 2001 From: Kavitha <kanair@adobe.com> Date: Fri, 19 Apr 2019 16:53:39 -0500 Subject: [PATCH 012/230] MC-4459: Convert OnePageCheckoutOfflinePaymentMethodsTest to MFTF --- .../ActionGroup/AdminProductActionGroup.xml | 4 + .../Mftf/Data/CatalogInventryConfigData.xml | 24 ++ ...tFillEstimateShippingAndTaxActionGroup.xml | 22 ++ ...CheckoutShippingAddressFormActionGroup.xml | 27 +++ ...orefrontCustomerSignInPopUpActionGroup.xml | 23 ++ ...gisterCustomerAfterCheckoutActionGroup.xml | 21 ++ .../Test/Mftf/Data/CheckoutConfigData.xml | 35 +++ .../Section/CheckoutCartSummarySection.xml | 1 + .../Mftf/Section/CheckoutPaymentSection.xml | 3 + .../Mftf/Section/CheckoutShippingSection.xml | 4 + .../Section/CheckoutSuccessMainSection.xml | 1 + ...ingAddressAndProductWithTierPricesTest.xml | 129 ++++++++++ ...ssAndRegisterCustomerAfterCheckoutTest.xml | 102 ++++++++ ...ntCheckoutWithSpecialPriceProductsTest.xml | 171 ++++++++++++++ ...OnLoginWhenGuestCheckoutIsDisabledTest.xml | 92 ++++++++ ...egistrationAndDisableGuestCheckoutTest.xml | 132 +++++++++++ ...tCheckoutUsingFreeShippingAndTaxesTest.xml | 221 ++++++++++++++++++ ...tCheckoutWithCouponAndZeroSubtotalTest.xml | 93 ++++++++ ...ngesInBackendAfterCustomerCheckoutTest.xml | 105 +++++++++ ...efrontUKCustomerCheckoutWithCouponTest.xml | 128 ++++++++++ ...uctQuantityEqualsToOrderedQuantityTest.xml | 100 ++++++++ ...CouponAndBankTransferPaymentMethodTest.xml | 97 ++++++++ ...torefrontFillBillingAddressActionGroup.xml | 24 ++ .../Customer/Test/Mftf/Data/AddressData.xml | 14 ++ .../Test/Mftf/Data/CustomerConfigData.xml | 12 + .../Customer/Test/Mftf/Data/CustomerData.xml | 14 ++ .../StorefrontCustomerAddressesSection.xml | 2 + .../StorefrontCustomerSignInFormSection.xml | 1 + .../Test/Mftf/Data/PaymentConfigData.xml | 35 +++ ...AssertOrderAvailableButtonsActionGroup.xml | 20 ++ .../ActionGroup/AdminOrderActionGroup.xml | 9 + .../AdminShipThePendingOrderActionGroup.xml | 21 ++ .../Mftf/Section/AdminOrdersGridSection.xml | 1 + .../Test/Mftf/Data/SalesRuleData.xml | 29 +++ .../Mftf/Data/StoreShippingMethodsData.xml | 7 + 35 files changed, 1724 insertions(+) create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutFillEstimateShippingAndTaxActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCustomerSignInPopUpActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontRegisterCustomerAfterCheckoutActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillBillingAddressActionGroup.xml create mode 100644 app/code/Magento/Payment/Test/Mftf/Data/PaymentConfigData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertOrderAvailableButtonsActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminShipThePendingOrderActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml index 3c44a8f1898a..d7a9ee9ae85c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml @@ -248,6 +248,10 @@ <waitForPageLoad time="60" stepKey="WaitForProductSave1"/> <see userInput="You saved the product." stepKey="seeSaveConfirmation"/> </actionGroup> + <actionGroup name="ProductSetAdvancedTierFixedPricing" extends="ProductSetAdvancedPricing"> + <remove keyForRemoval="selectProductTierPricePriceInput"/> + <fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput('0')}}" userInput="{{amount}}" stepKey="selectProductTierPricePriceInput" after="selectProductTierPriceValueType"/> + </actionGroup> <!--Assert text in Related, Up-Sell or Cross-Sell section in Admin Product page--> <actionGroup name="AssertTextInAdminProductRelatedUpSellCrossSellSection"> diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml new file mode 100644 index 000000000000..c48631a8d03c --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.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="EnableCatalogInventoryConfigData"> + <!--Default Value --> + <data key="path">cataloginventory/options/can_subtract</data> + <data key="scope_id">0</data> + <data key="label">Yes</data> + <data key="value">1</data> + </entity> + <entity name="DisableCatalogInventoryConfigData"> + <data key="path">cataloginventory/options/can_subtract</data> + <data key="scope_id">0</data> + <data key="label">No</data> + <data key="value">0</data> + </entity> +</entities> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutFillEstimateShippingAndTaxActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutFillEstimateShippingAndTaxActionGroup.xml new file mode 100644 index 000000000000..985d9d3bee18 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutFillEstimateShippingAndTaxActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="CheckoutFillEstimateShippingAndTaxActionGroup"> + <arguments> + <argument name="address" defaultValue="US_Address_TX"/> + </arguments> + <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTaxSummary}}" visible="false" stepKey="openShippingDetails"/> + <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="{{address.country_id}}" stepKey="selectCountry"/> + <selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{address.state}}" stepKey="selectState"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.postcode}}" stepKey="waitForPasswordFieldToBeVisisble"/> + <fillField selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{address.postcode}}" stepKey="selectPostCode"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDiappear"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml new file mode 100644 index 000000000000..3203c8eef5ac --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="FillGuestCheckoutShippingAddressFormActionGroup"> + <arguments> + <argument name="customer" defaultValue="Simple_US_Customer"/> + <argument name="customerAddress" defaultValue="US_Address_TX"/> + </arguments> + <fillField selector="{{CheckoutShippingSection.emailAddress}}" userInput="{{customer.email}}" stepKey="setCustomerEmail"/> + <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customer.firstname}}" stepKey="SetCustomerFirstName"/> + <fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customer.lastname}}" stepKey="SetCustomerLastName"/> + <fillField selector="{{CheckoutShippingSection.street}}" userInput="{{customerAddress.street[0]}}" stepKey="SetCustomerStreetAddress"/> + <fillField selector="{{CheckoutShippingSection.city}}" userInput="{{customerAddress.city}}" stepKey="SetCustomerCity"/> + <fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{customerAddress.postcode}}" stepKey="SetCustomerZipCode"/> + <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddress.telephone}}" stepKey="SetCustomerPhoneNumber"/> + </actionGroup> + <actionGroup name="FillGuestCheckoutShippingAddressWithCountryActionGroup" extends="FillGuestCheckoutShippingAddressFormActionGroup"> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddress.country_id}}" stepKey="selectCountry" after="SetCustomerCity"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCustomerSignInPopUpActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCustomerSignInPopUpActionGroup.xml new file mode 100644 index 000000000000..627ca6237017 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCustomerSignInPopUpActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontCustomerSignInPopUpActionGroup"> + <arguments> + <argument name="customerEmail" type="string"/> + <argument name="customerPwd" type="string"/> + </arguments> + <waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.email}}" stepKey="waitForElementToBeVisible"/> + <fillField stepKey="fillEmail" userInput="{{customerEmail}}" selector="{{StorefrontCustomerSignInPopupFormSection.email}}"/> + <fillField stepKey="fillPassword" userInput="{{customerPwd}}" selector="{{StorefrontCustomerSignInPopupFormSection.password}}"/> + <click stepKey="clickSignInAccountButton" selector="{{StorefrontCustomerSignInPopupFormSection.signIn}}"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontRegisterCustomerAfterCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontRegisterCustomerAfterCheckoutActionGroup.xml new file mode 100644 index 000000000000..b72c63668edf --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontRegisterCustomerAfterCheckoutActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontRegisterCustomerAfterCheckoutActionGroup"> + <arguments> + <argument name="customerPassword" defaultValue="UKCustomer"/> + </arguments> + <click selector="{{CheckoutSuccessRegisterSection.createAccountButton}}" stepKey="clickOnCreateAnAccountButton"/> + <fillField selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" userInput="{{customerPassword.password}}" stepKey="fillPassword"/> + <fillField selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" userInput="{{customerPassword.password}}" stepKey="reconfirmPassword"/> + <click selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}" stepKey="clickOnCreateAnAccount"/> + <seeElement selector="{{StorefrontCustomerMessagesSection.successMessage}}" stepKey="seeSuccessMessage1"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml b/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml new file mode 100644 index 000000000000..13d9385101f1 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Data/CheckoutConfigData.xml @@ -0,0 +1,35 @@ +<?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="EnableGuestCheckoutConfigData"> + <data key="path">checkout/options/guest_checkout</data> + <data key="scope_id">0</data> + <data key="label">Yes</data> + <data key="value">1</data> + </entity> + <entity name="DisableGuestCheckoutConfigData"> + <data key="path">checkout/options/guest_checkout</data> + <data key="scope_id">0</data> + <data key="label">No</data> + <data key="value">0</data> + </entity> + <entity name="EnableHttpsFrontendConfigData"> + <data key="path">web/secure/use_in_frontend</data> + <data key="scope_id">0</data> + <data key="label">Yes</data> + <data key="value">1</data> + </entity> + <entity name="DisableHttpsFrontendConfigData"> + <data key="path">web/secure/use_in_frontend</data> + <data key="scope_id">0</data> + <data key="label">No</data> + <data key="value">0</data> + </entity> +</entities> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml index 8d14a9a56190..9de85ddb369d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml @@ -24,5 +24,6 @@ <element name="countryParameterized" type="select" selector="select[name='country_id'] > option:nth-child({{var}})" timeout="10" parameterized="true"/> <element name="estimateShippingAndTax" type="text" selector="#block-shipping-heading" timeout="5"/> <element name="flatRateShippingMethod" type="input" selector="#s_method_flatrate_flatrate" timeout="30"/> + <element name="estimateShippingAndTaxSummary" type="text" selector="#block-summary"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml index 0206c18b819c..0dc88506027d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml @@ -23,6 +23,7 @@ <element name="guestRegion" type="select" selector=".billing-address-form select[name*='region_id']"/> <element name="guestPostcode" type="input" selector=".billing-address-form input[name*='postcode']"/> <element name="guestTelephone" type="input" selector=".billing-address-form input[name*='telephone']"/> + <element name="guestCountry" type="select" selector=".billing-address-form select[name*='country_id']"/> <element name="billingAddress" type="text" selector=".payment-method._active div.billing-address-details"/> <element name="cartItems" type="text" selector="ol.minicart-items"/> <element name="cartItemsArea" type="button" selector="div.block.items-in-cart"/> @@ -54,5 +55,7 @@ <element name="addressBook" type="button" selector="//a[text()='Address Book']"/> <element name="noQuotes" type="text" selector=".no-quotes-block"/> <element name="paymentMethodByName" type="text" selector="//*[@id='checkout-payment-method-load']//*[contains(@class, 'payment-group')]//label[normalize-space(.)='{{var1}}']" parameterized="true"/> + <element name="checkBankTransferPayment" type="radio" selector="//input[@id='banktransfer']"/> + <element name="billingAddressNotSameBankTransferCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-banktransfer"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml index d825e1039514..ba4f42d3dca2 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml @@ -36,5 +36,9 @@ <element name="stateInput" type="input" selector="input[name=region]"/> <element name="regionOptions" type="select" selector="select[name=region_id] option"/> <element name="editActiveAddress" type="button" selector="//div[@class='shipping-address-item selected-item']//span[text()='Edit']" timeout="30"/> + <element name="password" type="input" selector="#customer-password"/> + <element name="loginButton" type="button" selector="//button[@data-action='checkout-method-login']" timeout="30"/> + <element name="editActiveAddressButton" type="button" selector="//div[@class='payment-method _active']//button[@class='action action-edit-address']" timeout="30"/> + <element name="emailAddress" type="input" selector="#checkout-customer-email"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml index bc65f8a2c081..04eda22c3191 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml @@ -18,5 +18,6 @@ <element name="continueShoppingButton" type="button" selector=".action.primary.continue" timeout="30"/> <element name="createAnAccount" type="button" selector="input[value='Create an Account']" timeout="30"/> <element name="printLink" type="button" selector=".print" timeout="30"/> + <element name="orderNumberWithoutLink" type="text" selector="//div[@class='checkout-success']/p/span"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml new file mode 100644 index 000000000000..f7365dd8522a --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -0,0 +1,129 @@ +<?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="StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify checkout with different shipping and billing address and product with tier prices"/> + <description value="Checkout as a customer with different shipping and billing address and product with tier prices"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14713"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct"> + <field key="price">50.00</field> + </createData> + <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <argument name="productSku" value="$$simpleProduct.sku$$"/> + </actionGroup> + <actionGroup ref="ProductSetAdvancedTierFixedPricing" stepKey="setTierPrice"> + <argument name="website" value=""/> + <argument name="group" value=""/> + <argument name="quantity" value="3"/> + <argument name="price" value="Fixed"/> + <argument name="amount" value="24.00"/> + </actionGroup> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> + <argument name="customerEmail" value="UKCustomer.email"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="enableGuestCheckout"/> + </after> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Add product to the cart --> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="3"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Fill the Estimate Shipping and Tax section --> + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Fill the guest form --> + <actionGroup ref="FillGuestCheckoutShippingAddressWithCountryActionGroup" stepKey="fillGuestForm"> + <argument name="customer" value="UKCustomer"/> + <argument name="customerAddress" value="updateCustomerUKAddress"/> + </actionGroup> + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="waitForPlaceOrderButton"/> + <checkOption selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="selectBankTransfer"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameBankTransferCheckbox}}" stepKey="waitForElementToBeVisible"/> + <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameBankTransferCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/> + <conditionalClick selector="{{CheckoutShippingSection.editActiveAddressButton}}" dependentSelector="{{CheckoutShippingSection.editActiveAddressButton}}" visible="true" stepKey="clickEditButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + + <!-- Fill Billing Address --> + <actionGroup ref="StorefrontFillBillingAddressActionGroup" stepKey="fillBillingAddress"/> + <click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateButton"/> + + <!--Place order and Assert success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + + <!-- Assert Empty Mini Cart --> + <seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/> + + <!-- Register customer after checkout --> + <actionGroup ref="StorefrontRegisterCustomerAfterCheckoutActionGroup" stepKey="registerCustomer"/> + + <!-- Assert Billing Address in Storefront --> + <see selector="{{StorefrontCustomerAddressesSection.billingAddress}}" userInput="{{CustomerUKAddress.street[0]}}" stepKey="seeStreetNameInBillingAddress"/> + <see selector="{{StorefrontCustomerAddressesSection.billingAddress}}" userInput="{{CustomerUKAddress.city}}" stepKey="seeCityInBillingAddress"/> + <see selector="{{StorefrontCustomerAddressesSection.billingAddress}}" userInput="{{CustomerUKAddress.country}}" stepKey="seeCountryInBillingAddress"/> + <see selector="{{StorefrontCustomerAddressesSection.billingAddress}}" userInput="T: {{CustomerUKAddress.telephone}}" stepKey="seeTelephoneInBillingAddress"/> + + <!-- Assert Billing Address in Storefront --> + <see selector="{{StorefrontCustomerAddressesSection.shippingAddress}}" userInput="{{updateCustomerUKAddress.street[0]}}" stepKey="seeStreetNameInShippingAddress"/> + <see selector="{{StorefrontCustomerAddressesSection.shippingAddress}}" userInput="{{updateCustomerUKAddress.city}}" stepKey="seeCityInShippingAddress"/> + <see selector="{{StorefrontCustomerAddressesSection.shippingAddress}}" userInput="{{updateCustomerUKAddress.country}}" stepKey="seeCountryInShippingAddress"/> + <see selector="{{StorefrontCustomerAddressesSection.shippingAddress}}" userInput="T: {{updateCustomerUKAddress.telephone}}" stepKey="seeTelephoneInShippingAddress"/> + + <!--Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForOrderIndexPageToLoad"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Assert Grand Total --> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$87.00" stepKey="seeGrandTotal"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> + + <!-- Ship the order and assert the status --> + <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> + + <!-- Assert order buttons --> + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> + + <!-- Sign out Customer from storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml new file mode 100644 index 000000000000..c52e8b73b262 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml @@ -0,0 +1,102 @@ +<?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="StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify UK customer checkout with different billing and shipping address and register customer after checkout"/> + <description value="Checkout as UK customer with different shipping/billing address and register checkout method"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14712"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct"> + <field key="price">50.00</field> + </createData> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> + <argument name="customerEmail" value="UKCustomer.email"/> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Add product to the cart --> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="1"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Fill the Estimate Shipping and Tax section --> + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Fill the guest form --> + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillGuestForm"> + <argument name="customer" value="UKCustomer"/> + <argument name="customerAddress" value="updateCustomerUKAddress"/> + </actionGroup> + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="waitForElementToBeVisible"/> + <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/> + <conditionalClick selector="{{CheckoutShippingSection.editAddressButton}}" dependentSelector="{{CheckoutShippingSection.editAddressButton}}" visible="true" stepKey="clickEditButton"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + + <!-- Fill Billing Address --> + <actionGroup ref="StorefrontFillBillingAddressActionGroup" stepKey="fillBillingAddress"/> + <click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateButton"/> + + <!--Place order --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + <seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/> + + <!-- Register customer after checkout --> + <actionGroup ref="StorefrontRegisterCustomerAfterCheckoutActionGroup" stepKey="registerCustomer"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad5"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Assert Grand Total --> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$55.00" stepKey="seeGrandTotal"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> + + <!-- Ship the order and assert the status --> + <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> + + <!-- Assert order buttons --> + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> + + <!-- Sign out Customer from storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml new file mode 100644 index 000000000000..6ccb05bf4c4f --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithSpecialPriceProductsTest.xml @@ -0,0 +1,171 @@ +<?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="StorefrontCheckoutWithSpecialPriceProductsTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify customer checkout with special price simple and configurable products"/> + <description value="Create simple and configurable product with special prices and verify customer checkout"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14708"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="defaultSimpleProduct" stepKey="simpleProduct"> + <field key="price">10.00</field> + </createData> + + <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <argument name="productSku" value="$$simpleProduct.sku$$"/> + </actionGroup> + + <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceTopTheProduct"> + <argument name="price" value="9"/> + </actionGroup> + <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/> + <waitForPageLoad time='60' stepKey="waitForProducrSaved"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSaveSuccessMessage"/> + + <!-- Create the configurable product with product Attribute options--> + <createData entity="ApiCategory" stepKey="createCategory"/> + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="AddToDefaultSet" stepKey="delete"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <field key="price">20.00</field> + </createData> + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + <field key="price">10.00</field> + </createData> + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct1"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct2"/> + </createData> + + <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct2"> + <argument name="productSku" value="$$createConfigChildProduct2.sku$$"/> + </actionGroup> + <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceTopTheProduct2"> + <argument name="price" value="9"/> + </actionGroup> + <click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct1"/> + <waitForPageLoad time='60' stepKey="waitForSpecialPriceProductSaved"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSaveSuccessMessage1"/> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + </before> + <after> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigProduct1"/> + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigProduct2"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Add product to the cart --> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="1"/> + </actionGroup> + + <!-- Add Configurable Product to the cart --> + <actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart"> + <argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" /> + <argument name="productAttribute" value="$$createConfigProductAttribute.default_value$$"/> + <argument name="productOption" value="$$getConfigAttributeOption2.label$$"/> + <argument name="qty" value="1"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Fill the Estimate Shipping and Tax section --> + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Sign in using already existed customer details --> + <fillField selector="{{CheckoutShippingSection.emailAddress}}" userInput="$$createCustomer.email$$" stepKey="fillEmailAddress"/> + <waitForElementVisible selector="{{CheckoutShippingSection.password}}" stepKey="waitForPasswordFieldToBeVisible"/> + <fillField selector="{{CheckoutShippingSection.password}}" userInput="$$createCustomer.password$$" stepKey="fillPassword"/> + <click selector="{{CheckoutShippingSection.loginButton}}" stepKey="clickLoginButton"/> + <waitForPageLoad stepKey="waitForLoginPageToLoad"/> + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> + + <!-- Place order and Assert success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + + <!-- Assert empty Mini Cart --> + <seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad5"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Assert Grand Total --> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$28.00" stepKey="seeGrandTotal"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> + + <!-- Ship the order and assert the status --> + <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> + + <!-- Assert order buttons --> + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml new file mode 100644 index 000000000000..4d205e0d4049 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml @@ -0,0 +1,92 @@ +<?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="StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify customer is redirected to checkout on login when guest checkout is disabled"/> + <description value="Customer is redirected to checkout on login when guest checkout is disabled"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14703"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <magentoCLI command="config:set {{DisableGuestCheckoutConfigData.path}} {{DisableGuestCheckoutConfigData.value}}" stepKey="disableGuestCheckout"/> + <magentoCLI command="config:set {{DisableCustomerRedirectToDashboardConfigData.path}} {{DisableCustomerRedirectToDashboardConfigData.value}}" stepKey="disableCustomerRedirect"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct"> + <field key="price">50.00</field> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <magentoCLI command="config:set {{EnableGuestCheckoutConfigData.path}} {{EnableGuestCheckoutConfigData.value}}" stepKey="enableGuestCheckout"/> + <magentoCLI command="config:set {{EnableCustomerRedirectToDashboardConfigData.path}} {{EnableCustomerRedirectToDashboardConfigData.value}}" stepKey="enableCustomerRedirect"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Add product to the cart --> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="1"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Fill the Estimate Shipping and Tax section --> + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + + <!--Fill the pop up sign form --> + <actionGroup ref="StorefrontCustomerSignInPopUpActionGroup" stepKey="customerSignIn"> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + <argument name="customerPwd" value="$$createCustomer.password$$"/> + </actionGroup> + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> + + <!-- Verify order summary on payment page --> + <actionGroup ref="VerifyCheckoutPaymentOrderSummaryActionGroup" stepKey="verifyCheckoutPaymentOrderSummary"> + <argument name="orderSummarySubTotal" value="$50.00"/> + <argument name="orderSummaryShippingTotal" value="$5.00"/> + <argument name="orderSummaryTotal" value="$55.00"/> + </actionGroup> + + <!-- Place order and Assert success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Ship the order and assert the shipping status --> + <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> + + <!-- Sign out Customer from storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml new file mode 100644 index 000000000000..b523a6e3b9e6 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml @@ -0,0 +1,132 @@ +<?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="StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify customer checkout by following new customer registration when guest checkout is disabled"/> + <description value="Customer is redirected to checkout on login, follow the new Customer registration when guest checkout is disabled"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14704"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <magentoCLI command="config:set {{DisableGuestCheckoutConfigData.path}} {{DisableGuestCheckoutConfigData.value}}" stepKey="disableGuestCheckout"/> + <magentoCLI command="config:set {{DisableCustomerRedirectToDashboardConfigData.path}} {{DisableCustomerRedirectToDashboardConfigData.value}}" stepKey="disableCustomerRedirect"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct"> + <field key="price">50.00</field> + </createData> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <magentoCLI command="config:set {{EnableGuestCheckoutConfigData.path}} {{EnableGuestCheckoutConfigData.value}}" stepKey="enableGuestCheckout"/> + <magentoCLI command="config:set {{EnableCustomerRedirectToDashboardConfigData.path}} {{EnableCustomerRedirectToDashboardConfigData.value}}" stepKey="enableCustomerRedirect"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Add product to the cart --> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="1"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!--Create an account--> + <waitForElementVisible selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="waitForElementToBeVisible"/> + <click selector="{{StorefrontCustomerSignInPopupFormSection.createAnAccount}}" stepKey="clickOnCreateAnAccountButton"/> + <waitForPageLoad stepKey="waitForCreateAccountPageToLoad"/> + + <!--Fill the registration form --> + <actionGroup ref="StorefrontFillCustomerAccountCreationFormActionGroup" stepKey="createNewCustomerAccount"> + <argument name="customer" value="Simple_US_Customer" /> + </actionGroup> + <click stepKey="clickCreateAccountButton" selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}"/> + <waitForPageLoad stepKey="waitForCreateAccountButtonToLoad"/> + + <!--Assert customer information--> + <see stepKey="seeThankYouMessage" userInput="Thank you for registering with Main Website Store."/> + <see stepKey="seeFirstName" userInput="{{Simple_US_Customer.firstname}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" /> + <see stepKey="seeLastName" userInput="{{Simple_US_Customer.lastname}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" /> + <see stepKey="seeEmail" userInput="{{Simple_US_Customer.email}}" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" /> + + <!--Fill Address details --> + <click selector="{{CheckoutPaymentSection.addressBook}}" stepKey="goToAddressBook"/> + <fillField stepKey="fillPhoneNumber" userInput="{{US_Address_TX.telephone}}" selector="{{StorefrontCustomerAddressFormSection.phoneNumber}}"/> + <fillField stepKey="fillStreetAddress" userInput="{{US_Address_TX.street[0]}}" selector="{{StorefrontCustomerAddressFormSection.streetAddress}}"/> + <fillField stepKey="fillCity" userInput="{{US_Address_TX.city}}" selector="{{StorefrontCustomerAddressFormSection.city}}"/> + <selectOption stepKey="selectStateForAddress" userInput="{{CustomerAddressSimple.state}}" selector="{{StorefrontCustomerAddressFormSection.state}}"/> + <fillField stepKey="fillZip" userInput="{{US_Address_TX.postcode}}" selector="{{StorefrontCustomerAddressFormSection.zip}}"/> + <selectOption stepKey="selectCountryForAddress" userInput="{{US_Address_TX.country}}" selector="{{StorefrontCustomerAddressFormSection.country}}"/> + <click stepKey="saveCustomerAddress" selector="{{StorefrontCustomerAddressFormSection.saveAddress}}"/> + <see userInput="You saved the address." stepKey="verifyAddressAdded"/> + + <!-- Open Edit and View from cart --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="openViewAndEditOption"/> + + <!-- Proceed to checkout --> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout1"/> + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> + + <!-- Verify order summary on payment page --> + <actionGroup ref="VerifyCheckoutPaymentOrderSummaryActionGroup" stepKey="verifyCheckoutPaymentOrderSummary"> + <argument name="orderSummarySubTotal" value="$50.00"/> + <argument name="orderSummaryShippingTotal" value="$5.00"/> + <argument name="orderSummaryTotal" value="$55.00"/> + </actionGroup> + + <!-- Assert Shipping Address --> + <actionGroup ref="CheckShipToInformationInCheckoutActionGroup" stepKey="assertShippingAddressDetails"> + <argument name="customerVar" value="Simple_US_Customer"/> + <argument name="customerAddressVar" value="US_Address_TX"/> + </actionGroup> + + <!-- Assert Billing Address --> + <actionGroup ref="CheckBillingAddressInCheckoutActionGroup" stepKey="assertBillingAddressDetails"> + <argument name="customerVar" value="Simple_US_Customer"/> + <argument name="customerAddressVar" value="US_Address_TX"/> + </actionGroup> + <see userInput="Flat Rate - Fixed" selector="{{CheckoutPaymentSection.shippingMethodInformation}}" stepKey="assertShippingMethodInformation"/> + + <!-- Place order and Assert success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Ship the order and assert the shipping status --> + <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> + + <!-- Sign out Customer from storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml new file mode 100644 index 000000000000..728225d46008 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -0,0 +1,221 @@ +<?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="StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify guest checkout using free shipping and tax variations"/> + <description value="Verify guest checkout using free shipping and tax variations"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14709"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/> + <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> + <createData entity="MinimumOrderAmount100" stepKey="minimumOrderAmount100"/> + <createData entity="taxRate_US_NY_8_1" stepKey="createTaxRule"/> + + <!--Create Simple Product --> + <createData entity="defaultSimpleProduct" stepKey="simpleProduct"> + <field key="price">10.00</field> + </createData> + + <!-- Create the configurable product with product Attribute options--> + <createData entity="ApiCategory" stepKey="createCategory"/> + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + + <createData entity="AddToDefaultSet" stepKey="addToDefaultSet"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <field key="price">10.00</field> + </createData> + + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct1"/> + </createData> + + <!-- Create Bundle Product --> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">100.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">200.00</field> + </createData> + <!--Create Bundle product with multi select option--> + <createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="MultipleSelectOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="required">True</field> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + </before> + <after> + <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> + <argument name="taxRuleCode" value="{{SimpleTaxRule.code}}" /> + </actionGroup> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigProduct1"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule1"/> + <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> + <createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Create a Tax Rule --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/> + <waitForPageLoad stepKey="waitForTaxRuleIndex1"/> + <click selector="{{AdminTaxRuleGridSection.add}}" stepKey="clickAddNewTaxRuleButton"/> + <waitForPageLoad stepKey="waitForTaxRuleIndex2"/> + + <!-- Create a tax rule with defaults --> + <fillField selector="{{AdminTaxRuleFormSection.code}}" userInput="{{SimpleTaxRule.code}}" stepKey="fillTaxRuleCode1"/> + <fillField selector="{{AdminTaxRuleFormSection.taxRateSearch}}" userInput="$$createTaxRule.code$$" stepKey="fillTaxRateSearch"/> + <wait stepKey="waitForSearch" time="5" /> + <click selector="{{AdminTaxRuleFormSection.taxRateOption($$createTaxRule.code$$)}}" stepKey="selectNeededItem" /> + <click selector="{{AdminTaxRuleFormSection.save}}" stepKey="saveTaxRule" /> + <waitForPageLoad stepKey="waitForTaxRuleSaved" /> + + <!-- Verify we see success message --> + <see selector="{{AdminTaxRuleGridSection.successMessage}}" userInput="You saved the tax rule." stepKey="assertTaxRuleSuccessMessage" /> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Add product to the cart --> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="1"/> + </actionGroup> + + <!-- Add Configurable Product to the cart --> + <actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart"> + <argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" /> + <argument name="productAttribute" value="$$createConfigProductAttribute.default_value$$"/> + <argument name="productOption" value="$$getConfigAttributeOption1.label$$"/> + <argument name="qty" value="1"/> + </actionGroup> + + <!--Open Product page in StoreFront --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openBundleProduct"> + <argument name="product" value="$$createBundleProduct$$"/> + </actionGroup> + + <!-- Click on customize And Add To Cart Button --> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickOnCustomizeAndAddtoCartButton"/> + + <!-- Select Two Products, enter the quantity and add product to the cart --> + <selectOption selector="{{StorefrontBundledSection.multiSelectOption}}" userInput="$$simpleProduct1.name$$ +$100.00" stepKey="selectOption"/> + <actionGroup ref="StorefrontEnterProductQuantityAndAddToTheCartActionGroup" stepKey="enterProductQuantityAndAddToTheCart"> + <argument name="quantity" value="1"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Fill the Estimate Shipping and Tax section --> + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"> + <argument name="address" value="US_Address_NY_Default_Shipping"/> + </actionGroup> + <reloadPage stepKey="reloadThePage"/> + <waitForPageLoad stepKey="waitForPageToReload"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.taxAmount}}" stepKey="waitForShippingOption"/> + <see selector="{{CheckoutCartSummarySection.taxAmount}}" userInput="$9.60" stepKey="seeTaxInTheCartSummary"/> + + <!--Select Free Shipping and proceed to checkout --> + <click selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="selectFlatRateShippingMethod"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Fill Guest form --> + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillTheSignInForm"> + <argument name="customer" value="Simple_US_Customer"/> + <argument name="customerAddress" value="US_Address_NY_Default_Shipping"/> + </actionGroup> + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> + + <!-- Place order and Assert success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + + <!-- Assert empty Mini Cart --> + <seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad5"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Assert order buttons --> + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> + + <!-- Assert Grand Total --> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$129.60" stepKey="seeGrandTotal"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> + + <!-- Ship the order and assert the status --> + <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> + + <!-- Assert customer order address --> + <actionGroup ref="AssertOrderAddressInformationActionGroup" stepKey="assertCustomerInformation"> + <argument name="customer" value=""/> + <argument name="shippingAddress" value="US_Address_NY_Default_Shipping"/> + <argument name="billingAddress" value="US_Address_NY_Default_Shipping"/> + <argument name="customerGroup" value=""/> + </actionGroup> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml new file mode 100644 index 000000000000..33ec099aa2ac --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest.xml @@ -0,0 +1,93 @@ +<?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="StorefrontGuestCheckoutWithCouponAndZeroSubtotalTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify guest checkout with virtual product using coupon for not logged in customers with Zero Subtotal"/> + <description value="Checkout with virtual product using coupon for not logged in customers with Zero Subtotal"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14710"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <createData entity="VirtualProduct" stepKey="virtualProduct"> + <field key="price">50.00</field> + </createData> + <createData entity="SalesRuleNoCouponWithFixedDiscount" stepKey="createSalesRule"/> + </before> + <after> + <deleteData createDataKey="virtualProduct" stepKey="deleteVirtualProduct"/> + <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openVirtualProductPageAndVerifyProduct"> + <argument name="product" value="$$virtualProduct$$"/> + </actionGroup> + + <!-- Add Product to the cart --> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <argument name="productName" value="$$virtualProduct.name$$"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Fill the Estimate Shipping and Tax section --> + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> + + <!-- Assert Discount and proceed to checkout --> + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> + <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="-$50.00" stepKey="seeDiscountTotal"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!--Fill Customer Information --> + <fillField selector="{{CheckoutShippingSection.emailAddress}}" userInput="{{Simple_US_Customer.email}}" stepKey="enterEmail"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading" /> + <fillField selector="{{CheckoutPaymentSection.guestFirstName}}" userInput="{{Simple_US_Customer.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutPaymentSection.guestLastName}}" userInput="{{Simple_US_Customer.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutPaymentSection.guestStreet}}" userInput="{{US_Address_TX.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutPaymentSection.guestCity}}" userInput="{{US_Address_TX.city}}" stepKey="enterCity"/> + <selectOption selector="{{CheckoutPaymentSection.guestRegion}}" userInput="{{US_Address_TX.state}}" stepKey="selectRegion"/> + <fillField selector="{{CheckoutPaymentSection.guestPostcode}}" userInput="{{US_Address_TX.postcode}}" stepKey="enterPostcode"/> + <fillField selector="{{CheckoutPaymentSection.guestTelephone}}" userInput="{{US_Address_TX.telephone}}" stepKey="enterTelephone"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.update}}" stepKey="waitForUpdateButton"/> + <click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateButton"/> + + <!-- Place order and Assert success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + + <!-- Assert empty Mini Cart --> + <seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad5"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Assert order buttons --> + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> + + <!-- Assert Grand Total --> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$0.00" stepKey="seeGrandTotal"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml new file mode 100644 index 000000000000..e5f6c52e445c --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml @@ -0,0 +1,105 @@ +<?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="StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify product quantity changes in backend after customer checkout"/> + <description value="Checkout as UK customer with bank transfer payment method and verify product quantity reduced after order processed "/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14707"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> + <magentoCLI command="config:set {{EnableCatalogInventoryConfigData.path}} {{EnableCatalogInventoryConfigData.value}}" stepKey="enableCatalogInventoryStock"/> + <createData entity="defaultSimpleProduct" stepKey="simpleProduct"> + <field key="price">10.00</field> + </createData> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="enableGuestCheckout"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Add product to the cart --> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="100"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Fill the Estimate Shipping and Tax section --> + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Fill Customer Sign In Information --> + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillGuestForm"> + <argument name="customer" value="UKCustomer"/> + <argument name="customerAddress" value="updateCustomerUKAddress"/> + </actionGroup> + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="selectBankTransfer"/> + + <!-- Place order and Assert success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + + <!-- Assert empty Mini Cart --> + <seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad5"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Assert Grand Total --> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$1,500.00" stepKey="seeGrandTotal"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> + + <!-- Ship the order and assert the status --> + <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> + + <!-- Assert order buttons --> + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> + + <!-- Assert Product Quantity in backend reduced after order processed --> + <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <argument name="productSku" value="$$simpleProduct.sku$$"/> + </actionGroup> + <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeProductName"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="0" stepKey="seeProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="seeProductStockStatus"/> + + <!-- Assert Product is Out of Stock in frontend --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="assertProductInStorefront"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml new file mode 100644 index 000000000000..0e5d50df0fb3 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml @@ -0,0 +1,128 @@ +<?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="StorefrontUKCustomerCheckoutWithCouponTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify UK customer checkout with Virtual and Downloadable products using coupon"/> + <description value="Checkout as UK Customer with virtual product and downloadable product using coupon"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14705"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <createData entity="ApiDownloadableProduct" stepKey="createDownloadableProduct"> + <field key="price">20.00</field> + </createData> + <createData entity="downloadableLink1" stepKey="addDownloadableLink1"> + <requiredEntity createDataKey="createDownloadableProduct"/> + </createData> + <createData entity="downloadableLink2" stepKey="addDownloadableLink2"> + <requiredEntity createDataKey="createDownloadableProduct"/> + </createData> + <createData entity="VirtualProduct" stepKey="virtualProduct"> + <field key="price">10.00</field> + </createData> + <createData entity="UKCustomer" stepKey="createCustomer"/> + <createData entity="SalesRuleSpecificCouponAndByPercent" stepKey="createSalesRule"/> + <createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule"> + <requiredEntity createDataKey="createSalesRule"/> + </createData> + </before> + <after> + <deleteData createDataKey="createDownloadableProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="virtualProduct" stepKey="deleteVirtualProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Open Downloadable Product page --> + <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="OpenStoreFrontProductPage"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Add Downloadable product to the cart --> + <actionGroup ref="StorefrontAddToCartCustomOptionsProductPageActionGroup" stepKey="addToTheCart"> + <argument name="productName" value="$$createDownloadableProduct.name$$" /> + </actionGroup> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openVirtualProductPageAndVerifyProduct"> + <argument name="product" value="$$virtualProduct$$"/> + </actionGroup> + + <!-- Add Product to the cart --> + <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProduct1ToTheCart"> + <argument name="productName" value="$$virtualProduct.name$$"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Apply Coupon --> + <actionGroup ref="StorefrontApplyCouponActionGroup" stepKey="applyDiscount"> + <argument name="coupon" value="$$createCouponForCartPriceRule$$"/> + </actionGroup> + + <!-- Assert Discount and proceed to checkout --> + <waitForElementVisible selector="{{CheckoutCartSummarySection.discountAmount}}" stepKey="waitForDiscountElement"/> + <see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="-$15.00" stepKey="seeDiscountTotal"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad1"/> + + <!--Fill the pop up sign form --> + <actionGroup ref="StorefrontCustomerSignInPopUpActionGroup" stepKey="customerSignIn"> + <argument name="customerEmail" value="$$createCustomer.email$$"/> + <argument name="customerPwd" value="$$createCustomer.password$$"/> + </actionGroup> + + <!-- Click and open order summary tab--> + <conditionalClick selector="{{CheckoutOrderSummarySection.miniCartTab}}" dependentSelector="{{CheckoutOrderSummarySection.miniCartTabClosed}}" visible="true" stepKey="clickOnOrderSummaryTab"/> + <waitForPageLoad stepKey="waitForPageToLoad5"/> + + <!-- Assert Product displayed in Order Summary --> + <actionGroup ref="StorefrontAssertProductDetailsInOrderSummaryActionGroup" stepKey="assertProduct3InOrderSummary"> + <argument name="productName" value="$$virtualProduct.name$$"/> + <argument name="qty" value="1"/> + <argument name="price" value="$10.00"/> + </actionGroup> + <waitForElementVisible selector="{{CheckoutPaymentSection.update}}" stepKey="waitForUpdateButton"/> + <click selector="{{CheckoutPaymentSection.update}}" stepKey="clickOnUpdateButton"/> + + <!-- Place the order and Verify Success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + + <!-- Assert empty Mini Cart --> + <seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderLink}}" stepKey="orderId"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad5"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="$$createCustomer.fullname$$" stepKey="seeCustomerNameInGrid"/> + <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="$15.00" stepKey="seeGrandTotalInGrid"/> + <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="Pending" stepKey="seeStatusIdInGrid"/> + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnOrderViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Assert order buttons --> + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> + + <!-- Assert Grand Total --> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$15.00" stepKey="seeGrandTotal"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml new file mode 100644 index 000000000000..deab32aede32 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest.xml @@ -0,0 +1,100 @@ +<?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="StorefrontUKGuestCheckoutWithConditionProductQuantityEqualsToOrderedQuantityTest"> + <annotations> + <stories value="Checkout"/> + <title value="Checkout as UK guest with condition available product quantity equals to ordered product quantity"/> + <description value="Checkout as UK guest with condition available product quantity equals to ordered product quantity"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14711"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <createData entity="defaultSimpleProduct" stepKey="simpleProduct"> + <field key="price">10.00</field> + </createData> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Add product to the cart --> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="100"/> + </actionGroup> + + <!--Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Fill the Estimate Shipping and Tax section --> + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Fill Customer Sign In Information --> + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillGuestForm"> + <argument name="customer" value="UKCustomer"/> + <argument name="customerAddress" value="UK_Not_Default_Address"/> + </actionGroup> + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> + + <!-- Place order and Assert success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + + <!-- Assert empty Mini Cart --> + <seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad5"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Assert Grand Total --> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$1,500.00" stepKey="seeGrandTotal"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> + + <!-- Ship the order and assert the status --> + <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> + + <!-- Assert order buttons --> + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> + + <!-- Assert Product Quantity in backend reduced after order processed --> + <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> + <argument name="productSku" value="$$simpleProduct.sku$$"/> + </actionGroup> + <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeProductName"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="0" stepKey="seeProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="Out of Stock" stepKey="seeProductStockStatus"/> + + <!-- Assert Product is Out of Stock in frontend --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="assertProductInStorefront"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="Out Of Stock" stepKey="seeProductDisplayedAsOutOfStock"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml new file mode 100644 index 000000000000..72b124ca0d00 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml @@ -0,0 +1,97 @@ +<?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="StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest"> + <annotations> + <stories value="Checkout"/> + <title value="Verify US customer checkout using coupon and bank transfer payment method"/> + <description value="Checkout as US customer using coupon and bank transfer payment method"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14706"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct"> + <field key="price">50.00</field> + </createData> + <createData entity="SalesRuleSpecificCouponAndByPercent" stepKey="createSalesRule"/> + <createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule"> + <requiredEntity createDataKey="createSalesRule"/> + </createData> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> + <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="disableBankTransferPayment"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Open Product page in StoreFront and assert product and price range --> + <actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKey" stepKey="openProductPageAndVerifyProduct"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!-- Add product to the cart --> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="1"/> + </actionGroup> + + <!-- Open View and edit --> + <actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="clickMiniCart"/> + + <!-- Fill the Estimate Shipping and Tax section --> + <actionGroup ref="CheckoutFillEstimateShippingAndTaxActionGroup" stepKey="fillEstimateShippingAndTaxFields"/> + + <!-- Apply Coupon --> + <actionGroup ref="StorefrontApplyCouponActionGroup" stepKey="applyDiscount"> + <argument name="coupon" value="$$createCouponForCartPriceRule$$"/> + </actionGroup> + + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Fill the guest form --> + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillGuestForm"/> + <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> + <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="waitForPlaceOrderButton"/> + <checkOption selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="selectBankTransfer"/> + + <!-- Place order and Assert success message --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + + <!-- Assert empty Mini Cart --> + <seeElement selector="{{StorefrontMiniCartSection.emptyMiniCart}}" stepKey="assertEmptyCart" /> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumberWithoutLink}}" stepKey="orderId"/> + + <!-- Open Order Index Page --> + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + + <!-- Filter Order using orderId and assert order--> + <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> + <argument name="orderId" value="$orderId"/> + </actionGroup> + <click selector="{{AdminOrdersGridSection.viewLink('$orderId')}}" stepKey="clickOnViewLink"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!-- Assert Grand Total --> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$25.00" stepKey="seeGrandTotal"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderStatus"/> + + <!-- Ship the order and assert the status --> + <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> + + <!-- Assert order buttons --> + <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillBillingAddressActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillBillingAddressActionGroup.xml new file mode 100644 index 000000000000..1521f8c6f1f7 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillBillingAddressActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontFillBillingAddressActionGroup"> + <arguments> + <argument name="address" defaultValue="CustomerUKAddress"/> + </arguments> + <fillField selector="{{CheckoutPaymentSection.guestFirstName}}" userInput="{{address.firstname}}" stepKey="enterFirstName"/> + <fillField selector="{{CheckoutPaymentSection.guestLastName}}" userInput="{{address.lastname}}" stepKey="enterLastName"/> + <fillField selector="{{CheckoutPaymentSection.guestStreet}}" userInput="{{address.street[0]}}" stepKey="enterStreet"/> + <fillField selector="{{CheckoutPaymentSection.guestCity}}" userInput="{{address.city}}" stepKey="enterCity"/> + <fillField selector="{{CheckoutPaymentSection.guestPostcode}}" userInput="{{address.postcode}}" stepKey="enterPostcode"/> + <selectOption selector="{{CheckoutPaymentSection.guestCountry}}" userInput="{{address.country_id}}" stepKey="enterCountry"/> + <fillField selector="{{CheckoutPaymentSection.guestTelephone}}" userInput="{{address.telephone}}" stepKey="enterTelephone"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml index 5d1a90016714..59d0eb550764 100755 --- a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml @@ -271,4 +271,18 @@ <data key="default_shipping">Yes</data> <requiredEntity type="region">RegionUT</requiredEntity> </entity> + <entity name="CustomerUKAddress" type="address"> + <data key="firstname">Jane</data> + <data key="lastname">Miller</data> + <data key="company">Magento</data> + <data key="telephone">44 20 7123 1234</data> + <array key="street"> + <item>1 London Bridge Street</item> + </array> + <data key="country_id">GB</data> + <data key="country">United Kingdom</data> + <data key="city">London</data> + <data key="state"></data> + <data key="postcode">SE12 9GF</data> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerConfigData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerConfigData.xml index 3cbd70d34282..1bb90a1a1154 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerConfigData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerConfigData.xml @@ -21,4 +21,16 @@ <entity name="GlobalCustomerAccountSharing" type="account_share_scope_value"> <data key="value">0</data> </entity> + <entity name="EnableCustomerRedirectToDashboardConfigData"> + <data key="path">customer/startup/redirect_dashboard</data> + <data key="scope_id">0</data> + <data key="label">Yes</data> + <data key="value">1</data> + </entity> + <entity name="DisableCustomerRedirectToDashboardConfigData"> + <data key="path">customer/startup/redirect_dashboard</data> + <data key="scope_id">0</data> + <data key="label">No</data> + <data key="value">0</data> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml index 4796fd73e104..35065f7c876e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml +++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml @@ -216,4 +216,18 @@ <data key="store_id">0</data> <data key="website_id">0</data> </entity> + <entity name="UKCustomer" type="customer"> + <data key="group_id">0</data> + <data key="default_billing">true</data> + <data key="default_shipping">true</data> + <data key="email" unique="prefix">david@email.com</data> + <data key="firstname">David</data> + <data key="lastname">Mill</data> + <data key="fullname">David Mill</data> + <data key="password">pwdTest123!</data> + <data key="gender">0</data> + <data key="store_id">0</data> + <data key="website_id">0</data> + <requiredEntity type="address">updateCustomerUKAddress</requiredEntity> + </entity> </entities> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml index aad9d0284227..52430cfb0225 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml @@ -18,5 +18,7 @@ <element name="editAdditionalAddress" type="button" selector="//tbody//tr[{{var}}]//a[@class='action edit']" parameterized="true" timeout="30"/> <element name="addNewAddress" type="button" selector="//span[text()='Add New Address']"/> <element name="numberOfAddresses" type="text" selector=".toolbar-number"/> + <element name="shippingAddress" type="text" selector="//div[@class='box box-shipping-address']//div/address"/> + <element name="billingAddress" type="text" selector="//div[@class='box box-billing-address']//div/address"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml index 7bc057b8be7b..99eb54627eb2 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml @@ -19,5 +19,6 @@ <element name="email" type="input" selector="#customer-email"/> <element name="password" type="input" selector="#pass"/> <element name="signIn" type="button" selector="#send2" timeout="30"/> + <element name="createAnAccount" type="button" selector="//div[@class='actions-toolbar']//a[contains(.,'Create an Account')]" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Payment/Test/Mftf/Data/PaymentConfigData.xml b/app/code/Magento/Payment/Test/Mftf/Data/PaymentConfigData.xml new file mode 100644 index 000000000000..f3c27902be57 --- /dev/null +++ b/app/code/Magento/Payment/Test/Mftf/Data/PaymentConfigData.xml @@ -0,0 +1,35 @@ +<?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="EnablePaymentCheckMOConfigData"> + <data key="path">payment/checkmo/active</data> + <data key="scope_id">0</data> + <data key="label">Yes</data> + <data key="value">1</data> + </entity> + <entity name="DisablePaymentCheckMOConfigData"> + <data key="path">payment/checkmo/active</data> + <data key="scope_id">0</data> + <data key="label">No</data> + <data key="value">0</data> + </entity> + <entity name="EnablePaymentBankTransferConfigData"> + <data key="path">payment/banktransfer/active</data> + <data key="scope_id">0</data> + <data key="label">Yes</data> + <data key="value">1</data> + </entity> + <entity name="DisablePaymentBankTransferConfigData"> + <data key="path">payment/banktransfer/active</data> + <data key="scope_id">0</data> + <data key="label">No</data> + <data key="value">0</data> + </entity> +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertOrderAvailableButtonsActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertOrderAvailableButtonsActionGroup.xml new file mode 100644 index 000000000000..39520fd9ec2e --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertOrderAvailableButtonsActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertOrderAvailableButtonsActionGroup"> + <seeElement selector="{{AdminOrderDetailsMainActionsSection.back}}" stepKey="seeBackButton"/> + <seeElement selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="seeCancelButton"/> + <seeElement selector="{{AdminOrderDetailsMainActionsSection.sendEmail}}" stepKey="seeSendEmailButton"/> + <seeElement selector="{{AdminOrderDetailsMainActionsSection.hold}}" stepKey="seeHoldButton"/> + <seeElement selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="seeInvoiceButton"/> + <seeElement selector="{{AdminOrderDetailsMainActionsSection.reorder}}" stepKey="seeReorderButton"/> + <seeElement selector="{{AdminOrderDetailsMainActionsSection.edit}}" stepKey="seeEditButton"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml index 0e09f3933c1a..c6c9f21a4014 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml @@ -281,6 +281,15 @@ <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country_id}}" stepKey="seeShippingAddressCountry"/> <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.postcode}}" stepKey="seeShippingAddressPostcode"/> </actionGroup> + <actionGroup name="AssertOrderAddressInformationActionGroup" extends="verifyBasicOrderInformation"> + <remove keyForRemoval="seeCustomerName"/> + <remove keyForRemoval="seeCustomerEmail"/> + <remove keyForRemoval="seeCustomerGroup"/> + <remove keyForRemoval="seeBillingAddressCountry"/> + <remove keyForRemoval="seeShippingAddressCountry"/> + <see selector="{{AdminOrderAddressInformationSection.billingAddress}}" userInput="{{billingAddress.country}}" stepKey="seeBillingCountry" after="seeBillingAddressCity"/> + <see selector="{{AdminOrderAddressInformationSection.shippingAddress}}" userInput="{{shippingAddress.country}}" stepKey="seeAddressCountry" after="seeShippingAddressCity"/> + </actionGroup> <!--Verify order information--> <actionGroup name="verifyCreatedOrderInformation"> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminShipThePendingOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminShipThePendingOrderActionGroup.xml new file mode 100644 index 000000000000..1084bdc08bbc --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminShipThePendingOrderActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminShipThePendingOrderActionGroup"> + <waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="waitForShipTab"/> + <click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipButton"/> + <waitForPageLoad stepKey="waitForShippingPageToLoad"/> + <scrollTo selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="scrollToSubmitShipmentButton"/> + <click selector="{{AdminShipmentMainActionsSection.submitShipment}}" stepKey="clickOnSubmitShipmentButton"/> + <waitForPageLoad stepKey="waitToProcessShippingPageToLoad"/> + <see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Processing" stepKey="seeOrderStatus"/> + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The shipment has been created." stepKey="seeShipmentCreateSuccess"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml index 53a6cbffcdac..c87a1b70cb8f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrdersGridSection.xml @@ -31,5 +31,6 @@ <element name="viewColumnCheckbox" type="checkbox" selector="//div[contains(@class,'admin__data-grid-action-columns')]//div[contains(@class, 'admin__field-option')]//label[text() = '{{column}}']/preceding-sibling::input" parameterized="true"/> <element name="customerInOrdersSection" type="button" selector="(//td[contains(text(),'{{customer}}')])[1]" parameterized="true"/> <element name="productForOrder" type="button" selector="//td[contains(text(),'{{var}}')]" parameterized="true"/> + <element name="viewLink" type="text" selector="//td/div[contains(.,'{{orderID}}')]/../..//a[@class='action-menu-item']" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml index 74ee28de2d3f..97995b7f7ca0 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml @@ -241,4 +241,33 @@ <data key="apply">Percent of product price discount</data> <data key="discountAmount">50</data> </entity> + <entity name="SalesRuleSpecificCouponAndByPercent" type="SalesRule"> + <data key="name" unique="suffix">SalesRule</data> + <data key="description">Sales Rule Description</data> + <array key="website_ids"> + <item>1</item> + </array> + <array key="customer_group_ids"> + <item>0</item> + <item>1</item> + <item>2</item> + <item>3</item> + </array> + <data key="uses_per_customer">1</data> + <data key="is_active">true</data> + <data key="stop_rules_processing">false</data> + <data key="is_advanced">true</data> + <data key="sort_order">2</data> + <data key="simple_action">by_percent</data> + <data key="discount_amount">50</data> + <data key="discount_qty">1</data> + <data key="discount_step">0</data> + <data key="apply_to_shipping">false</data> + <data key="times_used">1</data> + <data key="is_rss">false</data> + <data key="coupon_type">SPECIFIC_COUPON</data> + <data key="use_auto_generation">false</data> + <data key="uses_per_coupon">2</data> + <data key="simple_free_shipping">1</data> + </entity> </entities> \ No newline at end of file diff --git a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml index bc9746c132d4..37687461d8db 100644 --- a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml +++ b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml @@ -35,6 +35,13 @@ <data key="value">90</data> </entity> + <entity name="MinimumOrderAmount100" type="minimum_order_amount"> + <requiredEntity type="free_shipping_subtotal">Price</requiredEntity> + </entity> + <entity name="Price" type="free_shipping_subtotal"> + <data key="value">100</data> + </entity> + <entity name="DefaultMinimumOrderAmount" type="minimum_order_amount"> <requiredEntity type="free_shipping_subtotal">DefaultPrice</requiredEntity> </entity> From 4c3a8b969859b845ea1bf02962b4bd2186a0faa4 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Sun, 21 Apr 2019 09:28:44 +0300 Subject: [PATCH 013/230] Adjusting the grid row selector --- .../Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml index 080f598480dc..cc6476547dc8 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml @@ -10,6 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminGridTableSection"> <element name="row" type="text" selector="table.data-grid tbody tr[data-role=row]:nth-of-type({{row}})" parameterized="true"/> - <element name="rowByValue" type="text" selector="//table[@class='data-grid']//tr[@data-role='row'] //td[contains(., '{{var}}')]" parameterized="true" timeout="30"/> + <element name="rowByValue" type="text" selector="//table[@class='data-grid']//tbody//tr[@data-role='row'] //td[contains(., '{{var}}')]" parameterized="true" timeout="30"/> </section> </sections> From dfd785f5f2934a4c79262d44c4ff5543ba577b51 Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Sun, 21 Apr 2019 09:56:06 +0300 Subject: [PATCH 014/230] Refactoring the delete action group --- ...eMainButtonWithConfirmationActionGroup.xml | 18 +++++++++++++++ .../Mftf/Section/AdminMainActionsSection.xml | 2 ++ .../AdminDeleteCustomVariableActionGroup.xml | 22 ------------------- 3 files changed, 20 insertions(+), 22 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickDeleteMainButtonWithConfirmationActionGroup.xml delete mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminDeleteCustomVariableActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickDeleteMainButtonWithConfirmationActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickDeleteMainButtonWithConfirmationActionGroup.xml new file mode 100644 index 000000000000..17c9c2dea365 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickDeleteMainButtonWithConfirmationActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickDeleteMainButtonWithConfirmationActionGroup"> + <waitForElementVisible selector="{{AdminMainActionsSection.delete}}" stepKey="waitForDeleteButton"/> + <click selector="{{AdminMainActionsSection.delete}}" stepKey="clickDeleteButton"/> + <waitForText userInput="Are you sure you want to do this?" stepKey="waitForText"/> + <click selector="{{AdminMainActionsSection.confirmDelete}}" stepKey="confirmDelete"/> + <waitForPageLoad stepKey="waitForPageLoad3"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminMainActionsSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminMainActionsSection.xml index 4867b5ba5ae0..291f61e17a50 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminMainActionsSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminMainActionsSection.xml @@ -13,5 +13,7 @@ <element name="saveAndContinue" type="button" selector="button[id*=save_and_continue]" timeout="30"/> <element name="delete" type="button" selector="#delete" timeout="30"/> <element name="add" type="button" selector="#add" timeout="30"/> + <element name="cancelDelete" type="button" selector=".modal-popup.confirm button.action-dismiss" timeout="10"/> + <element name="confirmDelete" type="button" selector=".modal-popup.confirm button.action-accept" timeout="10"/> </section> </sections> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminDeleteCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminDeleteCustomVariableActionGroup.xml deleted file mode 100644 index bbd17b2ed39e..000000000000 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminDeleteCustomVariableActionGroup.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminDeleteCustomVariableActionGroup"> - <amOnPage url="admin/admin/system_variable/" stepKey="goToVariableGrid"/> - <waitForPageLoad stepKey="waitForPageLoad1"/> - <click selector="{{CustomVariableSection.GridCustomVariableCode(customVariable.code)}}" stepKey="goToCustomVariableEditPage"/> - <waitForPageLoad stepKey="waitForPageLoad2"/> - <waitForElementVisible selector="{{CustomVariableSection.delete}}" stepKey="waitForDeleteBtn"/> - <click selector="{{CustomVariableSection.delete}}" stepKey="deleteCustomVariable"/> - <waitForText userInput="Are you sure you want to do this?" stepKey="waitForText"/> - <click selector="{{CustomVariableSection.confirmDelete}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - </actionGroup> -</actionGroups> From 49a22591d1793a06dc6fc9337f9b0da87187d18a Mon Sep 17 00:00:00 2001 From: Kavitha <kanair@adobe.com> Date: Mon, 22 Apr 2019 16:30:51 -0500 Subject: [PATCH 015/230] MC-4459: Convert OnePageCheckoutOfflinePaymentMethodsTest to MFTF --- .../Mftf/Data/CatalogInventryConfigData.xml | 4 ++-- ...orefrontCustomerSignInPopUpActionGroup.xml | 1 - ...gisterCustomerAfterCheckoutActionGroup.xml | 6 +++--- .../Mftf/Section/CheckoutPaymentSection.xml | 2 +- ...ingAddressAndProductWithTierPricesTest.xml | 19 ++++++++++--------- ...ssAndRegisterCustomerAfterCheckoutTest.xml | 7 +++---- ...OnLoginWhenGuestCheckoutIsDisabledTest.xml | 14 ++++++++------ ...egistrationAndDisableGuestCheckoutTest.xml | 12 ++++++------ ...ngesInBackendAfterCustomerCheckoutTest.xml | 8 ++++---- ...efrontUKCustomerCheckoutWithCouponTest.xml | 2 ++ ...CouponAndBankTransferPaymentMethodTest.xml | 6 +++--- 11 files changed, 42 insertions(+), 39 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml index c48631a8d03c..35dc1919c8e4 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventryConfigData.xml @@ -8,14 +8,14 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="EnableCatalogInventoryConfigData"> + <entity name="CatalogInventoryOptionsCanSubtractEnable"> <!--Default Value --> <data key="path">cataloginventory/options/can_subtract</data> <data key="scope_id">0</data> <data key="label">Yes</data> <data key="value">1</data> </entity> - <entity name="DisableCatalogInventoryConfigData"> + <entity name="CatalogInventoryOptionsCanSubtractDisable"> <data key="path">cataloginventory/options/can_subtract</data> <data key="scope_id">0</data> <data key="label">No</data> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCustomerSignInPopUpActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCustomerSignInPopUpActionGroup.xml index 627ca6237017..8139ac1f7929 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCustomerSignInPopUpActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCustomerSignInPopUpActionGroup.xml @@ -17,7 +17,6 @@ <fillField stepKey="fillEmail" userInput="{{customerEmail}}" selector="{{StorefrontCustomerSignInPopupFormSection.email}}"/> <fillField stepKey="fillPassword" userInput="{{customerPwd}}" selector="{{StorefrontCustomerSignInPopupFormSection.password}}"/> <click stepKey="clickSignInAccountButton" selector="{{StorefrontCustomerSignInPopupFormSection.signIn}}"/> - <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout"/> <waitForPageLoad stepKey="waitForPageToLoad"/> </actionGroup> </actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontRegisterCustomerAfterCheckoutActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontRegisterCustomerAfterCheckoutActionGroup.xml index b72c63668edf..7546e0475950 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontRegisterCustomerAfterCheckoutActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontRegisterCustomerAfterCheckoutActionGroup.xml @@ -10,11 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontRegisterCustomerAfterCheckoutActionGroup"> <arguments> - <argument name="customerPassword" defaultValue="UKCustomer"/> + <argument name="customerPassword" defaultValue="UKCustomer.password" type="string"/> </arguments> <click selector="{{CheckoutSuccessRegisterSection.createAccountButton}}" stepKey="clickOnCreateAnAccountButton"/> - <fillField selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" userInput="{{customerPassword.password}}" stepKey="fillPassword"/> - <fillField selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" userInput="{{customerPassword.password}}" stepKey="reconfirmPassword"/> + <fillField selector="{{StorefrontCustomerAccountInformationSection.newPassword}}" userInput="{{customerPassword}}" stepKey="fillPassword"/> + <fillField selector="{{StorefrontCustomerAccountInformationSection.confirmNewPassword}}" userInput="{{customerPassword}}" stepKey="reconfirmPassword"/> <click selector="{{StorefrontCustomerCreateFormSection.createAccountButton}}" stepKey="clickOnCreateAnAccount"/> <seeElement selector="{{StorefrontCustomerMessagesSection.successMessage}}" stepKey="seeSuccessMessage1"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml index 0dc88506027d..fc19eca9ec52 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml @@ -55,7 +55,7 @@ <element name="addressBook" type="button" selector="//a[text()='Address Book']"/> <element name="noQuotes" type="text" selector=".no-quotes-block"/> <element name="paymentMethodByName" type="text" selector="//*[@id='checkout-payment-method-load']//*[contains(@class, 'payment-group')]//label[normalize-space(.)='{{var1}}']" parameterized="true"/> - <element name="checkBankTransferPayment" type="radio" selector="//input[@id='banktransfer']"/> + <element name="bankTransfer" type="radio" selector="//input[@id='banktransfer']"/> <element name="billingAddressNotSameBankTransferCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-banktransfer"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml index f7365dd8522a..c5d1c34a93b3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndProductWithTierPricesTest.xml @@ -18,7 +18,8 @@ </annotations> <before> - <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> + <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">50.00</field> </createData> @@ -35,12 +36,16 @@ <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> + <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="enableGuestCheckout"/> + + <!-- Sign out Customer from storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> <argument name="customerEmail" value="UKCustomer.email"/> </actionGroup> <actionGroup ref="logout" stepKey="logout"/> - <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="enableGuestCheckout"/> </after> <!--Open Product page in StoreFront and assert product and price range --> @@ -68,8 +73,8 @@ </actionGroup> <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="waitForPlaceOrderButton"/> - <checkOption selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="selectBankTransfer"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.bankTransfer}}" stepKey="waitForPlaceOrderButton"/> + <checkOption selector="{{CheckoutPaymentSection.bankTransfer}}" stepKey="selectBankTransfer"/> <waitForElementVisible selector="{{CheckoutPaymentSection.billingAddressNotSameBankTransferCheckbox}}" stepKey="waitForElementToBeVisible"/> <uncheckOption selector="{{CheckoutPaymentSection.billingAddressNotSameBankTransferCheckbox}}" stepKey="uncheckSameBillingAndShippingAddress"/> <conditionalClick selector="{{CheckoutShippingSection.editActiveAddressButton}}" dependentSelector="{{CheckoutShippingSection.editActiveAddressButton}}" visible="true" stepKey="clickEditButton"/> @@ -95,7 +100,7 @@ <see selector="{{StorefrontCustomerAddressesSection.billingAddress}}" userInput="{{CustomerUKAddress.country}}" stepKey="seeCountryInBillingAddress"/> <see selector="{{StorefrontCustomerAddressesSection.billingAddress}}" userInput="T: {{CustomerUKAddress.telephone}}" stepKey="seeTelephoneInBillingAddress"/> - <!-- Assert Billing Address in Storefront --> + <!-- Assert Shipping Address in Storefront --> <see selector="{{StorefrontCustomerAddressesSection.shippingAddress}}" userInput="{{updateCustomerUKAddress.street[0]}}" stepKey="seeStreetNameInShippingAddress"/> <see selector="{{StorefrontCustomerAddressesSection.shippingAddress}}" userInput="{{updateCustomerUKAddress.city}}" stepKey="seeCityInShippingAddress"/> <see selector="{{StorefrontCustomerAddressesSection.shippingAddress}}" userInput="{{updateCustomerUKAddress.country}}" stepKey="seeCountryInShippingAddress"/> @@ -121,9 +126,5 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> - - <!-- Sign out Customer from storefront --> - <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> - <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> </test> </tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml index c52e8b73b262..34dc6617d25d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithDifferentShippingAndBillingAddressAndRegisterCustomerAfterCheckoutTest.xml @@ -24,6 +24,9 @@ </createData> </before> <after> + <!-- Sign out Customer from storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> <actionGroup ref="AdminDeleteCustomerActionGroup" stepKey="deleteCustomer"> <argument name="customerEmail" value="UKCustomer.email"/> @@ -94,9 +97,5 @@ <!-- Assert order buttons --> <actionGroup ref="AdminAssertOrderAvailableButtonsActionGroup" stepKey="assertOrderButtons"/> - - <!-- Sign out Customer from storefront --> - <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> - <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> </test> </tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml index 4d205e0d4049..b0b72515611e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutOnLoginWhenGuestCheckoutIsDisabledTest.xml @@ -27,10 +27,14 @@ <createData entity="Simple_US_Customer" stepKey="createCustomer"/> </before> <after> - <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> - <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <magentoCLI command="config:set {{EnableGuestCheckoutConfigData.path}} {{EnableGuestCheckoutConfigData.value}}" stepKey="enableGuestCheckout"/> <magentoCLI command="config:set {{EnableCustomerRedirectToDashboardConfigData.path}} {{EnableCustomerRedirectToDashboardConfigData.value}}" stepKey="enableCustomerRedirect"/> + + <!-- Sign out Customer from storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <actionGroup ref="logout" stepKey="logout"/> </after> @@ -56,6 +60,8 @@ <argument name="customerEmail" value="$$createCustomer.email$$"/> <argument name="customerPwd" value="$$createCustomer.password$$"/> </actionGroup> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout1"/> + <waitForPageLoad stepKey="waitForShippingMethodSectionToLoad"/> <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> @@ -84,9 +90,5 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> - - <!-- Sign out Customer from storefront --> - <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> - <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> </test> </tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml index b523a6e3b9e6..f7e54867b1ae 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutWithNewCustomerRegistrationAndDisableGuestCheckoutTest.xml @@ -27,10 +27,14 @@ <createData entity="Simple_US_Customer" stepKey="createCustomer"/> </before> <after> - <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> - <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <magentoCLI command="config:set {{EnableGuestCheckoutConfigData.path}} {{EnableGuestCheckoutConfigData.value}}" stepKey="enableGuestCheckout"/> <magentoCLI command="config:set {{EnableCustomerRedirectToDashboardConfigData.path}} {{EnableCustomerRedirectToDashboardConfigData.value}}" stepKey="enableCustomerRedirect"/> + + <!-- Sign out Customer from storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> + <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <actionGroup ref="logout" stepKey="logout"/> </after> @@ -124,9 +128,5 @@ <!-- Ship the order and assert the shipping status --> <actionGroup ref="AdminShipThePendingOrderActionGroup" stepKey="shipTheOrder"/> - - <!-- Sign out Customer from storefront --> - <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="openHomePage"/> - <actionGroup ref="StorefrontSignOutActionGroup" stepKey="customerLogout"/> </test> </tests> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml index e5f6c52e445c..b963fb9ae8f6 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductQuantityChangesInBackendAfterCustomerCheckoutTest.xml @@ -20,14 +20,14 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/> <magentoCLI command="config:set {{EnablePaymentBankTransferConfigData.path}} {{EnablePaymentBankTransferConfigData.value}}" stepKey="enableBankTransferPayment"/> - <magentoCLI command="config:set {{EnableCatalogInventoryConfigData.path}} {{EnableCatalogInventoryConfigData.value}}" stepKey="enableCatalogInventoryStock"/> + <magentoCLI command="config:set {{CatalogInventoryOptionsCanSubtractEnable.path}} {{CatalogInventoryOptionsCanSubtractEnable.value}}" stepKey="enableCatalogInventoryStock"/> <createData entity="defaultSimpleProduct" stepKey="simpleProduct"> <field key="price">10.00</field> </createData> </before> <after> - <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="enableGuestCheckout"/> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> <actionGroup ref="logout" stepKey="logout"/> </after> @@ -56,8 +56,8 @@ </actionGroup> <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="waitForPlaceOrderButton"/> - <click selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="selectBankTransfer"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.bankTransfer}}" stepKey="waitForPlaceOrderButton"/> + <click selector="{{CheckoutPaymentSection.bankTransfer}}" stepKey="selectBankTransfer"/> <!-- Place order and Assert success message --> <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml index 0e5d50df0fb3..ebf24e710fe3 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUKCustomerCheckoutWithCouponTest.xml @@ -83,6 +83,8 @@ <argument name="customerEmail" value="$$createCustomer.email$$"/> <argument name="customerPwd" value="$$createCustomer.password$$"/> </actionGroup> + <click selector="{{CheckoutCartSummarySection.proceedToCheckout}}" stepKey="goToCheckout1"/> + <waitForPageLoad stepKey="waitForShippingMethodSectionToLoad"/> <!-- Click and open order summary tab--> <conditionalClick selector="{{CheckoutOrderSummarySection.miniCartTab}}" dependentSelector="{{CheckoutOrderSummarySection.miniCartTabClosed}}" visible="true" stepKey="clickOnOrderSummaryTab"/> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml index 72b124ca0d00..6d5f79f3aadf 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontUSCustomerCheckoutWithCouponAndBankTransferPaymentMethodTest.xml @@ -29,9 +29,9 @@ </createData> </before> <after> + <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="disableBankTransferPayment"/> <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> - <magentoCLI command="config:set {{DisablePaymentBankTransferConfigData.path}} {{DisablePaymentBankTransferConfigData.value}}" stepKey="disableBankTransferPayment"/> <actionGroup ref="logout" stepKey="logout"/> </after> @@ -63,8 +63,8 @@ <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillGuestForm"/> <waitForElementVisible selector="{{CheckoutShippingMethodsSection.next}}" stepKey="waitForNextButton"/> <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickOnNextButton"/> - <waitForElementVisible selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="waitForPlaceOrderButton"/> - <checkOption selector="{{CheckoutPaymentSection.checkBankTransferPayment}}" stepKey="selectBankTransfer"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.bankTransfer}}" stepKey="waitForPlaceOrderButton"/> + <checkOption selector="{{CheckoutPaymentSection.bankTransfer}}" stepKey="selectBankTransfer"/> <!-- Place order and Assert success message --> <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> From 9665d6b394efcbee98c0f1f8d435b6ae0964e65c Mon Sep 17 00:00:00 2001 From: Leandry <leandry@atwix.com> Date: Wed, 24 Apr 2019 19:43:51 +0300 Subject: [PATCH 016/230] Refactoring --- ...sertAdminLoginErrorMessageActionGroup.xml} | 5 ++-- ...ml => AssertMessageOnAdminActionGroup.xml} | 2 +- .../Mftf/Section/AdminLoginFormSection.xml | 1 - ...ml => AdminSaveIntegrationActionGroup.xml} | 2 +- ...dminUserWhenCreatingNewIntegrationTest.xml | 26 +++++++++---------- 5 files changed, 18 insertions(+), 18 deletions(-) rename app/code/Magento/Backend/Test/Mftf/ActionGroup/{AssertAdminNotSuccessLoginActionGroup.xml => AssertAdminLoginErrorMessageActionGroup.xml} (72%) rename app/code/Magento/Backend/Test/Mftf/ActionGroup/{AssertMessageOnBackendActionGroup.xml => AssertMessageOnAdminActionGroup.xml} (92%) rename app/code/Magento/Integration/Test/Mftf/ActionGroup/{AssertSaveIntegrationActionGroup.xml => AdminSaveIntegrationActionGroup.xml} (89%) diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminNotSuccessLoginActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminLoginErrorMessageActionGroup.xml similarity index 72% rename from app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminNotSuccessLoginActionGroup.xml rename to app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminLoginErrorMessageActionGroup.xml index f932924edbd7..6ad3b7cfb912 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminNotSuccessLoginActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminLoginErrorMessageActionGroup.xml @@ -8,12 +8,13 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertAdminNotSuccessLoginActionGroup"> + <actionGroup name="AssertAdminLoginErrorMessageActionGroup"> <arguments> <argument name="message" type="string" defaultValue="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later"/> + <argument name="messageType" type="string" defaultValue="error" /> </arguments> <waitForPageLoad stepKey="waitForPageReload"/> - <see selector="{{AdminLoginFormSection.error}}" userInput="{{message}}" + <see selector="{{AdminLoginMessagesSection.messageByType(messageType)}}" userInput="{{message}}" stepKey="seeLoginAdminError"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnBackendActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnAdminActionGroup.xml similarity index 92% rename from app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnBackendActionGroup.xml rename to app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnAdminActionGroup.xml index b75fcd47c61b..414a9b56b8b0 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnBackendActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnAdminActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertMessageOnBackendActionGroup"> + <actionGroup name="AssertMessageOnAdminActionGroup"> <arguments> <argument name="message" type="string" defaultValue="The password entered for the current user is invalid. Verify the password and try again." /> <argument name="messageType" type="string" defaultValue="error" /> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml index 58efb66747b1..3b10fac7bb9d 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml @@ -12,6 +12,5 @@ <element name="username" type="input" selector="#username"/> <element name="password" type="input" selector="#login"/> <element name="signIn" type="button" selector=".actions .action-primary" timeout="30"/> - <element name="error" type="text" selector=".message.message-error.error"/> </section> </sections> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertSaveIntegrationActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSaveIntegrationActionGroup.xml similarity index 89% rename from app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertSaveIntegrationActionGroup.xml rename to app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSaveIntegrationActionGroup.xml index 0c53f4455bef..5169fd947636 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AssertSaveIntegrationActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSaveIntegrationActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertSaveIntegrationActionGroup"> + <actionGroup name="AdminSaveIntegrationActionGroup"> <click selector="{{AdminNewIntegrationSection.save}}" stepKey="saveIntegration"/> <waitForPageLoad stepKey="waitForSaveResultLoad"/> </actionGroup> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml index 96ef122fd7a4..ce101c09dfee 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml @@ -33,44 +33,44 @@ <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldFirstAttempt"> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationFirstAttempt"/> - <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkFirstSaveIntegrationError"/> + <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationFirstAttempt"/> + <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkFirstSaveIntegrationError"/> <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldSecondAttempt"> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationSecondAttempt"/> - <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkSecondSaveIntegrationError"/> + <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationSecondAttempt"/> + <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkSecondSaveIntegrationError"/> <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldThirdAttempt"> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationThirdAttempt"/> - <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkThirdSaveIntegrationError"/> + <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationThirdAttempt"/> + <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkThirdSaveIntegrationError"/> <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldFourthAttempt"> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationFourthAttempt"/> - <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkFourthSaveIntegrationError"/> + <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationFourthAttempt"/> + <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkFourthSaveIntegrationError"/> <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldFifthAttempt"> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationFifthAttempt"/> - <actionGroup ref="AssertMessageOnBackendActionGroup" stepKey="checkFifthSaveIntegrationError"/> + <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationFifthAttempt"/> + <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkFifthSaveIntegrationError"/> <!-- Last invalid current password save integration attempt and check logout error --> <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldLastAttempt"> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AssertSaveIntegrationActionGroup" stepKey="saveIntegrationLastAttempt"/> - <actionGroup ref="AssertAdminNotSuccessLoginActionGroup" stepKey="checkFifthError"> + <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationLastAttempt"/> + <actionGroup ref="AssertAdminLoginErrorMessageActionGroup" stepKey="checkFifthError"> <argument name="message" value="Your account is temporarily disabled. Please try again later."/> </actionGroup> <!-- Try to login as admin and check error --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> - <actionGroup ref="AssertAdminNotSuccessLoginActionGroup" stepKey="checkLoginError"/> + <actionGroup ref="AssertAdminLoginErrorMessageActionGroup" stepKey="checkLoginError"/> </test> </tests> From 9cea3ca10a8456092236ebca430cec09d0ce47f1 Mon Sep 17 00:00:00 2001 From: Leandry <leandry@atwix.com> Date: Wed, 24 Apr 2019 19:51:37 +0300 Subject: [PATCH 017/230] Refactoring --- .../Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml | 2 +- .../Test/Mftf/Section/AdminNewIntegrationSection.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml b/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml index c4b0695a05bf..7b46029aa1ee 100644 --- a/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml +++ b/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml @@ -9,6 +9,6 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminNewIntegrationPage" url="admin/integration/new/" area="admin" module="Magento_Integration"> - <section name="AdminNewIntegrationSection"/> + <section name="AdminNewIntegrationSection"/> </page> </pages> diff --git a/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml b/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml index 7a193df73063..89588f777509 100644 --- a/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml +++ b/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml @@ -9,8 +9,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminNewIntegrationSection"> - <element name="integrationName" type="input" selector="#integration_properties_name"/> - <element name="currentPassword" type="input" selector="#integration_properties_current_password"/> + <element name="integrationName" type="input" selector="#edit_form input[name='name']"/> + <element name="currentPassword" type="input" selector="#edit_form input[name='current_password']"/> <element name="save" type="button" selector="#save-split-button-button"/> </section> </sections> From f1e5df1a7f6878b137e44777ad23f56d39058295 Mon Sep 17 00:00:00 2001 From: Kavitha <kanair@adobe.com> Date: Mon, 29 Apr 2019 13:28:54 -0500 Subject: [PATCH 018/230] MC-4459: Convert OnePageCheckoutOfflinePaymentMethodsTest to MFTF --- .../CheckoutFillEstimateShippingAndTaxActionGroup.xml | 4 ++-- .../FillGuestCheckoutShippingAddressFormActionGroup.xml | 6 +++--- .../Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml | 2 +- .../Checkout/Test/Mftf/Section/CheckoutShippingSection.xml | 2 +- .../Test/Mftf/Section/CheckoutSuccessMainSection.xml | 2 +- .../ActionGroup/StorefrontFillBillingAddressActionGroup.xml | 2 +- .../Mftf/Section/StorefrontCustomerAddressesSection.xml | 4 ++-- .../Mftf/Section/StorefrontCustomerSignInFormSection.xml | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutFillEstimateShippingAndTaxActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutFillEstimateShippingAndTaxActionGroup.xml index 985d9d3bee18..f564e14989e7 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutFillEstimateShippingAndTaxActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/CheckoutFillEstimateShippingAndTaxActionGroup.xml @@ -10,12 +10,12 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="CheckoutFillEstimateShippingAndTaxActionGroup"> <arguments> - <argument name="address" defaultValue="US_Address_TX"/> + <argument name="address" defaultValue="US_Address_TX" type="entity"/> </arguments> <conditionalClick selector="{{CheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{CheckoutCartSummarySection.estimateShippingAndTaxSummary}}" visible="false" stepKey="openShippingDetails"/> <selectOption selector="{{CheckoutCartSummarySection.country}}" userInput="{{address.country_id}}" stepKey="selectCountry"/> <selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="{{address.state}}" stepKey="selectState"/> - <waitForElementVisible selector="{{CheckoutCartSummarySection.postcode}}" stepKey="waitForPasswordFieldToBeVisisble"/> + <waitForElementVisible selector="{{CheckoutCartSummarySection.postcode}}" stepKey="waitForPostCodeVisible"/> <fillField selector="{{CheckoutCartSummarySection.postcode}}" userInput="{{address.postcode}}" stepKey="selectPostCode"/> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDiappear"/> </actionGroup> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml index 3203c8eef5ac..80fd604e752e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillGuestCheckoutShippingAddressFormActionGroup.xml @@ -10,8 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="FillGuestCheckoutShippingAddressFormActionGroup"> <arguments> - <argument name="customer" defaultValue="Simple_US_Customer"/> - <argument name="customerAddress" defaultValue="US_Address_TX"/> + <argument name="customer" defaultValue="Simple_US_Customer" type="entity"/> + <argument name="customerAddress" defaultValue="US_Address_TX" type="entity"/> </arguments> <fillField selector="{{CheckoutShippingSection.emailAddress}}" userInput="{{customer.email}}" stepKey="setCustomerEmail"/> <fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customer.firstname}}" stepKey="SetCustomerFirstName"/> @@ -22,6 +22,6 @@ <fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{customerAddress.telephone}}" stepKey="SetCustomerPhoneNumber"/> </actionGroup> <actionGroup name="FillGuestCheckoutShippingAddressWithCountryActionGroup" extends="FillGuestCheckoutShippingAddressFormActionGroup"> - <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddress.country_id}}" stepKey="selectCountry" after="SetCustomerCity"/> + <selectOption selector="{{CheckoutShippingSection.country}}" userInput="{{customerAddress.country_id}}" stepKey="selectCustomerCountry" after="SetCustomerCity"/> </actionGroup> </actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml index eed49065e375..ce3f3829fe45 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml @@ -54,7 +54,7 @@ <element name="addressBook" type="button" selector="//a[text()='Address Book']"/> <element name="noQuotes" type="text" selector=".no-quotes-block"/> <element name="paymentMethodByName" type="text" selector="//*[@id='checkout-payment-method-load']//*[contains(@class, 'payment-group')]//label[normalize-space(.)='{{var1}}']" parameterized="true"/> - <element name="bankTransfer" type="radio" selector="//input[@id='banktransfer']"/> + <element name="bankTransfer" type="radio" selector="#banktransfer"/> <element name="billingAddressNotSameBankTransferCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-banktransfer"/> <element name="billingAddressSelectShared" type="select" selector=".checkout-billing-address select[name='billing_address_id']"/> </section> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml index ba4f42d3dca2..1081506b9e59 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml @@ -38,7 +38,7 @@ <element name="editActiveAddress" type="button" selector="//div[@class='shipping-address-item selected-item']//span[text()='Edit']" timeout="30"/> <element name="password" type="input" selector="#customer-password"/> <element name="loginButton" type="button" selector="//button[@data-action='checkout-method-login']" timeout="30"/> - <element name="editActiveAddressButton" type="button" selector="//div[@class='payment-method _active']//button[@class='action action-edit-address']" timeout="30"/> + <element name="editActiveAddressButton" type="button" selector="//div[contains(@class,'payment-method _active')]//button[contains(@class,'action action-edit-address')]" timeout="30"/> <element name="emailAddress" type="input" selector="#checkout-customer-email"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml index 04eda22c3191..6414d65f7d1a 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessMainSection.xml @@ -18,6 +18,6 @@ <element name="continueShoppingButton" type="button" selector=".action.primary.continue" timeout="30"/> <element name="createAnAccount" type="button" selector="input[value='Create an Account']" timeout="30"/> <element name="printLink" type="button" selector=".print" timeout="30"/> - <element name="orderNumberWithoutLink" type="text" selector="//div[@class='checkout-success']/p/span"/> + <element name="orderNumberWithoutLink" type="text" selector="//div[contains(@class, 'checkout-success')]//p/span"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillBillingAddressActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillBillingAddressActionGroup.xml index 1521f8c6f1f7..accf8f40bb28 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillBillingAddressActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontFillBillingAddressActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontFillBillingAddressActionGroup"> <arguments> - <argument name="address" defaultValue="CustomerUKAddress"/> + <argument name="address" defaultValue="CustomerUKAddress" type="entity"/> </arguments> <fillField selector="{{CheckoutPaymentSection.guestFirstName}}" userInput="{{address.firstname}}" stepKey="enterFirstName"/> <fillField selector="{{CheckoutPaymentSection.guestLastName}}" userInput="{{address.lastname}}" stepKey="enterLastName"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml index 52430cfb0225..0c9475409e42 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAddressesSection.xml @@ -18,7 +18,7 @@ <element name="editAdditionalAddress" type="button" selector="//tbody//tr[{{var}}]//a[@class='action edit']" parameterized="true" timeout="30"/> <element name="addNewAddress" type="button" selector="//span[text()='Add New Address']"/> <element name="numberOfAddresses" type="text" selector=".toolbar-number"/> - <element name="shippingAddress" type="text" selector="//div[@class='box box-shipping-address']//div/address"/> - <element name="billingAddress" type="text" selector="//div[@class='box box-billing-address']//div/address"/> + <element name="shippingAddress" type="text" selector="//div[contains(@class,'box box-shipping-address')]//div/address"/> + <element name="billingAddress" type="text" selector="//div[contains(@class,'box box-billing-address')]//div/address"/> </section> </sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml index 99eb54627eb2..f68a28329167 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml @@ -19,6 +19,6 @@ <element name="email" type="input" selector="#customer-email"/> <element name="password" type="input" selector="#pass"/> <element name="signIn" type="button" selector="#send2" timeout="30"/> - <element name="createAnAccount" type="button" selector="//div[@class='actions-toolbar']//a[contains(.,'Create an Account')]" timeout="30"/> + <element name="createAnAccount" type="button" selector="//div[contains(@class,'actions-toolbar')]//a[contains(.,'Create an Account')]" timeout="30"/> </section> </sections> From 13566b0d109f3a3fe1aa75ab6b9fba5b0df75757 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Thu, 2 May 2019 16:24:46 -0500 Subject: [PATCH 019/230] MC-4459: Convert OnePageCheckoutOfflinePaymentMethodsTest to MFTF - Remove duplicate element --- .../Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml index 893d31340978..11dba6500890 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml @@ -25,7 +25,6 @@ <element name="guestRegion" type="select" selector=".billing-address-form select[name*='region_id']"/> <element name="guestPostcode" type="input" selector=".billing-address-form input[name*='postcode']"/> <element name="guestTelephone" type="input" selector=".billing-address-form input[name*='telephone']"/> - <element name="guestCountry" type="select" selector=".billing-address-form select[name*='country_id']"/> <element name="billingAddress" type="text" selector=".payment-method._active div.billing-address-details"/> <element name="cartItems" type="text" selector="ol.minicart-items"/> <element name="cartItemsArea" type="button" selector="div.block.items-in-cart"/> From e39642028fd7952b4412e899f74e37a127590d8a Mon Sep 17 00:00:00 2001 From: Patrick McLain <pat@pmclain.com> Date: Sat, 23 Feb 2019 20:24:25 -0500 Subject: [PATCH 020/230] Separate buy request creation into extensible builder This allows product type graphql modules a method for managing how inputs are mapped when buy requests are created. --- .../Model/Cart/AddSimpleProductToCart.php | 106 +++--------------- .../Cart/BuyRequest/BuyRequestBuilder.php | 42 +++++++ .../BuyRequestDataProviderInterface.php | 13 +++ .../CustomizableOptionsDataProvider.php | 62 ++++++++++ .../Cart/BuyRequest/DefaultDataProvider.php | 41 +++++++ .../Magento/QuoteGraphQl/etc/graphql/di.xml | 8 ++ 6 files changed, 183 insertions(+), 89 deletions(-) create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestBuilder.php create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestDataProviderInterface.php create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/CustomizableOptionsDataProvider.php create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/DefaultDataProvider.php diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php index b491b10730c1..1283423286f5 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php @@ -8,12 +8,12 @@ namespace Magento\QuoteGraphQl\Model\Cart; use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Framework\DataObject; -use Magento\Framework\DataObjectFactory; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; +use Magento\Framework\Stdlib\ArrayManager; use Magento\Quote\Model\Quote; +use Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestBuilder; /** * Add simple product to cart @@ -21,9 +21,9 @@ class AddSimpleProductToCart { /** - * @var DataObjectFactory + * @var ArrayManager */ - private $dataObjectFactory; + private $arrayManager; /** * @var ProductRepositoryInterface @@ -31,15 +31,23 @@ class AddSimpleProductToCart private $productRepository; /** - * @param DataObjectFactory $dataObjectFactory + * @var BuyRequestBuilder + */ + private $buyRequestBuilder; + + /** + * @param ArrayManager $arrayManager * @param ProductRepositoryInterface $productRepository + * @param BuyRequestBuilder $buyRequestBuilder */ public function __construct( - DataObjectFactory $dataObjectFactory, - ProductRepositoryInterface $productRepository + ArrayManager $arrayManager, + ProductRepositoryInterface $productRepository, + BuyRequestBuilder $buyRequestBuilder ) { - $this->dataObjectFactory = $dataObjectFactory; + $this->arrayManager = $arrayManager; $this->productRepository = $productRepository; + $this->buyRequestBuilder = $buyRequestBuilder; } /** @@ -55,8 +63,6 @@ public function __construct( public function execute(Quote $cart, array $cartItemData): void { $sku = $this->extractSku($cartItemData); - $quantity = $this->extractQuantity($cartItemData); - $customizableOptions = $this->extractCustomizableOptions($cartItemData); try { $product = $this->productRepository->get($sku); @@ -65,7 +71,7 @@ public function execute(Quote $cart, array $cartItemData): void } try { - $result = $cart->addProduct($product, $this->createBuyRequest($quantity, $customizableOptions)); + $result = $cart->addProduct($product, $this->buyRequestBuilder->build($cartItemData)); } catch (\Exception $e) { throw new GraphQlInputException( __( @@ -94,82 +100,4 @@ private function extractSku(array $cartItemData): string } return (string)$cartItemData['data']['sku']; } - - /** - * Extract quantity from cart item data - * - * @param array $cartItemData - * @return float - * @throws GraphQlInputException - */ - private function extractQuantity(array $cartItemData): float - { - if (!isset($cartItemData['data']['quantity'])) { - throw new GraphQlInputException(__('Missed "qty" in cart item data')); - } - $quantity = (float)$cartItemData['data']['quantity']; - - if ($quantity <= 0) { - throw new GraphQlInputException( - __('Please enter a number greater than 0 in this field.') - ); - } - return $quantity; - } - - /** - * Extract Customizable Options from cart item data - * - * @param array $cartItemData - * @return array - */ - private function extractCustomizableOptions(array $cartItemData): array - { - if (!isset($cartItemData['customizable_options']) || empty($cartItemData['customizable_options'])) { - return []; - } - - $customizableOptionsData = []; - foreach ($cartItemData['customizable_options'] as $customizableOption) { - if (isset($customizableOption['value_string'])) { - $customizableOptionsData[$customizableOption['id']] = $this->convertCustomOptionValue( - $customizableOption['value_string'] - ); - } - } - return $customizableOptionsData; - } - - /** - * Format GraphQl input data to a shape that buy request has - * - * @param float $quantity - * @param array $customOptions - * @return DataObject - */ - private function createBuyRequest(float $quantity, array $customOptions): DataObject - { - return $this->dataObjectFactory->create([ - 'data' => [ - 'qty' => $quantity, - 'options' => $customOptions, - ], - ]); - } - - /** - * Convert custom options vakue - * - * @param string $value - * @return string|array - */ - private function convertCustomOptionValue(string $value) - { - $value = trim($value); - if (substr($value, 0, 1) === "[" && - substr($value, strlen($value) - 1, 1) === "]") { - return explode(',', substr($value, 1, -1)); - } - return $value; - } } diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestBuilder.php b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestBuilder.php new file mode 100644 index 000000000000..492dd18f14e0 --- /dev/null +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestBuilder.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\QuoteGraphQl\Model\Cart\BuyRequest; + +use Magento\Framework\DataObject; +use Magento\Framework\DataObjectFactory; + +class BuyRequestBuilder +{ + /** + * @var BuyRequestDataProviderInterface[] + */ + private $providers; + + /** + * @var DataObjectFactory + */ + private $dataObjectFactory; + + public function __construct( + DataObjectFactory $dataObjectFactory, + array $providers = [] + ) { + $this->dataObjectFactory = $dataObjectFactory; + $this->providers = $providers; + } + + public function build(array $cartItemData): DataObject + { + $requestData = []; + foreach ($this->providers as $provider) { + $requestData = array_merge($requestData, $provider->execute($cartItemData)); + } + + return $this->dataObjectFactory->create(['data' => $requestData]); + } +} diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestDataProviderInterface.php b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestDataProviderInterface.php new file mode 100644 index 000000000000..adfc5b13b762 --- /dev/null +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestDataProviderInterface.php @@ -0,0 +1,13 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\QuoteGraphQl\Model\Cart\BuyRequest; + +interface BuyRequestDataProviderInterface +{ + public function execute(array $cartItemData): array; +} diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/CustomizableOptionsDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/CustomizableOptionsDataProvider.php new file mode 100644 index 000000000000..62f0e3662a7c --- /dev/null +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/CustomizableOptionsDataProvider.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\QuoteGraphQl\Model\Cart\BuyRequest; + +use Magento\Framework\Stdlib\ArrayManager; + +class CustomizableOptionsDataProvider implements BuyRequestDataProviderInterface +{ + /** + * @var ArrayManager + */ + private $arrayManager; + + /** + * @param ArrayManager $arrayManager + */ + public function __construct( + ArrayManager $arrayManager + ) { + $this->arrayManager = $arrayManager; + } + + /** + * @inheritdoc + */ + public function execute(array $cartItemData): array + { + $customizableOptions = $this->arrayManager->get('customizable_options', $cartItemData, []); + + $customizableOptionsData = []; + foreach ($customizableOptions as $customizableOption) { + if (isset($customizableOption['value_string'])) { + $customizableOptionsData[$customizableOption['id']] = $this->convertCustomOptionValue( + $customizableOption['value_string'] + ); + } + } + + return ['options' => $customizableOptionsData]; + } + + /** + * Convert custom options value + * + * @param string $value + * @return string|array + */ + private function convertCustomOptionValue(string $value) + { + $value = trim($value); + if (substr($value, 0, 1) === "[" && + substr($value, strlen($value) - 1, 1) === "]") { + return explode(',', substr($value, 1, -1)); + } + return $value; + } +} diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/DefaultDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/DefaultDataProvider.php new file mode 100644 index 000000000000..f15f89b35e93 --- /dev/null +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/DefaultDataProvider.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\QuoteGraphQl\Model\Cart\BuyRequest; + +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\Stdlib\ArrayManager; + +class DefaultDataProvider implements BuyRequestDataProviderInterface +{ + /** + * @var ArrayManager + */ + private $arrayManager; + + /** + * @param ArrayManager $arrayManager + */ + public function __construct( + ArrayManager $arrayManager + ) { + $this->arrayManager = $arrayManager; + } + + /** + * @inheritdoc + */ + public function execute(array $cartItemData): array + { + $qty = $this->arrayManager->get('data/quantity', $cartItemData); + if (!isset($qty)) { + throw new GraphQlInputException(__('Missing key "quantity" in cart item data')); + } + + return ['qty' => (float)$qty]; + } +} diff --git a/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml b/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml index c7389cf66784..cd1408f44518 100644 --- a/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml @@ -10,4 +10,12 @@ type="Magento\QuoteGraphQl\Model\Cart\SetShippingAddressesOnCart"/> <preference for="Magento\QuoteGraphQl\Model\Cart\SetShippingMethodsOnCartInterface" type="Magento\QuoteGraphQl\Model\Cart\SetShippingMethodsOnCart"/> + <type name="Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestBuilder"> + <arguments> + <argument name="providers" xsi:type="array"> + <item name="default" xsi:type="object">Magento\QuoteGraphQl\Model\Cart\BuyRequest\DefaultDataProvider</item> + <item name="customizable_options" xsi:type="object">Magento\QuoteGraphQl\Model\Cart\BuyRequest\CustomizableOptionsDataProvider</item> + </argument> + </arguments> + </type> </config> From b7dd416c443daf6160a3d1046da80b90b624d024 Mon Sep 17 00:00:00 2001 From: Patrick McLain <pat@pmclain.com> Date: Sun, 5 May 2019 16:31:00 -0400 Subject: [PATCH 021/230] Only return visible cart items --- app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php index f259dcd4a78f..2674b3728619 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php +++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartItems.php @@ -29,7 +29,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value $cart = $value['model']; $itemsData = []; - foreach ($cart->getAllItems() as $cartItem) { + foreach ($cart->getAllVisibleItems() as $cartItem) { /** * @var QuoteItem $cartItem */ From 2502c2f26b5ebb8ee748d3a630160bb7c95d7f0a Mon Sep 17 00:00:00 2001 From: Kavitha <kanair@adobe.com> Date: Mon, 6 May 2019 15:18:39 -0500 Subject: [PATCH 022/230] MC-4770: Convert CreateOrderFromEditCustomerPageTest to MFTF --- .../AdminEditCustomerOrdersSection.xml | 1 + .../AdminCreateOrderShoppingCartSection.xml | 15 ++ .../AdminCreateOrderWishListSection.xml | 16 ++ .../AdminOrderFormItemsOrderedSection.xml | 1 + .../CreateOrderFromEditCustomerPageTest.xml | 205 ++++++++++++++++++ .../CreateOrderFromEditCustomerPageTest.xml | 1 + 6 files changed, 239 insertions(+) create mode 100644 app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderShoppingCartSection.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderWishListSection.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerOrdersSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerOrdersSection.xml index 89fed43184b8..fb3d1570848e 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerOrdersSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerOrdersSection.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminEditCustomerOrdersSection"> <element name="orderGrid" type="text" selector="#customer_orders_grid_table"/> + <element name="orderIdInGrid" type="text" selector="//td[contains(., '{{orderId}}')]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderShoppingCartSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderShoppingCartSection.xml new file mode 100644 index 000000000000..76826f9571f3 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderShoppingCartSection.xml @@ -0,0 +1,15 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCreateOrderShoppingCartSection"> + <element name="shoppingCartBlock" type="text" selector="#sidebar_data_cart"/> + <element name="addToOrderCheckBox" type="checkbox" selector="//div[@id='order-sidebar_cart']//tr[td[.='{{productName}}']]//input[contains(@name,'sidebar[add_cart_item]')]" parameterized="true" timeout="30"/> + </section> +</sections> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderWishListSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderWishListSection.xml new file mode 100644 index 000000000000..86145a7221ad --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderWishListSection.xml @@ -0,0 +1,16 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminCreateOrderWishListSection"> + <element name="wishListBlock" type="text" selector="#sidebar_data_wishlist"/> + <element name="addProductToOrderCheckBox" type="checkbox" selector="//div[@id='order-sidebar_wishlist']//tr[td[.='{{productName}}']]//input[contains(@name,'sidebar[add_wishlist_item]')]" parameterized="true" timeout="30"/> + <element name="addConfigProductToOrder" type="text" selector="//div[@id='order-sidebar_wishlist']//tr[td[contains(.,'{{configProductName}}')]]//a[contains(@class, 'icon-configure')]" parameterized="true" timeout="30"/> + </section> +</sections> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml index beb566b20806..52f311cef721 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml @@ -16,5 +16,6 @@ <element name="addProductToOrder" type="input" selector="//*[@title='Add Products to Order']"/> <element name="itemsOrderedSummaryText" type="textarea" selector="//table[@class='data-table admin__table-primary order-tables']/tfoot/tr"/> <element name="configureSelectAttribute" type="select" selector="select[id*=attribute]"/> + <element name="moveProduct" type="select" selector="//td[contains(.,'{{productName}}')]/../..//td//select" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml new file mode 100644 index 000000000000..3b6246e87f64 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -0,0 +1,205 @@ +<?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="CreateOrderFromEditCustomerPageTest"> + <annotations> + <group value="Sales"/> + <stories value="Create Order"/> + <title value="Create order from edit customer page and add products to wish list and shopping cart"/> + <description value="Create an order from edit customer page and add products to the wish list and shopping cart "/> + <severity value="CRITICAL"/> + <testCaseId value="MC-16161"/> + <group value="mtf_migrated"/> + </annotations> + + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> + + <!--Create simple customer--> + <createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/> + + <!-- Create Simple Product --> + <createData entity="SimpleProduct2" stepKey="simpleProduct"> + <field key="price">10.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">20.00</field> + </createData> + + <!-- Create configurable product and add it to the category --> + <createData entity="ApiCategory" stepKey="createCategory"/> + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!-- Create an attribute with two options to be used in the first child product --> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + + <!-- Add the attribute we just created to default attribute set --> + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + + <!-- Get the option of the attribute we created --> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + + <!-- Create a simple product and give it the attribute with option --> + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <field key="price">30.00</field> + </createData> + + <!-- Create the configurable product --> + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + </createData> + + <!-- Add simple product to the configurable product --> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct1"/> + </createData> + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + </before> + <after> + <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> + <createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/> + <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigurableProduct"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!--Filter and Open the customer edit page --> + <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterTheCustomer"> + <argument name="email" value="$$simpleCustomer.email$$"/> + </actionGroup> + <click selector="{{AdminCustomerGridSection.customerEditLinkByEmail($$simpleCustomer.email$$)}}" stepKey="clickOnEditButton"/> + <waitForPageLoad stepKey="waitForCustomerEditPageToLoad"/> + <click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickOnCreateOrderButton"/> + <waitForPageLoad stepKey="waitForOrderPageToLoad"/> + + <!--Add configurable product to order--> + <actionGroup ref="addConfigurableProductToOrderFromAdmin" stepKey="addConfigurableProductToOrder"> + <argument name="product" value="$$createConfigProduct$$"/> + <argument name="attribute" value="$$createConfigProductAttribute$$"/> + <argument name="option" value="$$getConfigAttributeOption1$$"/> + </actionGroup> + + <!--Add Simple product to order--> + <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Add Second Simple product to order--> + <actionGroup ref="addSimpleProductToOrder" stepKey="addSecondSimpleProductToOrder"> + <argument name="product" value="$$simpleProduct1$$"/> + </actionGroup> + + <!-- Move Products to the WishList --> + <selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveProductToWishList"/> + <selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$createConfigProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveConfigurableProductToWishList"/> + <click selector="{{OrdersGridSection.update}}" stepKey="clickOnUpdateItemsAndQuantity"/> + + <!-- Assert products in Wish List section --> + <see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInWishList"/> + <see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProductInWishList"/> + + <!-- Add products to order from Wish List --> + <waitForElementVisible selector="{{AdminCreateOrderWishListSection.addProductToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="waitForCheckBoxToVisible"/> + <click selector="{{AdminCreateOrderWishListSection.addProductToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="selectProductToAddToOrder"/> + <click selector="{{AdminCreateOrderWishListSection.addConfigProductToOrder($$createConfigProduct.name$$)}}" stepKey="AddConfigurableProductToOrder"/> + <waitForElementVisible selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" stepKey="waitForConfigurablePopover"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="selectConfigurableOption"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/> + <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton"/> + + <!-- Assert Products in Order item section --> + <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInOrderItemGrid"/> + <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigProductInOrderItemGrid"/> + + <!-- Move Products to the Shopping Cart --> + <selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct.name$$)}}" userInput="Move to Shopping Cart" stepKey="moveFirstSimpleProductToShoppingCart"/> + <selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct1.name$$)}}" userInput="Move to Shopping Cart" stepKey="moveSecondSimpleProductToShoppingCart"/> + <click selector="{{OrdersGridSection.update}}" stepKey="clickOnUpdateItems"/> + + <!-- Assert products in Shopping cart section --> + <see selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeProductInShoppingCart"/> + <see selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct1.name$$" stepKey="seeSecondProductInShoppingCart"/> + + <!-- Move products to the order from shopping cart --> + <waitForElementVisible selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="waitForAddToOrderCheckBox"/> + <click selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="selectFirstProduct"/> + <click selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox($$simpleProduct1.name$$)}}" stepKey="selectSecondProduct"/> + <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton1"/> + + <!-- After move, assert products are not present in Shopping cart section --> + <dontSee selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct.name$$" stepKey="donSeeProductInShoppingCart"/> + <dontSee selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct1.name$$" stepKey="dontSeeSecondProductInShoppingCart"/> + + <!-- After move, assert products are present in Wish List section --> + <see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInWishList1"/> + <see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProductInWishList1"/> + + <!-- After move, assert products are present in order items section --> + <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInOrderItemGrid1"/> + <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigProductInOrderItemGrid1"/> + <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct1.name$$" stepKey="seeSecondProductInOrderItemGrid1"/> + + <!-- Select Free Shipping --> + <waitForElementVisible selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="waitForShippingSection"/> + <click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/> + <waitForPageLoad stepKey="waitForShippingMethods"/> + <click selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="chooseShippingMethod"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> + + <!-- Submit order --> + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> + + <!-- Verify order information --> + <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> + <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> + + <!-- Filter and Open the customer edit page --> + <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterTheCustomer1"> + <argument name="email" value="$$simpleCustomer.email$$"/> + </actionGroup> + <click selector="{{AdminCustomerGridSection.customerEditLinkByEmail($$simpleCustomer.email$$)}}" stepKey="clickOnEditButton1"/> + <waitForPageLoad stepKey="waitForCustomerEditPageToLoad1"/> + <click selector="{{AdminEditCustomerInformationSection.orders}}" stepKey="clickOnOrdersButton"/> + <waitForPageLoad stepKey="waitForOrderPageToOpen"/> + <click selector="{{AdminEditCustomerOrdersSection.orderIdInGrid('$orderId')}}" stepKey="selectOnOrderID"/> + + <!-- Assert ordered product in customer order section--> + <waitForPageLoad stepKey="waitForOrderInformationTolLoad"/> + <see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProductInGrid"/> + <see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$$simpleProduct.name$$" stepKey="seeFirstProductInGrid"/> + <see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$$simpleProduct1.name$$" stepKey="seeSecondProductInGrid"/> + <see selector="{{AdminOrderItemsOrderedSection.statusColumn}}" userInput="Ordered" stepKey="seeProductStatus"/> + <see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$30.00" stepKey="seeConfigurableProductSubtotal"/> + <see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$10.00" stepKey="seeFirstProductSubtotal"/> + <see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$20.00" stepKey="seeSecondProductSubtotal"/> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$60.00" stepKey="seeOrderGrandTotal"/> + </test> +</tests> \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderFromEditCustomerPageTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderFromEditCustomerPageTest.xml index e96bcc0abc1b..ca506adf39ed 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderFromEditCustomerPageTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/CreateOrderFromEditCustomerPageTest.xml @@ -21,6 +21,7 @@ <item name="grandTotal" xsi:type="string">19.00</item> </data> <data name="issue" xsi:type="string">MAGETWO-65165: Unable to add product to wish list using 'create order' interface</data> + <data name="tag" xsi:type="string">to_maintain:yes, mftf_migrated:yes</data> <constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" /> <constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" /> <constraint name="Magento\Sales\Test\Constraint\AssertProductInCustomerShoppingCartOnBackendGrid" /> From ce64de2cf7f0f7f3f0e3e1b963f7ee27b5bea6e0 Mon Sep 17 00:00:00 2001 From: Kavitha <kanair@adobe.com> Date: Wed, 8 May 2019 13:35:45 -0500 Subject: [PATCH 023/230] MC-4559: Convert DeleteCustomerCustomAttributesEntityTest to MFTF --- .../Test/Mftf/Section/AdminOrderDetailsInformationSection.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsInformationSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsInformationSection.xml index a531f423d134..a0e76e41a87b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsInformationSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsInformationSection.xml @@ -19,5 +19,6 @@ <element name="billingAddress" type="text" selector=".order-billing-address"/> <element name="shippingAddress" type="text" selector=".order-shipping-address"/> <element name="itemsOrdered" type="text" selector=".edit-order-table"/> + <element name="attributeLabel" type="text" selector="//label[contains(.,'{{attributeLabel}}')]" parameterized="true"/> </section> </sections> \ No newline at end of file From 84dc5811d78177c2e5ea6454dd00482cec64c9b1 Mon Sep 17 00:00:00 2001 From: Mila Lesechko <llesechk@adobe.com> Date: Wed, 8 May 2019 18:31:50 -0500 Subject: [PATCH 024/230] MC-4767: Convert PrintOrderFrontendGuestTest to MFTF --- .../Section/AdminProductFormBundleSection.xml | 3 +- .../AdminProductFormConfigurationsSection.xml | 1 + .../Test/Mftf/Data/ProductData.xml | 16 + ...dminAddToOrderBundleProductActionGroup.xml | 28 ++ ...dToOrderConfigurableProductActionGroup.xml | 28 ++ .../AdminAddToOrderCouponCodeActionGroup.xml | 19 ++ ...dToOrderDownloadableProductActionGroup.xml | 26 ++ ...nFilterProductInCreateOrderActionGroup.xml | 22 ++ .../AdminSubmitOrderActionGroup.xml | 1 + ...lesPrintOrderBillingAddressActionGroup.xml | 25 ++ ...ontFillOrdersAndReturnsFormActionGroup.xml | 21 ++ .../Test/Mftf/Page/AdminOrderCreatePage.xml | 1 + .../Mftf/Page/StorefrontPrintOrderPage.xml | 14 + .../AdminOrderFormConfigureProductSection.xml | 6 + .../Section/AdminOrderFormDiscountSection.xml | 15 + .../StorefrontGuestOrderViewSection.xml | 1 + .../Section/StorefrontOrderDetailsSection.xml | 20 ++ .../Test/StorefrontPrintOrderGuestTest.xml | 280 ++++++++++++++++++ .../Test/Mftf/Data/SalesRuleData.xml | 29 ++ .../TestCase/PrintOrderFrontendGuestTest.xml | 1 + 20 files changed, 556 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Page/StorefrontPrintOrderPage.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormDiscountSection.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml index 516f40ac2e7b..fe9f247c0a2e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml @@ -41,8 +41,9 @@ <element name="contentDropDownIfNotShowing" type="button" selector="//div[@data-index='content']//div[contains(@class, '_hide')]"/> <element name="longDescription" type="input" selector="#product_form_description"/> <element name="shortDescription" type="input" selector="#product_form_short_description"/> - <!--BundleOptinsDropDown--> + <!--BundleOptionsDropDown--> <element name="bundleOptionsDropDown" type="button" selector="div[data-index='bundle-items']" timeout="30"/> + <element name="currentBundleOption" type="text" selector="//div[@data-index='bundle-items']//div[@class='admin__collapsible-title']/span"/> <!--AddingAnOption--> <element name="addOptions" type="button" selector="//tr[@data-repeat-index='0']//td[4]" timeout="30"/> <!--SEODropdownTab--> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml index f6828a3b8631..8a54a73bfa29 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml @@ -44,6 +44,7 @@ <element name="productQuantity" type="input" selector=".admin__control-text[name='product[quantity_and_stock_status][qty]']"/> <element name="currentVariationsQuantityCells" type="button" selector="td[data-index='quantity_container']"/> <element name="rowByCode" type="textarea" selector="//span[contains(text(), '{{var1}}-{{var2}}')]//ancestor-or-self::tr" parameterized="true"/> + <element name="currentAttribute" type="text" selector="//fieldset[@class='admin__fieldset']/div[@class='admin__field _disabled']//span"/> </section> <section name="AdminConfigurableProductSelectAttributesSlideOut"> <element name="grid" type="button" selector=".admin__data-grid-wrap tbody"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Downloadable/Test/Mftf/Data/ProductData.xml index 59651383febf..3b0be227a194 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Data/ProductData.xml @@ -74,4 +74,20 @@ <requiredEntity type="custom_attribute_array">ApiProductShortDescription</requiredEntity> <requiredEntity type="downloadable_link">apiDownloadableLink</requiredEntity> </entity> + <entity name="DownloadableProductWithTwoLink1000" type="product"> + <data key="sku" unique="suffix">downloadableproduct</data> + <data key="type_id">downloadable</data> + <data key="attribute_set_id">4</data> + <data key="name" unique="suffix">DownloadableProduct</data> + <data key="price">50.99</data> + <data key="quantity">100</data> + <data key="weight">0</data> + <data key="status">1</data> + <data key="is_shareable">0</data> + <data key="urlKey" unique="suffix">downloadableproduct</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + <requiredEntity type="downloadable_link">downloadableLink1</requiredEntity> + <requiredEntity type="downloadable_link">downloadableLink2</requiredEntity> + </entity> </entities> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml new file mode 100644 index 000000000000..2791a5907153 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAddToOrderBundleProductActionGroup"> + <arguments> + <argument name="option" type="string"/> + <argument name="selectedProduct" type="entity"/> + <argument name="quantity" type="string"/> + </arguments> + <scrollTo selector="{{AdminOrderFormConfigureProductSection.bundleItems}}" stepKey="scroll"/> + <click selector="{{AdminOrderFormConfigureProductSection.bundleItems}}" stepKey="focusOnSideDialog"/> + <waitForAjaxLoad stepKey="waitForAjax"/> + <click selector="{{AdminOrderFormConfigureProductSection.bundleSelect(option)}}" stepKey="clickSelector"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.bundleSelect(option)}}" userInput="{{selectedProduct.name}}" stepKey="selectionOption"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + <fillField userInput="{{quantity}}" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml new file mode 100644 index 000000000000..33378a9fa58c --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAddToOrderConfigurableProductActionGroup"> + <arguments> + <argument name="attribute" type="string"/> + <argument name="option" type="string"/> + <argument name="quantity" type="string"/> + </arguments> + <scrollTo selector="{{AdminOrderFormConfigureProductSection.associatedProducts}}" stepKey="scroll"/> + <click selector="{{AdminOrderFormConfigureProductSection.associatedProducts}}" stepKey="focusOnSideDialog"/> + <waitForAjaxLoad stepKey="waitForAjax"/> + <click selector="{{AdminOrderFormConfigureProductSection.optionSelectNew(attribute)}}" stepKey="clickSelector"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelectNew(attribute)}}" userInput="{{option}}" stepKey="selectionOption"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + <fillField userInput="{{quantity}}" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml new file mode 100644 index 000000000000..457a63efe07d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAddToOrderCouponCodeActionGroup"> + <arguments> + <argument name="coupon" type="entity"/> + </arguments> + <fillField userInput="{{coupon.code}}" selector="{{AdminOrderFormDiscountSection.fieldCouponCode}}" stepKey="fillCouponCode"/> + <click selector="{{AdminOrderFormDiscountSection.applyCouponCode}}" stepKey="clickApply"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml new file mode 100644 index 000000000000..ec427fb9b677 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAddToOrderDownloadableProductActionGroup"> + <arguments> + <argument name="link" type="string"/> + <argument name="quantity" type="string" defaultValue="1"/> + </arguments> + <scrollTo selector="{{AdminOrderFormConfigureProductSection.downloadableInformation}}" stepKey="scroll"/> + <click selector="{{AdminOrderFormConfigureProductSection.downloadableInformation}}" stepKey="focusOnSideDialog"/> + <waitForAjaxLoad stepKey="waitForAjax"/> + <checkOption selector="{{AdminOrderFormConfigureProductSection.checkLinkDownloadableProduct(link)}}" stepKey="checkLink"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + <fillField userInput="{{quantity}}" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/> + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> + <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> + <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml new file mode 100644 index 000000000000..58d23f4b06bb --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFilterProductInCreateOrderActionGroup"> + <arguments> + <argument name="productSKU" type="string"/> + </arguments> + <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickAddProducts"/> + <fillField selector="{{AdminOrderFormItemsSection.skuFilter}}" userInput="{{productSKU}}" stepKey="fillSkuFilter"/> + <click selector="{{AdminOrderFormItemsSection.search}}" stepKey="clickSearchConfigurable"/> + <scrollTo selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" x="0" y="-100" stepKey="scrollToCheckColumn"/> + <checkOption selector="{{AdminOrderFormItemsSection.rowCheck('1')}}" stepKey="selectProduct"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoading"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSubmitOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSubmitOrderActionGroup.xml index 56e81da1e55a..f53e41386a38 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSubmitOrderActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSubmitOrderActionGroup.xml @@ -10,6 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminSubmitOrderActionGroup"> <click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/> + <waitForPageLoad stepKey="waitForPageLoad"/> <see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml new file mode 100644 index 000000000000..fe7e0064e5c5 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertSalesPrintOrderBillingAddress"> + <arguments> + <argument name="address" type="entity"/> + </arguments> + <see userInput="{{address.firstname}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeFirstname"/> + <see userInput="{{address.lastname}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeLastname"/> + <see userInput="{{address.company}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeCompany"/> + <see userInput="{{address.street[0]}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeStreet"/> + <see userInput="{{address.city}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeCity"/> + <see userInput="{{address.state}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeState"/> + <see userInput="{{address.postcode}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seePostcode"/> + <see userInput="{{address.country}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeCountry"/> + <see userInput="{{address.telephone}}" selector="{{StorefrontOrderDetailsSection.billingAddressBlock}}" stepKey="seeTelephone"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml new file mode 100644 index 000000000000..a3c0edf14812 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontFillOrdersAndReturnsFormActionGroup"> + <arguments> + <argument name="orderNumber" type="string"/> + <argument name="customer" type="entity" defaultValue="$$createCustomer$$"/> + </arguments> + <fillField selector="{{StorefrontGuestOrderSearchSection.orderId}}" userInput="{{orderNumber}}" stepKey="inputOrderId"/> + <fillField selector="{{StorefrontGuestOrderSearchSection.billingLastName}}" userInput="{{customer.lastname}}" stepKey="inputBillingLastName"/> + <selectOption selector="{{StorefrontGuestOrderSearchSection.findOrderBy}}" userInput="email" stepKey="selectFindOrderByEmail"/> + <fillField selector="{{StorefrontGuestOrderSearchSection.email}}" userInput="{{customer.email}}" stepKey="inputEmail"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/Page/AdminOrderCreatePage.xml b/app/code/Magento/Sales/Test/Mftf/Page/AdminOrderCreatePage.xml index c8ec12203c67..bc9486d61fbf 100644 --- a/app/code/Magento/Sales/Test/Mftf/Page/AdminOrderCreatePage.xml +++ b/app/code/Magento/Sales/Test/Mftf/Page/AdminOrderCreatePage.xml @@ -18,5 +18,6 @@ <section name="AdminOrderFormPaymentSection"/> <section name="AdminOrderFormTotalSection"/> <section name="AdminOrderFormStoreSelectorSection"/> + <section name="AdminOrderFormDiscountSection"/> </page> </pages> diff --git a/app/code/Magento/Sales/Test/Mftf/Page/StorefrontPrintOrderPage.xml b/app/code/Magento/Sales/Test/Mftf/Page/StorefrontPrintOrderPage.xml new file mode 100644 index 000000000000..66761fa4a1ca --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Page/StorefrontPrintOrderPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="StorefrontPrintOrderPage" url="sales/guest/print/order_id/{{order_id}}" module="Magento_Sales" area="storefront" parameterized="true"> + <section name="StorefrontOrderDetailsSection"/> + </page> +</pages> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml index cd72da744564..329a9a20ecaa 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml @@ -10,7 +10,13 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminOrderFormConfigureProductSection"> <element name="optionSelect" type="select" selector="//div[contains(@class,'product-options')]/div/div/select[../../label[text() = '{{option}}']]" parameterized="true"/> + <element name="optionSelectNew" type="select" selector="//label[text()='{{option1}}']/following-sibling::div/select" parameterized="true"/> <element name="quantity" type="input" selector="#product_composite_configure_input_qty"/> <element name="ok" type="button" selector=".modal-header .page-actions button[data-role='action']" timeout="30"/> + <element name="associatedProducts" type="block" selector="._show #catalog_product_composite_configure_fields_configurable"/> + <element name="bundleItems" type="block" selector="._show #catalog_product_composite_configure_fields_bundle"/> + <element name="bundleSelect" type="select" selector="//label/span[text()='{{bundleOption}}']/../following-sibling::div/select" parameterized="true"/> + <element name="downloadableInformation" type="block" selector="._show #catalog_product_composite_configure_fields_downloadable"/> + <element name="checkLinkDownloadableProduct" type="checkbox" selector="//label[contains(text(),'{{link}}')]/preceding-sibling::input" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormDiscountSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormDiscountSection.xml new file mode 100644 index 000000000000..e22e3430e920 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormDiscountSection.xml @@ -0,0 +1,15 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminOrderFormDiscountSection"> + <element name="fieldCouponCode" type="input" selector="//input[@name='coupon_code']"/> + <element name="applyCouponCode" type="button" selector="//input[@name='coupon_code']/following-sibling::button"/> + </section> +</sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontGuestOrderViewSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontGuestOrderViewSection.xml index 11080761b192..3085a591a119 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontGuestOrderViewSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontGuestOrderViewSection.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontGuestOrderViewSection"> <element name="orderInformationTab" type="text" selector="//*[@class='nav item current']/strong[contains(text(), 'Order Information')]"/> + <element name="printOrder" type="button" selector=".order-actions-toolbar .actions .print" timeout="10"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml new file mode 100644 index 000000000000..4eecebd26476 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml @@ -0,0 +1,20 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontOrderDetailsSection"> + <element name="orderDetailsBlock" type="block" selector=".block-order-details-view"/> + <element name="billingAddressBlock" type="block" selector=".box-order-billing-address > .box-content > address"/> + <element name="discountSalesRule" type="text" selector="tr.discount span.price"/> + <element name="grandTotalPrice" type="text" selector="tr.grand_total span.price"/> + <element name="paymentMethod" type="text" selector=".box-order-billing-method dt.title"/> + <element name="shippingMethod" type="text" selector=".box-order-shipping-method div.box-content"/> + <element name="productNameCell" type="text" selector="//*[@class='product name product-item-name']"/> + </section> +</sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml new file mode 100644 index 000000000000..cbe24778558b --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -0,0 +1,280 @@ +<?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="StorefrontPrintOrderGuestTest"> + <annotations> + <stories value="Print Order"/> + <title value="Print Order from Guest on Frontend"/> + <description value="Print Order from Guest on Frontend"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-16225"/> + <group value="sales"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> + <createData entity="ApiCategory" stepKey="createCategory"/> + + <!-- Create downloadable Product --> + <createData entity="DownloadableProductWithTwoLink1000" stepKey="downloadableProduct"> + <requiredEntity createDataKey="createCategory"/> + <field key="price">280</field> + </createData> + <createData entity="downloadableLink1" stepKey="addDownloadableLink1"> + <requiredEntity createDataKey="downloadableProduct"/> + </createData> + <createData entity="downloadableLink2" stepKey="addDownloadableLink2"> + <requiredEntity createDataKey="downloadableProduct"/> + </createData> + + <!-- Check Links can be purchased separately for Downloadable Product --> + <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToDownloadableProduct"> + <argument name="product" value="$$downloadableProduct$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForPageLoad"/> + <scrollTo selector="{{AdminProductDownloadableSection.sectionHeader}}" stepKey="scrollToDownloadableInformation"/> + <checkOption selector="{{AdminProductDownloadableSection.isLinksPurchasedSeparately}}" stepKey="checkOption"/> + <waitForAjaxLoad stepKey="waitForAjaxLoad"/> + <grabValueFrom selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="grabLink"/> + <click selector="{{AdminProductFormSection.save}}" stepKey="clickSave"/> + <waitForLoadingMaskToDisappear stepKey="waitForSave"/> + <waitForPageLoad stepKey="waitForPage"/> + + <!-- Create configurable Product --> + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> + <field key="price">40</field> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + </createData> + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> + <field key="price">40</field> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + </createData> + <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3"> + <field key="price">40</field> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption3"/> + </createData> + + <createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption1"/> + <requiredEntity createDataKey="getConfigAttributeOption2"/> + <requiredEntity createDataKey="getConfigAttributeOption3"/> + </createData> + + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct1"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct2"/> + </createData> + + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct3"/> + </createData> + + <!-- Grab attribute name for Configurable Product --> + <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToConfigurableProduct"> + <argument name="product" value="$$createConfigProduct$$"/> + </actionGroup> + <grabTextFrom selector="{{AdminConfigurableProductFormSection.currentAttribute}}" stepKey="grabAttribute"/> + <assertNotEmpty actual="$grabAttribute" stepKey="assertNotEmpty"/> + + <!-- Create bundle Product --> + <createData entity="SimpleSubCategory" stepKey="createSubCategory"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"> + <field key="price">100.00</field> + </createData> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"> + <field key="price">560.00</field> + </createData> + <createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct"> + <requiredEntity createDataKey="createSubCategory"/> + </createData> + <createData entity="DropDownBundleOption" stepKey="createBundleOption1_1"> + <requiredEntity createDataKey="createBundleProduct"/> + <field key="required">True</field> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="linkOptionToProduct2"> + <requiredEntity createDataKey="createBundleProduct"/> + <requiredEntity createDataKey="createBundleOption1_1"/> + <requiredEntity createDataKey="simpleProduct2"/> + </createData> + + <!-- Grab bundle option name for Bundle Product --> + <actionGroup ref="navigateToCreatedProductEditPage" stepKey="goToBundleProduct"> + <argument name="product" value="$$createBundleProduct$$"/> + </actionGroup> + <grabTextFrom selector="{{AdminProductFormBundleSection.currentBundleOption}}" stepKey="grabBundleOption"/> + <assertNotEmpty actual="$grabBundleOption" stepKey="assertBundleOptionNotEmpty"/> + + <!-- Create sales rule --> + <createData entity="ActiveSalesRuleCoupon50" stepKey="createCartPriceRule"/> + <createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule"> + <requiredEntity createDataKey="createCartPriceRule"/> + </createData> + + <!-- Create Customer Account --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + + <magentoCLI command="indexer:reindex" stepKey="reindex"/> + <magentoCLI command="cache:flush" stepKey="flushCache"/> + + <!-- Place order with options according to dataset --> + <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="newOrder"> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + + <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterConfigProduct"> + <argument name="productSKU" value="$$createConfigProduct.sku$$"/> + </actionGroup> + + <actionGroup ref="AdminAddToOrderConfigurableProductActionGroup" stepKey="addConfProduct"> + <argument name="attribute" value="{$grabAttribute}"/> + <argument name="option" value="$$getConfigAttributeOption1.label$$"/> + <argument name="quantity" value="3"/> + </actionGroup> + + <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterBundleProduct"> + <argument name="productSKU" value="$$createBundleProduct.sku$$"/> + </actionGroup> + <actionGroup ref="AdminAddToOrderBundleProductActionGroup" stepKey="addBundleProduct"> + <argument name="option" value="{$grabBundleOption}"/> + <argument name="selectedProduct" value="$$simpleProduct1$$"/> + <argument name="quantity" value="2"/> + </actionGroup> + + <actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterDownloadableProduct"> + <argument name="productSKU" value="$$downloadableProduct.sku$$"/> + </actionGroup> + <actionGroup ref="AdminAddToOrderDownloadableProductActionGroup" stepKey="addDownloadableProduct"> + <argument name="link" value="{$grabLink}"/> + <argument name="quantity" value="1"/> + </actionGroup> + + <!-- add Coupon --> + <actionGroup ref="AdminAddToOrderCouponCodeActionGroup" stepKey="addCoupon"> + <argument name="coupon" value="$$createCouponForCartPriceRule$$"/> + </actionGroup> + + <actionGroup ref="fillOrderCustomerInformation" stepKey="fillOrder"> + <argument name="customer" value="$$createCustomer$$"/> + <argument name="address" value="US_Address_TX"/> + </actionGroup> + + <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRate"/> + </before> + <after> + <deleteData createDataKey="downloadableProduct" stepKey="deleteProduct"/> + + <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> + <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> + <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + <deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/> + <deleteData createDataKey="createSubCategory" stepKey="deleteCategory1"/> + + <deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> + + <grabTextFrom selector="|Order # (\d+)|" stepKey="getOrderId"/> + <assertNotEmpty actual="$getOrderId" stepKey="assertOrderIdIsNotEmpty" /> + + <!-- Find the Order on frontend > Navigate to: Orders and Returns --> + <amOnPage url="{{StorefrontGuestOrderSearchPage.url}}" stepKey="amOnOrdersAndReturns"/> + <waitForPageLoad stepKey="waiForStorefrontPage"/> + + <!-- Fill the form with correspondent Order data --> + <actionGroup ref="StorefrontFillOrdersAndReturnsFormActionGroup" stepKey="fillOrder"> + <argument name="orderNumber" value="{$getOrderId}"/> + <argument name="customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Click on the "Continue" button --> + <click selector="{{StorefrontGuestOrderSearchSection.continue}}" stepKey="clickContinue"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + <waitForLoadingMaskToDisappear stepKey="waitForOrderPage"/> + + <!-- Click on the "Print Order" button --> + <click selector="{{StorefrontGuestOrderViewSection.printOrder}}" stepKey="printOrder"/> + <switchToWindow stepKey="switchToWindow"/> + <switchToNextTab stepKey="switchToTab"/> + <seeInCurrentUrl url="sales/guest/print/order_id/" stepKey="seePrintPage"/> + + <!-- AssertSalesPrintOrderProducts --> + <see userInput="$$createBundleProduct.name$$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeBundleProduct"/> + <see userInput="$$downloadableProduct.name$$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeDownloadableProduct"/> + <see userInput="$$createConfigProduct.name$$" selector="{{StorefrontOrderDetailsSection.productNameCell}}" stepKey="seeConfigurableProduct"/> + + <!-- AssertSalesPrintOrderBillingAddress --> + <scrollTo selector="{{StorefrontOrderDetailsSection.orderDetailsBlock}}" stepKey="scrollToFooter"/> + <actionGroup ref="AssertSalesPrintOrderBillingAddress" stepKey="assertSalesPrintOrderBillingAddress"> + <argument name="address" value="US_Address_TX"/> + </actionGroup> + + <!-- AssertSalesPrintOrderGrandTotal --> + <see userInput="$357.43" selector="{{StorefrontOrderDetailsSection.grandTotalPrice}}" stepKey="assertSalesPrintOrderGrandTotal"/> + + <!-- AssertSalesPrintOrderPaymentMethod --> + <see userInput="Check / Money order" selector="{{StorefrontOrderDetailsSection.paymentMethod}}" stepKey="assertSalesPrintOrderPaymentMethod"/> + + <!-- AssertSalesRuleOnPrintOrder --> + <see userInput="-$270.00" selector="{{StorefrontOrderDetailsSection.discountSalesRule}}" stepKey="assertSalesRuleOnPrintOrder"/> + + <!-- AssertShippingMethodOnPrintOrder --> + <see userInput="Flat Rate - Fixed" selector="{{StorefrontOrderDetailsSection.shippingMethod}}" stepKey="assertShippingMethodOnPrintOrder"/> + <switchToPreviousTab stepKey="switchToPreviousTab"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml index f022e4e645c3..931a6adc243a 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml @@ -399,5 +399,34 @@ <data key="apply">Percent of product price discount</data> <data key="discountAmount">50</data> </entity> + <entity name="ActiveSalesRuleCoupon50" type="SalesRule"> + <data key="name" unique="suffix">SimpleSalesRule</data> + <data key="description">Sales Rule Description</data> + <array key="website_ids"> + <item>1</item> + </array> + <array key="customer_group_ids"> + <item>0</item> + <item>1</item> + </array> + <data key="uses_per_customer">10</data> + <data key="is_active">true</data> + <data key="stop_rules_processing">true</data> + <data key="is_advanced">true</data> + <data key="sort_order">0</data> + <data key="simple_action">by_fixed</data> + <data key="discount_amount">50</data> + <data key="discount_qty">0</data> + <data key="discount_step">0</data> + <data key="apply_to_shipping">false</data> + <data key="times_used">0</data> + <data key="is_rss">false</data> + <data key="coupon_type">SPECIFIC_COUPON</data> + <data key="use_auto_generation">false</data> + <data key="uses_per_coupon">0</data> + <data key="simple_free_shipping">0</data> + <requiredEntity type="SalesRuleLabel">SalesRuleLabelDefault</requiredEntity> + <requiredEntity type="SalesRuleLabel">SalesRuleLabelStore1</requiredEntity> + </entity> </entities> diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.xml index dabacdb73c2b..da24a1b7075a 100644 --- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.xml +++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/PrintOrderFrontendGuestTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Sales\Test\TestCase\PrintOrderFrontendGuestTest" summary="Print Order from Guest on Frontend" ticketId="MAGETWO-30253"> <variation name="PrintOrderFrontendGuestTestVariation1"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="customer" xsi:type="array"> <item name="dataset" xsi:type="string">johndoe_with_addresses</item> </data> From ff4ca4070849823c58e045a3ee26773934121634 Mon Sep 17 00:00:00 2001 From: Mila Lesechko <llesechk@adobe.com> Date: Thu, 9 May 2019 10:54:10 -0500 Subject: [PATCH 025/230] MC-4332: Convert CreateWidgetOrderBySkuTest to MFTF --- .../Magento/Widget/Test/Mftf/Section/AdminWidgetsSection.xml | 1 + .../Widget/Test/Mftf/Section/StorefrontWidgetsSection.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminWidgetsSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminWidgetsSection.xml index f3282362d9aa..162f4e9c4106 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminWidgetsSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminWidgetsSection.xml @@ -12,5 +12,6 @@ <element name="widgetTitleSearch" type="input" selector="#widgetInstanceGrid_filter_title"/> <element name="searchButton" type="button" selector=".action-default.scalable.action-secondary"/> <element name="searchResult" type="text" selector="#widgetInstanceGrid_table>tbody>tr:nth-child(1)"/> + <element name="resetFilter" type="button" selector="button[data-action='grid-filter-reset']"/> </section> </sections> diff --git a/app/code/Magento/Widget/Test/Mftf/Section/StorefrontWidgetsSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/StorefrontWidgetsSection.xml index 0e2f6cec73a9..a42bd5b52d53 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/StorefrontWidgetsSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/StorefrontWidgetsSection.xml @@ -11,5 +11,7 @@ <section name="StorefrontWidgetsSection"> <element name="widgetProductsGrid" type="block" selector=".block.widget.block-products-list.grid"/> <element name="widgetProductName" type="text" selector=".product-item-name"/> + <element name="widgetBlock" type="block" selector=".widget"/> + <element name="widgetTitle" type="text" selector=".block-title"/> </section> </sections> From fa3d987909cf57773e780a782a9b2d8ec67d45cf Mon Sep 17 00:00:00 2001 From: Maria Kovdrysh <kovdrysh@adobe.com> Date: Fri, 10 May 2019 08:20:38 -0500 Subject: [PATCH 026/230] MC-4555: Convert UpdateCustomerCustomAttributesEntityTest to MFTF --- .../Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml index 8881a2a012ce..ba1f10a48074 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml @@ -30,5 +30,6 @@ <element name="yesNoAttribute" type="select" selector="//select[@id='{{var}}']" parameterized="true" /> <element name="yesNoOptionAttribute" type="select" selector="//select[@id='{{var}}']/option[2]" parameterized="true" /> <element name="selectedOption" type="text" selector="//select[@id='{{var}}']/option[@selected='selected']" parameterized="true"/> + <element name="attributeLabel" type="text" selector="//span[text()='{{attributeLabel}}']" parameterized="true"/> </section> </sections> From 98f1b6f594aec0a8566c6c2ae195b92b43dc2a14 Mon Sep 17 00:00:00 2001 From: Kavitha <kanair@adobe.com> Date: Fri, 10 May 2019 12:00:10 -0500 Subject: [PATCH 027/230] MC-4554: Convert CreateCustomerCustomAttributesEntityTest to MFTF --- .../Test/Mftf/Section/AdminCustomerAccountInformationSection.xml | 1 + .../Test/Mftf/Section/AdminOrderDetailsInformationSection.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml index 06d4fef36585..6d6a6dca2221 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml @@ -33,5 +33,6 @@ <element name="emailRequiredMessage" type="text" selector="//input[@name='customer[email]']/../label[contains(.,'This is a required field.')]"/> <element name="customAttribute" type="select" selector="//select[contains(@name, 'customer[{{attribute_code}}]')]" parameterized="true"/> <element name="disabledGroup" type="text" selector="//div[@class='admin__action-group-wrap admin__action-multiselect-wrap action-select-wrap _disabled']"/> + <element name="customerAttribute" type="input" selector="//input[contains(@name,'{{attributeCode}}')]" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsInformationSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsInformationSection.xml index 4d37479a8cd1..a74f26c9bbfe 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsInformationSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsInformationSection.xml @@ -19,6 +19,7 @@ <element name="billingAddress" type="text" selector=".order-billing-address"/> <element name="shippingAddress" type="text" selector=".order-shipping-address"/> <element name="itemsOrdered" type="text" selector=".edit-order-table"/> + <element name="attributeLabel" type="text" selector="//label[contains(.,'{{attributeLabel}}')]" parameterized="true"/> <element name="paymentInformation" type="text" selector="//div[@class='order-payment-method-title']"/> </section> </sections> \ No newline at end of file From 462bd56fd17644ad0522fe137112353537d8bc6d Mon Sep 17 00:00:00 2001 From: Maria Kovdrysh <kovdrysh@adobe.com> Date: Fri, 10 May 2019 13:42:39 -0500 Subject: [PATCH 028/230] MC-4331: Convert DeleteProductsFromCartOfAdvancedCheckoutEntityTest to MFTF --- .../Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml index 977f559f0071..a85920998b39 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml @@ -46,5 +46,8 @@ <element name="checkoutCartProductPrice" type="text" selector="//td[@class='col price']//span[@class='price']"/> <element name="checkoutCartSubtotal" type="text" selector="//td[@class='col subtotal']//span[@class='price']"/> <element name="emptyCart" selector=".cart-empty" type="text"/> + <!-- Required attention section --> + <element name="removeProductBySku" type="button" selector="//*[contains(text(), '{{sku}}')]/ancestor::tbody//button" parameterized="true" timeout="30"/> + <element name="failedItemBySku" type="block" selector="//*[@class='cart item' and .//tr[contains(@class,'info') and .//div[contains(.,'{{sku}}')]]]" parameterized="true" timeout="30"/> </section> </sections> From c727a3230a2aec9973dfc6a14054b01fcbf90d73 Mon Sep 17 00:00:00 2001 From: Leandry <leandry@atwix.com> Date: Mon, 13 May 2019 00:18:02 +0300 Subject: [PATCH 029/230] Refactoring --- .../Mftf/Section/AdminLoginFormSection.xml | 1 - ...l => AdminUserLockWhenEditingUserTest.xml} | 76 +++++++++++++------ .../AdminOpenUserEditPageActionGroup.xml | 24 ++++++ .../AdminUserEditAssignRoleActionGroup.xml | 19 +++++ ...UserEditFillRequiredFieldsActionGroup.xml} | 25 +----- .../AdminUserEditSaveUserActionGroup.xml | 17 +++++ .../LockAdminUserWhenEditingUserTest.xml | 3 +- 7 files changed, 117 insertions(+), 48 deletions(-) rename app/code/Magento/Security/Test/Mftf/Test/{LockAdminUserWhenEditingUserTest.xml => AdminUserLockWhenEditingUserTest.xml} (57%) create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditAssignRoleActionGroup.xml rename app/code/Magento/User/Test/Mftf/ActionGroup/{AdminEditUserActionGroup.xml => AdminUserEditFillRequiredFieldsActionGroup.xml} (55%) create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditSaveUserActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml index 2c458e7197ca..bd65dea89abc 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml @@ -12,7 +12,6 @@ <element name="username" type="input" selector="#username"/> <element name="password" type="input" selector="#login"/> <element name="signIn" type="button" selector=".actions .action-primary" timeout="30"/> - <element name="error" type="text" selector=".message.message-error.error"/> <element name="forgotPasswordLink" type="button" selector=".action-forgotpassword" timeout="10"/> </section> </sections> diff --git a/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenEditingUserTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml similarity index 57% rename from app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenEditingUserTest.xml rename to app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml index a7952cdb6e88..de1ed793c0bc 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/LockAdminUserWhenEditingUserTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="LockAdminUserWhenEditingUserTest"> + <test name="AdminUserLockWhenEditingUserTest"> <annotations> <features value="Security"/> <stories value="Runs Lock admin user when creating new user test."/> @@ -25,93 +25,125 @@ </before> <after> <!-- Unlock Admin user --> - <magentoCLI command="admin:user:unlock {{_ENV.MAGENTO_ADMIN_USERNAME}}" stepKey="unlockAdminUser"/> + <magentoCLI command="admin:user:unlock {{DefaultAdminUser.username}}" stepKey="unlockAdminUser"/> <!-- TODO Need to create delete operation for data entity="Admin3" <deleteData createDataKey="user" stepKey="removeAdminUser"/>--> </after> - <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserFirstAttempt"> + <actionGroup ref="AdminOpenUserEditPageActionGroup" stepKey="openEditUserPageFirstAttempt"> + <argument name="adminUser" value="$$user.username$$"/> + </actionGroup> + <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsFirstAttempt"> <argument name="adminUser" value="$$user.username$$"/> <argument name="adminFirstname" value="NEW$$user.firstname$$"/> <argument name="adminLastname" value="NEW$$user.lastname$$"/> <argument name="adminEmail" value="new$$user.email$$"/> <argument name="adminPassword" value="NEW$$user.password$$"/> <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + </actionGroup> + <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleFirstAttempt"> <argument name="adminUserRole" value="1"/> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + </actionGroup> + <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserFirstAttempt" /> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorFirstAttempt" > + <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> </actionGroup> - <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserSecondAttempt"> + <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsSecondAttempt"> <argument name="adminUser" value="$$user.username$$"/> <argument name="adminFirstname" value="NEW$$user.firstname$$"/> <argument name="adminLastname" value="NEW$$user.lastname$$"/> <argument name="adminEmail" value="new$$user.email$$"/> <argument name="adminPassword" value="NEW$$user.password$$"/> <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + </actionGroup> + <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleSecondAttempt"> <argument name="adminUserRole" value="1"/> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + </actionGroup> + <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserSecondAttempt" /> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorSecondAttempt" > + <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> </actionGroup> - <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserThirdAttempt"> + <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsThirdAttempt"> <argument name="adminUser" value="$$user.username$$"/> <argument name="adminFirstname" value="NEW$$user.firstname$$"/> <argument name="adminLastname" value="NEW$$user.lastname$$"/> <argument name="adminEmail" value="new$$user.email$$"/> <argument name="adminPassword" value="NEW$$user.password$$"/> <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + </actionGroup> + <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleThirdAttempt"> <argument name="adminUserRole" value="1"/> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + </actionGroup> + <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserThirdAttempt" /> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorThirdAttempt" > + <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> </actionGroup> - <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserFourthAttempt"> + <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsFourthAttempt"> <argument name="adminUser" value="$$user.username$$"/> <argument name="adminFirstname" value="NEW$$user.firstname$$"/> <argument name="adminLastname" value="NEW$$user.lastname$$"/> <argument name="adminEmail" value="new$$user.email$$"/> <argument name="adminPassword" value="NEW$$user.password$$"/> <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + </actionGroup> + <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleFourthAttempt"> <argument name="adminUserRole" value="1"/> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + </actionGroup> + <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserFourthAttempt" /> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorFourthAttempt" > + <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> </actionGroup> - <actionGroup ref="AdminEditUserActionGroup" stepKey="editUserFifthAttempt"> + <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsFifthAttempt"> <argument name="adminUser" value="$$user.username$$"/> <argument name="adminFirstname" value="NEW$$user.firstname$$"/> <argument name="adminLastname" value="NEW$$user.lastname$$"/> <argument name="adminEmail" value="new$$user.email$$"/> <argument name="adminPassword" value="NEW$$user.password$$"/> <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + </actionGroup> + <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleFifthAttempt"> <argument name="adminUserRole" value="1"/> - <argument name="messageSelector" value="{{AdminMessagesSection.error}}" /> + </actionGroup> + <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserFifthAttempt" /> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorFifthAttempt" > + <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> </actionGroup> - <actionGroup ref="AdminEditUserActionGroup" stepKey="openEditLastPage"> + <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsLastAttempt"> <argument name="adminUser" value="$$user.username$$"/> <argument name="adminFirstname" value="NEW$$user.firstname$$"/> <argument name="adminLastname" value="NEW$$user.lastname$$"/> <argument name="adminEmail" value="new$$user.email$$"/> <argument name="adminPassword" value="NEW$$user.password$$"/> <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> + <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + </actionGroup> + <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleLastAttempt"> <argument name="adminUserRole" value="1"/> - <argument name="messageSelector" value="{{AdminLoginFormSection.error}}" /> + </actionGroup> + <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserLastAttempt" /> + <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeErrorLastAttempt" > <argument name="message" value="Your account is temporarily disabled. Please try again later." /> - <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID"/> </actionGroup> <!-- Try to login as admin and check error --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> <waitForPageLoad stepKey="waitForError"/> - <see selector="{{AdminLoginFormSection.error}}" userInput="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later" - stepKey="seeLoginUserError"/> + <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeLoginErrorMessage" /> + </test> </tests> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml new file mode 100644 index 000000000000..facc37e498b6 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminOpenUserEditPageActionGroup"> + <arguments> + <argument name="adminUser" type="string" defaultValue="DefaultAdminUser.username"/> + </arguments> + + <amOnPage url="{{AdminUsersPage.url}}" stepKey="openAdminUsersPage"/> + <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{adminUser}}" stepKey="fillSearchUsernameFilter"/> + <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch" /> + <waitForPageLoad stepKey="waitForGridToLoad"/> + <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{adminUser}}" stepKey="seeUser" /> + <click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="openUserEdit"/> + <waitForPageLoad stepKey="waitForUserEditPageLoad"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditAssignRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditAssignRoleActionGroup.xml new file mode 100644 index 000000000000..8ed2b2c3b01d --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditAssignRoleActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminUserEditAssignRoleActionGroup"> + <arguments> + <argument name="adminUserRole" type="string"/> + </arguments> + <!-- Set admin User Role --> + <click selector="{{AdminEditUserSection.userRoleTab}}" stepKey="openUserRoleTab"/> + <click selector="{{AdminEditUserSection.administratorRoleRadio(adminUserRole)}}" stepKey="assignRole"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminEditUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditFillRequiredFieldsActionGroup.xml similarity index 55% rename from app/code/Magento/User/Test/Mftf/ActionGroup/AdminEditUserActionGroup.xml rename to app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditFillRequiredFieldsActionGroup.xml index 7af34fe65947..069769106842 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminEditUserActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditFillRequiredFieldsActionGroup.xml @@ -7,7 +7,7 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminEditUserActionGroup"> + <actionGroup name="AdminUserEditFillRequiredFieldsActionGroup"> <arguments> <argument name="adminUser" type="string" /> <argument name="adminFirstname" type="string" /> @@ -15,21 +15,9 @@ <argument name="adminEmail" type="string" /> <argument name="adminPassword" type="string" /> <argument name="adminPasswordConfirmation" type="string" /> - <argument name="currentAdminPassword" type="string" /> - <argument name="adminUserRole" type="string"/> - <argument name="message" type="string" defaultValue="You saved the user." /> - <argument name="messageSelector" type="string" defaultValue="{{AdminMessagesSection.success}}" /> + <argument name="currentAdminPassword" type="string" defaultValue="DefaultAdminUser.password" /> </arguments> - <!-- Navigate to edit user page --> - <amOnPage url="{{AdminUsersPage.url}}" stepKey="openAdminUsersPage"/> - <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{adminUser}}" stepKey="fillSearchUsernameFilter"/> - <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch" /> - <waitForPageLoad stepKey="waitForGridToLoad"/> - <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{adminUser}}" stepKey="seeUser" /> - <click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="openUserEdit"/> - <waitForPageLoad stepKey="waitForUserEditPageLoad"/> - <!-- Edit admin User data --> <fillField selector="{{AdminEditUserSection.usernameTextField}}" userInput="{{adminUser}}" stepKey="fillUser"/> <fillField selector="{{AdminEditUserSection.firstNameTextField}}" userInput="{{adminFirstname}}" stepKey="fillFirstName"/> @@ -40,14 +28,5 @@ <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{currentAdminPassword}}" stepKey="fillCurrentUserPassword"/> <scrollToTopOfPage stepKey="ScrollToTopOfPage"/> - <!-- Set admin User Role --> - <click selector="{{AdminEditUserSection.userRoleTab}}" stepKey="openUserRoleTab"/> - <click selector="{{AdminEditUserSection.administratorRoleRadio(adminUserRole)}}" stepKey="assignRole"/> - - <!-- Save User --> - <click selector="{{AdminEditUserSection.saveButton}}" stepKey="saveUser"/> - <waitForPageLoad stepKey="waitForSaveResultLoad"/> - <see userInput="{{message}}" selector="{{messageSelector}}" stepKey="verifyMessage" /> - </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditSaveUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditSaveUserActionGroup.xml new file mode 100644 index 000000000000..1c733e1abb40 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditSaveUserActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminUserEditSaveUserActionGroup"> + + <!-- Save User --> + <click selector="{{AdminEditUserSection.saveButton}}" stepKey="saveUser"/> + <waitForPageLoad stepKey="waitForSaveResultLoad"/> + + </actionGroup> +</actionGroups> diff --git a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.xml b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.xml index c5728da99a7a..595cdc8f7fce 100644 --- a/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.xml +++ b/dev/tests/functional/tests/app/Magento/Security/Test/TestCase/LockAdminUserWhenEditingUserTest.xml @@ -9,7 +9,7 @@ <testCase name="Magento\Security\Test\TestCase\LockAdminUserWhenEditingUserTest" summary="Lock admin user after entering incorrect password while editing existing user"> <variation name="LockAdminUserWhenEditingUseruserTestVariation1"> <data name="configData" xsi:type="string">user_lockout_failures</data> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2, mftf_migrated:yes</data> <data name="customAdmin/dataset" xsi:type="string">custom_admin_with_default_role</data> <data name="user/data/username" xsi:type="string">AdminUser%isolation%</data> <data name="user/data/firstname" xsi:type="string">FirstName%isolation%</data> @@ -19,7 +19,6 @@ <data name="user/data/password_confirmation" xsi:type="string">123123qq</data> <data name="user/data/current_password" xsi:type="string">incorrect password</data> <data name="attempts" xsi:type="string">4</data> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Security\Test\Constraint\AssertUserIsLocked" /> </variation> </testCase> From c02e4accef09ee6a99bd90018e189a797b42af6e Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Tue, 14 May 2019 20:05:16 +0300 Subject: [PATCH 030/230] Adding Delete Custom Variable Test --- .../Variable/Test/Mftf/Data/VariableData.xml | 3 ++ .../Test/Mftf/Metadata/variable-meta.xml | 21 ++++++++++ .../Test/DeleteCustomVariableEntityTest.xml | 41 +++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 app/code/Magento/Variable/Test/Mftf/Metadata/variable-meta.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/Test/DeleteCustomVariableEntityTest.xml diff --git a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml index 1160b7902661..923beaad96e6 100644 --- a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml +++ b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml @@ -17,4 +17,7 @@ <data key="html"> Sample Variable </data> <data key="plain">variable-plain-</data> </entity> + <entity name="customVariableV2" type="system_variable" extends="customVariable"> + <data key="code" unique="suffix">variable-code-</data> + </entity> </entities> diff --git a/app/code/Magento/Variable/Test/Mftf/Metadata/variable-meta.xml b/app/code/Magento/Variable/Test/Mftf/Metadata/variable-meta.xml new file mode 100644 index 000000000000..b2a37d20408a --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Metadata/variable-meta.xml @@ -0,0 +1,21 @@ +<?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="CreateCustomVariable" dataType="system_variable" type="create" auth="adminFormKey" + url="/admin/system_variable/save" method="POST" successRegex="/messages-message-success/"> + <contentType>application/x-www-form-urlencoded</contentType> + <object dataType="system_variable" key="variable"> + <field key="code">string</field> + <field key="name">string</field> + <field key="html">string</field> + <field key="plain">string</field> + </object> + </operation> +</operations> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/DeleteCustomVariableEntityTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/DeleteCustomVariableEntityTest.xml new file mode 100644 index 000000000000..9ad67d261d6b --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Test/DeleteCustomVariableEntityTest.xml @@ -0,0 +1,41 @@ +<?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="DeleteCustomVariableEntityTest"> + <annotations> + <features value="Variable"/> + <stories value="Delete Custom Variable."/> + <title value="Delete Custom Variable."/> + <description value="Test for deleting a custom variable."/> + <severity value="MAJOR"/> + <group value="variable"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <createData entity="customVariableV2" stepKey="createCustomVariable"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateToVariablesGridPageActionGroup" stepKey="goToVariablesGridAdminPage"/> + <actionGroup ref="AdminFilterGridActionGroup" stepKey="filterVariablesGridByNewVariableCode" > + <argument name="field" value="{{AdminVariablesFilterSection.codeFilter}}"/> + <argument name="value" value="$$customVariableV2.code$$"/> + </actionGroup> + <actionGroup ref="AdminNavigateToVariablePageActionGroup" stepKey="openCustomVariablePage"> + <argument name="code" value="$$customVariableV2.code$$"/> + </actionGroup> + <actionGroup ref="AdminClickDeleteMainButtonWithConfirmationActionGroup" stepKey="clickDeleteVariable"/> + <actionGroup ref="AssertMessageActionGroup" stepKey="seeSuccessMessage"> + <argument name="message" value="You deleted the custom variable."/> + </actionGroup> + </test> +</tests> From 224734c124df09bcb2f224ba8bfedb5e01f2327c Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Wed, 15 May 2019 19:00:41 +0300 Subject: [PATCH 031/230] Reverting the ActionGroup for keeping the Backward Compatibility --- .../CreateCustomVariableActionGroup.xml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml new file mode 100644 index 000000000000..610676b35045 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> + <!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + --> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> +<actionGroup name="CreateCustomVariableActionGroup"> + <amOnPage url="admin/admin/system_variable/new/" stepKey="goToNewCustomVarialePage" /> + <waitForPageLoad stepKey="waitForPageLoad" /> + <fillField selector="{{CustomVariableSection.variableCode}}" userInput="{{customVariable.code}}" stepKey="fillVariableCode" /> + <fillField selector="{{CustomVariableSection.variableName}}" userInput="{{customVariable.name}}" stepKey="fillVariableName" /> + <fillField selector="{{CustomVariableSection.variableHTML}}" userInput="{{customVariable.html}}" stepKey="fillVariableHtml" /> + <fillField selector="{{CustomVariableSection.variablePlain}}" userInput="{{customVariable.plain}}" stepKey="fillVariablePlain" /> + <click selector="{{CustomVariableSection.saveCustomVariable}}" stepKey="clickSaveVariable"/> +</actionGroup> +<actionGroup name="DeleteCustomVariableActionGroup"> + <amOnPage url="admin/admin/system_variable/" stepKey="goToVarialeGrid" /> + <waitForPageLoad stepKey="waitForPageLoad1" /> + <click selector="{{CustomVariableSection.GridCustomVariableCode(customVariable.code)}}" stepKey="goToCustomVariableEditPage" /> + <waitForPageLoad stepKey="waitForPageLoad2" /> + <waitForElementVisible selector="{{CustomVariableSection.delete}}" stepKey="waitForDeleteBtn" /> + <click selector="{{CustomVariableSection.delete}}" stepKey="deleteCustomVariable" /> + <waitForText userInput="Are you sure you want to do this?" stepKey="waitForText" /> + <click selector="{{CustomVariableSection.confirmDelete}}" stepKey="confirmDelete" /> + <waitForPageLoad stepKey="waitForPageLoad3" /> +</actionGroup> +</actionGroups> From d52d266136b793050e45b968f7e18c27b1c20d1c Mon Sep 17 00:00:00 2001 From: Ievgenii Gryshkun <i.gryshkun@gmail.com> Date: Thu, 16 May 2019 14:34:33 +0300 Subject: [PATCH 032/230] customizable_options.values contains everything but value(s) --- app/code/Magento/QuoteGraphQl/etc/schema.graphqls | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index 9e9c83b35820..dda8fe3bf337 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -314,7 +314,6 @@ type SelectedCustomizableOption { type SelectedCustomizableOptionValue { id: Int! label: String! - value: String price: CartItemSelectedOptionValuePrice! } From cfd065e923f5e7db5ed350a76e77128e485995b0 Mon Sep 17 00:00:00 2001 From: Patrick McLain <pat@pmclain.com> Date: Sat, 11 May 2019 12:46:37 -0300 Subject: [PATCH 033/230] Add Configurable Product to Cart Resolver Allows adding configurable products to cart in the same manner as the current Magento storefront. Fixes #438 --- .../BuyRequest/SuperAttributeDataProvider.php | 43 ++++++ .../AddConfigurableProductsToCart.php | 71 +++++++++ .../Resolver/ConfigurableCartItemOptions.php | 55 +++++++ .../etc/graphql/di.xml | 7 + .../etc/schema.graphqls | 11 +- ...aProvider.php => QuantityDataProvider.php} | 16 +- .../Magento/QuoteGraphQl/etc/graphql/di.xml | 2 +- .../AddConfigurableProductToCartTest.php | 144 ++++++++++++++---- 8 files changed, 309 insertions(+), 40 deletions(-) create mode 100644 app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php create mode 100644 app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/AddConfigurableProductsToCart.php create mode 100644 app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php rename app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/{DefaultDataProvider.php => QuantityDataProvider.php} (63%) diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php new file mode 100644 index 000000000000..12c192352eb6 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php @@ -0,0 +1,43 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Cart\BuyRequest; + +use Magento\Framework\Stdlib\ArrayManager; +use Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestDataProviderInterface; + +class SuperAttributeDataProvider implements BuyRequestDataProviderInterface +{ + /** + * @var ArrayManager + */ + private $arrayManager; + + /** + * @param ArrayManager $arrayManager + */ + public function __construct( + ArrayManager $arrayManager + ) { + $this->arrayManager = $arrayManager; + } + + /** + * @inheritdoc + */ + public function execute(array $cartItemData): array + { + $superAttributes = $this->arrayManager->get('configurable_attributes', $cartItemData, []); + + $superAttributesData = []; + foreach ($superAttributes as $superAttribute) { + $superAttributesData[$superAttribute['id']] = $superAttribute['value']; + } + + return ['super_attribute' => $superAttributesData]; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/AddConfigurableProductsToCart.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/AddConfigurableProductsToCart.php new file mode 100644 index 000000000000..ac7aff4f408f --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/AddConfigurableProductsToCart.php @@ -0,0 +1,71 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Resolver; + +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Exception\GraphQlInputException; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\QuoteGraphQl\Model\Cart\AddProductsToCart; +use Magento\QuoteGraphQl\Model\Cart\GetCartForUser; + +/** + * Add configurable products to cart GraphQl resolver + * {@inheritdoc} + */ +class AddConfigurableProductsToCart implements ResolverInterface +{ + /** + * @var GetCartForUser + */ + private $getCartForUser; + + /** + * @var AddProductsToCart + */ + private $addProductsToCart; + + /** + * @param GetCartForUser $getCartForUser + * @param AddProductsToCart $addProductsToCart + */ + public function __construct( + GetCartForUser $getCartForUser, + AddProductsToCart $addProductsToCart + ) { + $this->getCartForUser = $getCartForUser; + $this->addProductsToCart = $addProductsToCart; + } + + /** + * @inheritdoc + */ + public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) + { + if (!isset($args['input']['cart_id']) || empty($args['input']['cart_id'])) { + throw new GraphQlInputException(__('Required parameter "cart_id" is missing')); + } + $maskedCartId = $args['input']['cart_id']; + + if (!isset($args['input']['cart_items']) || empty($args['input']['cart_items']) + || !is_array($args['input']['cart_items']) + ) { + throw new GraphQlInputException(__('Required parameter "cart_items" is missing')); + } + $cartItems = $args['input']['cart_items']; + + $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId()); + $this->addProductsToCart->execute($cart, $cartItems); + + return [ + 'cart' => [ + 'model' => $cart, + ], + ]; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php new file mode 100644 index 000000000000..4dc17759ee08 --- /dev/null +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProductGraphQl\Model\Resolver; + +use Magento\Catalog\Helper\Product\Configuration; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\GraphQl\Config\Element\Field; +use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; +use Magento\Framework\GraphQl\Query\ResolverInterface; +use Magento\Quote\Model\Quote\Item; + +/** + * @inheritdoc + */ +class ConfigurableCartItemOptions implements ResolverInterface +{ + private $configurationHelper; + + public function __construct( + Configuration $configurationHelper + ) { + $this->configurationHelper = $configurationHelper; + } + + /** + * Fetch and format configurable variants. + * + * {@inheritdoc} + */ + public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) + { + if (!isset($value['model'])) { + throw new LocalizedException(__('"model" value should be specified')); + } + /** @var Item $cartItem */ + $cartItem = $value['model']; + + $result = []; + foreach ($this->configurationHelper->getOptions($cartItem) as $option) { + $result[] = [ + 'id' => $option['option_id'], + 'option_label' => $option['label'], + 'value_id' => $option['option_value'], + 'value_label' => $option['value'], + ]; + } + + return $result; + } +} diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml index f9d3c8b76979..1d72524a31b7 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml @@ -22,4 +22,11 @@ </argument> </arguments> </type> + <type name="Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestBuilder"> + <arguments> + <argument name="providers" xsi:type="array"> + <item name="super_attribute" xsi:type="object">Magento\ConfigurableProductGraphQl\Model\Cart\BuyRequest\SuperAttributeDataProvider</item> + </argument> + </arguments> + </type> </config> diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls index 45a4323e7f4b..a564085dd2f0 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls @@ -1,7 +1,7 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. type Mutation { - addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput): AddConfigurableProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") + addConfigurableProductsToCart(input: AddConfigurableProductsToCartInput): AddConfigurableProductsToCartOutput @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\AddConfigurableProductsToCart") } type ConfigurableProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "ConfigurableProduct defines basic features of a configurable product and its simple product variants") { @@ -50,13 +50,18 @@ type AddConfigurableProductsToCartOutput { input ConfigurableProductCartItemInput { data: CartItemInput! - variant_sku: String! + configurable_attributes: [ConfigurableCartItemAttributesInput]! customizable_options:[CustomizableOptionInput!] } +input ConfigurableCartItemAttributesInput { + id: Int! + value: Int! +} + type ConfigurableCartItem implements CartItemInterface { customizable_options: [SelectedCustomizableOption]! - configurable_options: [SelectedConfigurableOption!]! + configurable_options: [SelectedConfigurableOption!]! @resolver(class: "Magento\\ConfigurableProductGraphQl\\Model\\Resolver\\ConfigurableCartItemOptions") } type SelectedConfigurableOption { diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/DefaultDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/QuantityDataProvider.php similarity index 63% rename from app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/DefaultDataProvider.php rename to app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/QuantityDataProvider.php index f15f89b35e93..b93c2c8f511e 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/DefaultDataProvider.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/QuantityDataProvider.php @@ -10,7 +10,7 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\Stdlib\ArrayManager; -class DefaultDataProvider implements BuyRequestDataProviderInterface +class QuantityDataProvider implements BuyRequestDataProviderInterface { /** * @var ArrayManager @@ -31,11 +31,19 @@ public function __construct( */ public function execute(array $cartItemData): array { - $qty = $this->arrayManager->get('data/quantity', $cartItemData); - if (!isset($qty)) { + $quantity = $this->arrayManager->get('data/quantity', $cartItemData); + if (!isset($quantity)) { throw new GraphQlInputException(__('Missing key "quantity" in cart item data')); } - return ['qty' => (float)$qty]; + $quantity = (float) $quantity; + + if ($quantity <= 0) { + throw new GraphQlInputException( + __('Please enter a number greater than 0 in this field.') + ); + } + + return ['qty' => $quantity]; } } diff --git a/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml b/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml index cd1408f44518..88f97d32b71d 100644 --- a/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/QuoteGraphQl/etc/graphql/di.xml @@ -13,7 +13,7 @@ <type name="Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestBuilder"> <arguments> <argument name="providers" xsi:type="array"> - <item name="default" xsi:type="object">Magento\QuoteGraphQl\Model\Cart\BuyRequest\DefaultDataProvider</item> + <item name="quantity" xsi:type="object">Magento\QuoteGraphQl\Model\Cart\BuyRequest\QuantityDataProvider</item> <item name="customizable_options" xsi:type="object">Magento\QuoteGraphQl\Model\Cart\BuyRequest\CustomizableOptionsDataProvider</item> </argument> </arguments> diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php index a6f02e4239f2..9148539a8cf7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php @@ -31,77 +31,121 @@ protected function setUp() } /** - * @magentoApiDataFixture Magento/Catalog/_files/multiple_mixed_products.php + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php */ public function testAddConfigurableProductToCart() { - $variantSku = 'simple_41'; + $searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable')); + $product = current($searchResponse['products']['items']); + $quantity = 2; $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); + $sku = $product['sku']; + $attributeId = (int) $product['configurable_options'][0]['attribute_id']; + $optionId = $product['configurable_options'][0]['values'][1]['value_index']; + + $query = $this->getQuery( + $maskedQuoteId, + $sku, + $attributeId, + $optionId, + $quantity + ); - $query = $this->getQuery($maskedQuoteId, $variantSku, $quantity); $response = $this->graphQlMutation($query); - $cartItems = $response['addConfigurableProductsToCart']['cart']['items']; - self::assertEquals($quantity, $cartItems[0]['quantity']); - self::assertEquals($variantSku, $cartItems[0]['product']['sku']); + $cartItem = current($response['addConfigurableProductsToCart']['cart']['items']); + self::assertEquals($quantity, $cartItem['quantity']); + self::assertEquals($sku, $cartItem['product']['sku']); + self::assertArrayHasKey('configurable_options', $cartItem); + + $option = current($cartItem['configurable_options']); + self::assertEquals($attributeId, $option['id']); + self::assertEquals($optionId, $option['value_id']); + self::assertArrayHasKey('option_label', $option); + self::assertArrayHasKey('value_label', $option); } /** - * @magentoApiDataFixture Magento/Catalog/_files/multiple_mixed_products.php + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php * @expectedException \Exception - * @expectedExceptionMessage The requested qty is not available + * @expectedExceptionMessage You need to choose options for your item */ - public function testAddProductIfQuantityIsNotAvailable() + public function testAddProductWithInvalidOptions() { - $variantSku = 'simple_41'; - $quantity = 200; + $searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable')); + $product = current($searchResponse['products']['items']); + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); + $sku = $product['sku']; + $attributeId = (int) $product['configurable_options'][0]['attribute_id']; - $query = $this->getQuery($maskedQuoteId, $variantSku, $quantity); - $this->graphQlMutation($query); + $query = $this->getQuery( + $maskedQuoteId, + $sku, + $attributeId, + 9999, + 1 + ); + + $response = $this->graphQlMutation($query); } /** - * @magentoApiDataFixture Magento/Framework/Search/_files/product_configurable.php + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php * @expectedException \Exception - * @expectedExceptionMessage Product that you are trying to add is not available. + * @expectedExceptionMessage The requested qty is not available */ - public function testAddOutOfStockProduct() + public function testAddProductIfQuantityIsNotAvailable() { - $variantSku = 'simple_1010'; - $quantity = 1; + $searchResponse = $this->graphQlQuery($this->getFetchProductQuery('configurable')); + $product = current($searchResponse['products']['items']); + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); + $sku = $product['sku']; + $attributeId = (int) $product['configurable_options'][0]['attribute_id']; + $optionId = $product['configurable_options'][0]['values'][1]['value_index']; + + $query = $this->getQuery( + $maskedQuoteId, + $sku, + $attributeId, + $optionId, + 2000 + ); - $query = $this->getQuery($maskedQuoteId, $variantSku, $quantity); - $this->graphQlMutation($query); + $response = $this->graphQlMutation($query); } /** * @param string $maskedQuoteId - * @param string $variantSku + * @param string $sku + * @param int $optionId + * @param int $value * @param int $quantity * @return string */ - private function getQuery(string $maskedQuoteId, string $variantSku, int $quantity): string + private function getQuery(string $maskedQuoteId, string $sku, int $optionId, int $value, int $quantity): string { return <<<QUERY mutation { addConfigurableProductsToCart( - input: { - cart_id: "{$maskedQuoteId}" - cart_items: [ - { - variant_sku: "{$variantSku}" - data: { - quantity: {$quantity} - sku: "{$variantSku}" + input:{ + cart_id:"{$maskedQuoteId}" + cart_items:{ + configurable_attributes:[{ + id:{$optionId} + value:{$value} } + ] + data:{ + sku:"{$sku}" + quantity:{$quantity} } - ] + } } ) { cart { @@ -109,16 +153,52 @@ private function getQuery(string $maskedQuoteId, string $variantSku, int $quanti id quantity product { - name sku } ... on ConfigurableCartItem { configurable_options { + id option_label + value_id + value_label } } + } } } +} +QUERY; + } + + private function getFetchProductQuery(string $term): string + { + return <<<QUERY +{ + products( + search:"{$term}" + pageSize:1 + ) { + items { + sku + ... on ConfigurableProduct { + configurable_options { + attribute_id + attribute_code + id + label + position + product_id + use_default + values { + default_label + label + store_label + use_default_value + value_index + } + } + } + } } } QUERY; From ce2118d3458ab3abd3ee168e2e67b2897ef8150b Mon Sep 17 00:00:00 2001 From: Mila Lesechko <llesechk@adobe.com> Date: Fri, 17 May 2019 09:43:31 -0500 Subject: [PATCH 034/230] MC-4767: Convert PrintOrderFrontendGuestTest to MFTF --- .../Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml index cbe24778558b..804514ef4922 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -45,7 +45,6 @@ <grabValueFrom selector="{{AdminProductDownloadableSection.addLinkTitleInput('0')}}" stepKey="grabLink"/> <click selector="{{AdminProductFormSection.save}}" stepKey="clickSave"/> <waitForLoadingMaskToDisappear stepKey="waitForSave"/> - <waitForPageLoad stepKey="waitForPage"/> <!-- Create configurable Product --> <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> @@ -245,7 +244,6 @@ <!-- Click on the "Continue" button --> <click selector="{{StorefrontGuestOrderSearchSection.continue}}" stepKey="clickContinue"/> <waitForPageLoad stepKey="waitForPageLoad"/> - <waitForLoadingMaskToDisappear stepKey="waitForOrderPage"/> <!-- Click on the "Print Order" button --> <click selector="{{StorefrontGuestOrderViewSection.printOrder}}" stepKey="printOrder"/> From 5dcb21b1d7ac9179e2d426d7b2f3750159b0d1b5 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Fri, 17 May 2019 11:05:23 -0500 Subject: [PATCH 035/230] Test improvements: - added action group to delete user - removed duplicate action groups - introduced metadata for admin user deletion - added test case id - updated annotations - issue magento/magento-functional-tests-migration/377 - pull request magento/magento-functional-tests-migration/704 --- .../AdminLegacyDataGridFilterSection.xml | 17 +++ .../AdminLegacyDataGridTableSection.xml | 17 +++ .../Test/AdminUserLockWhenEditingUserTest.xml | 120 ++++++------------ .../AdminDeleteUserViaCurlActionGroup.xml | 30 +++++ .../AdminOpenUserEditPageActionGroup.xml | 13 +- .../AdminUserEditAssignRoleActionGroup.xml | 19 --- ...nUserEditFillRequiredFieldsActionGroup.xml | 32 ----- .../AdminUserEditSaveUserActionGroup.xml | 17 --- .../Magento/User/Test/Mftf/Data/UserData.xml | 41 ++++++ .../User/Test/Mftf/Metadata/user-meta.xml | 5 + .../User/Test/Mftf/Page/AdminEditUserPage.xml | 7 + .../User/Test/Mftf/Page/AdminUserEditPage.xml | 12 ++ .../User/Test/Mftf/Page/AdminUsersPage.xml | 3 +- 13 files changed, 176 insertions(+), 157 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/Section/AdminLegacyDataGridFilterSection.xml create mode 100644 app/code/Magento/Backend/Test/Mftf/Section/AdminLegacyDataGridTableSection.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserViaCurlActionGroup.xml delete mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditAssignRoleActionGroup.xml delete mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditFillRequiredFieldsActionGroup.xml delete mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditSaveUserActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/Page/AdminUserEditPage.xml diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminLegacyDataGridFilterSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminLegacyDataGridFilterSection.xml new file mode 100644 index 000000000000..0d5f3f3e53e5 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminLegacyDataGridFilterSection.xml @@ -0,0 +1,17 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminLegacyDataGridFilterSection"> + <element name="filterForm" type="block" selector="[data-role='filter-form']" /> + <element name="inputFieldByNameAttr" type="input" selector="[data-role='filter-form'] input[name='{{inputNameAttr}}']" parameterized="true" /> + <element name="apply" type="button" selector=".admin__data-grid-header [data-action='grid-filter-apply']" /> + <element name="clear" type="button" selector=".admin__data-grid-header [data-action='grid-filter-reset']" /> + </section> +</sections> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminLegacyDataGridTableSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminLegacyDataGridTableSection.xml new file mode 100644 index 000000000000..ad3600192886 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminLegacyDataGridTableSection.xml @@ -0,0 +1,17 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminLegacyDataGridTableSection"> + <element name="rowTemplateStrict" type="block" selector="//tbody/tr[td[text()[normalize-space()='{{text}}']]]" parameterized="true" /> + <element name="rowTemplate" type="block" selector="//tbody/tr[td[contains(.,normalize-space('{{text}}'))]]" parameterized="true" /> + <element name="columnTemplateStrict" type="block" selector="//tbody/tr[td[contains(.,normalize-space('{{text}}'))]]/td[@data-column='{{dataColumn}}']" parameterized="true" /> + <element name="columnTemplate" type="block" selector="//tbody/tr[td[contains(.,normalize-space('{{text}}'))]]/td[@data-column='{{dataColumn}}']" parameterized="true" /> + </section> +</sections> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml index de1ed793c0bc..2ce54d6c0fda 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminUserLockWhenEditingUserTest.xml @@ -11,139 +11,95 @@ <test name="AdminUserLockWhenEditingUserTest"> <annotations> <features value="Security"/> - <stories value="Runs Lock admin user when creating new user test."/> - <title value="Lock admin user when creating new user"/> - <description value="Runs Lock admin user when creating new user test."/> - <severity value="MAJOR"/> + <stories value="Runs Lock admin user when editing existing user test."/> + <title value="Lock admin user when creating new user."/> + <description value="Runs Lock admin user when editing existing user test."/> + <severity value="CRITICAL"/> + <testCaseId value="MC-14372" /> <group value="security"/> <group value="mtf_migrated"/> </annotations> <before> - <createData entity="Admin3" stepKey="user"/> + <!-- + @TODO: Remove "executeJS" in scope of MQE-1561 + Hack to be able to pass current admin user password without hardcoding it. + --> + <executeJS function="return '{{DefaultAdminUser.password}}'" stepKey="adminPassword" /> + <createData entity="NewAdminUser" stepKey="user"> + <field key="current_password">{$adminPassword}</field> + </createData> <!-- Log in to Admin Panel --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> <!-- Unlock Admin user --> <magentoCLI command="admin:user:unlock {{DefaultAdminUser.username}}" stepKey="unlockAdminUser"/> - <!-- TODO Need to create delete operation for data entity="Admin3" - <deleteData createDataKey="user" stepKey="removeAdminUser"/>--> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminDeleteUserViaCurlActionGroup" stepKey="deleteUser"> + <argument name="user" value="$$user$$" /> + </actionGroup> + <actionGroup ref="logout" stepKey="logout"/> </after> <actionGroup ref="AdminOpenUserEditPageActionGroup" stepKey="openEditUserPageFirstAttempt"> - <argument name="adminUser" value="$$user.username$$"/> - </actionGroup> - <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsFirstAttempt"> - <argument name="adminUser" value="$$user.username$$"/> - <argument name="adminFirstname" value="NEW$$user.firstname$$"/> - <argument name="adminLastname" value="NEW$$user.lastname$$"/> - <argument name="adminEmail" value="new$$user.email$$"/> - <argument name="adminPassword" value="NEW$$user.password$$"/> - <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> - <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + <argument name="user" value="$$user$$"/> </actionGroup> - <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleFirstAttempt"> - <argument name="adminUserRole" value="1"/> + + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillEditUserFieldsFirstAttempt"> + <argument name="user" value="EditAdminUserWrongCurrentPassword" /> </actionGroup> - <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserFirstAttempt" /> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="clickSaveFirstAttempt" /> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorFirstAttempt" > <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> </actionGroup> - <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsSecondAttempt"> - <argument name="adminUser" value="$$user.username$$"/> - <argument name="adminFirstname" value="NEW$$user.firstname$$"/> - <argument name="adminLastname" value="NEW$$user.lastname$$"/> - <argument name="adminEmail" value="new$$user.email$$"/> - <argument name="adminPassword" value="NEW$$user.password$$"/> - <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> - <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillEditUserFieldsSecondAttempt"> + <argument name="user" value="EditAdminUserWrongCurrentPassword" /> </actionGroup> - <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleSecondAttempt"> - <argument name="adminUserRole" value="1"/> - </actionGroup> - <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserSecondAttempt" /> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="clickSaveSecondAttempt" /> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorSecondAttempt" > <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> </actionGroup> - <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsThirdAttempt"> - <argument name="adminUser" value="$$user.username$$"/> - <argument name="adminFirstname" value="NEW$$user.firstname$$"/> - <argument name="adminLastname" value="NEW$$user.lastname$$"/> - <argument name="adminEmail" value="new$$user.email$$"/> - <argument name="adminPassword" value="NEW$$user.password$$"/> - <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> - <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> - </actionGroup> - <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleThirdAttempt"> - <argument name="adminUserRole" value="1"/> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillEditUserFieldsThirdAttempt"> + <argument name="user" value="EditAdminUserWrongCurrentPassword" /> </actionGroup> - <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserThirdAttempt" /> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="clickSaveThirdAttempt" /> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorThirdAttempt" > <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> </actionGroup> - <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsFourthAttempt"> - <argument name="adminUser" value="$$user.username$$"/> - <argument name="adminFirstname" value="NEW$$user.firstname$$"/> - <argument name="adminLastname" value="NEW$$user.lastname$$"/> - <argument name="adminEmail" value="new$$user.email$$"/> - <argument name="adminPassword" value="NEW$$user.password$$"/> - <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> - <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillEditUserFieldsFourthAttempt"> + <argument name="user" value="EditAdminUserWrongCurrentPassword" /> </actionGroup> - <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleFourthAttempt"> - <argument name="adminUserRole" value="1"/> - </actionGroup> - <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserFourthAttempt" /> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="clickSaveFourthAttempt" /> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorFourthAttempt" > <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> </actionGroup> - <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsFifthAttempt"> - <argument name="adminUser" value="$$user.username$$"/> - <argument name="adminFirstname" value="NEW$$user.firstname$$"/> - <argument name="adminLastname" value="NEW$$user.lastname$$"/> - <argument name="adminEmail" value="new$$user.email$$"/> - <argument name="adminPassword" value="NEW$$user.password$$"/> - <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> - <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> - </actionGroup> - <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleFifthAttempt"> - <argument name="adminUserRole" value="1"/> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillEditUserFieldsFifthAttempt"> + <argument name="user" value="EditAdminUserWrongCurrentPassword" /> </actionGroup> - <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserFifthAttempt" /> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="clickSaveFifthAttempt" /> <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeErrorFifthAttempt" > <argument name="messageType" value="error" /> <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> </actionGroup> - <actionGroup ref="AdminUserEditFillRequiredFieldsActionGroup" stepKey="fillEditUserFieldsLastAttempt"> - <argument name="adminUser" value="$$user.username$$"/> - <argument name="adminFirstname" value="NEW$$user.firstname$$"/> - <argument name="adminLastname" value="NEW$$user.lastname$$"/> - <argument name="adminEmail" value="new$$user.email$$"/> - <argument name="adminPassword" value="NEW$$user.password$$"/> - <argument name="adminPasswordConfirmation" value="NEW$$user.password_confirmation$$"/> - <argument name="currentAdminPassword" value="{{DefaultAdminUser.password}}INVALID"/> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillEditUserFieldsLastAttempt"> + <argument name="user" value="EditAdminUserWrongCurrentPassword" /> </actionGroup> - <actionGroup ref="AdminUserEditAssignRoleActionGroup" stepKey="assignRoleLastAttempt"> - <argument name="adminUserRole" value="1"/> - </actionGroup> - <actionGroup ref="AdminUserEditSaveUserActionGroup" stepKey="saveUserLastAttempt" /> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="clickSaveLastAttempt" /> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeErrorLastAttempt" > <argument name="message" value="Your account is temporarily disabled. Please try again later." /> </actionGroup> <!-- Try to login as admin and check error --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> - <waitForPageLoad stepKey="waitForError"/> <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="seeLoginErrorMessage" /> - </test> </tests> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserViaCurlActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserViaCurlActionGroup.xml new file mode 100644 index 000000000000..ec22cd6e404f --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserViaCurlActionGroup.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminDeleteUserViaCurlActionGroup"> + <arguments> + <argument name="user" type="entity" /> + </arguments> + <amOnPage stepKey="amOnAdminUsersPage" url="{{AdminUsersPage.url}}"/> + <waitForPageLoad stepKey="waitForAdminUserPageLoad"/> + <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="resetFilters" /> + <grabTextFrom selector="{{AdminLegacyDataGridTableSection.columnTemplateStrict(user.username, 'user_id')}}" stepKey="userId" /> + + <!-- + @TODO: Remove "executeJS" in scope of MQE-1561 + Hack to be able to pass current admin user password without hardcoding it. + --> + <executeJS function="return '{{DefaultAdminUser.password}}'" stepKey="adminPassword" /> + + <createData entity="deleteUser" stepKey="deleteUser"> + <field key="user_id">{$userId}</field> + <field key="current_password">{$adminPassword}</field> + </createData> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml index facc37e498b6..e8f8c23b7e4e 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml @@ -9,16 +9,17 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminOpenUserEditPageActionGroup"> <arguments> - <argument name="adminUser" type="string" defaultValue="DefaultAdminUser.username"/> + <argument name="user" type="entity" /> </arguments> <amOnPage url="{{AdminUsersPage.url}}" stepKey="openAdminUsersPage"/> - <fillField selector="{{AdminUserGridSection.usernameFilterTextField}}" userInput="{{adminUser}}" stepKey="fillSearchUsernameFilter"/> - <click selector="{{AdminUserGridSection.searchButton}}" stepKey="clickSearch" /> + <waitForPageLoad stepKey="waitForPageToLoad"/> + <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="resetFilters" /> + <fillField selector="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('username')}}" userInput="{{user.username}}" stepKey="fillSearchUsernameFilter"/> + <click selector="{{AdminLegacyDataGridFilterSection.apply}}" stepKey="clickSearch" /> <waitForPageLoad stepKey="waitForGridToLoad"/> - <see selector="{{AdminUserGridSection.usernameInFirstRow}}" userInput="{{adminUser}}" stepKey="seeUser" /> - <click selector="{{AdminUserGridSection.searchResultFirstRow}}" stepKey="openUserEdit"/> - <waitForPageLoad stepKey="waitForUserEditPageLoad"/> + <click selector="{{AdminLegacyDataGridTableSection.rowTemplateStrict(user.username)}}" stepKey="openUserEdit"/> + <waitForPageLoad stepKey="waitForUserEditPageLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditAssignRoleActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditAssignRoleActionGroup.xml deleted file mode 100644 index 8ed2b2c3b01d..000000000000 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditAssignRoleActionGroup.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminUserEditAssignRoleActionGroup"> - <arguments> - <argument name="adminUserRole" type="string"/> - </arguments> - <!-- Set admin User Role --> - <click selector="{{AdminEditUserSection.userRoleTab}}" stepKey="openUserRoleTab"/> - <click selector="{{AdminEditUserSection.administratorRoleRadio(adminUserRole)}}" stepKey="assignRole"/> - - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditFillRequiredFieldsActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditFillRequiredFieldsActionGroup.xml deleted file mode 100644 index 069769106842..000000000000 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditFillRequiredFieldsActionGroup.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminUserEditFillRequiredFieldsActionGroup"> - <arguments> - <argument name="adminUser" type="string" /> - <argument name="adminFirstname" type="string" /> - <argument name="adminLastname" type="string" /> - <argument name="adminEmail" type="string" /> - <argument name="adminPassword" type="string" /> - <argument name="adminPasswordConfirmation" type="string" /> - <argument name="currentAdminPassword" type="string" defaultValue="DefaultAdminUser.password" /> - </arguments> - - <!-- Edit admin User data --> - <fillField selector="{{AdminEditUserSection.usernameTextField}}" userInput="{{adminUser}}" stepKey="fillUser"/> - <fillField selector="{{AdminEditUserSection.firstNameTextField}}" userInput="{{adminFirstname}}" stepKey="fillFirstName"/> - <fillField selector="{{AdminEditUserSection.lastNameTextField}}" userInput="{{adminLastname}}" stepKey="fillLastName"/> - <fillField selector="{{AdminEditUserSection.emailTextField}}" userInput="{{adminEmail}}" stepKey="fillEmail"/> - <fillField selector="{{AdminEditUserSection.passwordTextField}}" userInput="{{adminPassword}}" stepKey="fillPassword"/> - <fillField selector="{{AdminEditUserSection.pwConfirmationTextField}}" userInput="{{adminPasswordConfirmation}}" stepKey="fillPasswordConfirmation"/> - <fillField selector="{{AdminEditUserSection.currentPasswordField}}" userInput="{{currentAdminPassword}}" stepKey="fillCurrentUserPassword"/> - <scrollToTopOfPage stepKey="ScrollToTopOfPage"/> - - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditSaveUserActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditSaveUserActionGroup.xml deleted file mode 100644 index 1c733e1abb40..000000000000 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUserEditSaveUserActionGroup.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. - */ ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminUserEditSaveUserActionGroup"> - - <!-- Save User --> - <click selector="{{AdminEditUserSection.saveButton}}" stepKey="saveUser"/> - <waitForPageLoad stepKey="waitForSaveResultLoad"/> - - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/User/Test/Mftf/Data/UserData.xml b/app/code/Magento/User/Test/Mftf/Data/UserData.xml index e665736ae28f..d465851c6237 100644 --- a/app/code/Magento/User/Test/Mftf/Data/UserData.xml +++ b/app/code/Magento/User/Test/Mftf/Data/UserData.xml @@ -33,6 +33,23 @@ <item>1</item> </array> </entity> + <entity name="EditAdminUser" type="user"> + <data key="username" unique="suffix">admin</data> + <data key="firstname">John</data> + <data key="lastname">Doe</data> + <data key="email" unique="prefix">admin@example.com</data> + <data key="password">123123QA</data> + <data key="password_confirmation">123123QA</data> + <data key="interface_local">en_US</data> + <data key="interface_local_label">English (United States)</data> + <data key="is_active">true</data> + <data key="is_active_label">Active</data> + <data key="current_password">{{_ENV.MAGENTO_ADMIN_PASSWORD}}</data> + <data key="role">Administrators</data> + <array key="roles"> + <item>1</item> + </array> + </entity> <entity name="NewAdminUserWrongCurrentPassword" type="user"> <data key="username" unique="suffix">admin</data> <data key="firstname">John</data> @@ -50,6 +67,23 @@ <item>1</item> </array> </entity> + <entity name="EditAdminUserWrongCurrentPassword" type="user"> + <data key="username" unique="suffix">admin</data> + <data key="firstname">John</data> + <data key="lastname">Doe</data> + <data key="email" unique="prefix">admin@example.com</data> + <data key="password">123123QA</data> + <data key="password_confirmation">123123QA</data> + <data key="interface_local">en_US</data> + <data key="interface_local_label">English (United States)</data> + <data key="is_active">true</data> + <data key="is_active_label">Active</data> + <data key="current_password" unique="suffix">password_</data> + <data key="role">Administrators</data> + <array key="roles"> + <item>1</item> + </array> + </entity> <entity name="admin" type="user"> <data key="email">admin@magento.com</data> <data key="password">admin123</data> @@ -74,4 +108,11 @@ <item>1</item> </array> </entity> + +<!-- + Since User delete action is performed via POST request we created this entity to be able to delete it. + Please use "AdminDeleteUserViaCurlActionGroup". + See how it works: app/code/Magento/User/Test/Mftf/ActionGroup/AdminDeleteUserViaCurlActionGroup.xml +--> + <entity name="deleteUser" type="deleteUser" /> </entities> diff --git a/app/code/Magento/User/Test/Mftf/Metadata/user-meta.xml b/app/code/Magento/User/Test/Mftf/Metadata/user-meta.xml index 1ee29be6b3d7..2aa080c4ead0 100644 --- a/app/code/Magento/User/Test/Mftf/Metadata/user-meta.xml +++ b/app/code/Magento/User/Test/Mftf/Metadata/user-meta.xml @@ -23,4 +23,9 @@ <value>string</value> </array> </operation> + <operation name="DeleteUser" dataType="deleteUser" type="create" auth="adminFormKey" url="/admin/user/delete/" method="POST" successRegex="/messages-message-success/"> + <contentType>application/x-www-form-urlencoded</contentType> + <field key="current_password">string</field> + <field key="user_id">string</field> + </operation> </operations> diff --git a/app/code/Magento/User/Test/Mftf/Page/AdminEditUserPage.xml b/app/code/Magento/User/Test/Mftf/Page/AdminEditUserPage.xml index ae965fa1c48e..c348a2ee79db 100644 --- a/app/code/Magento/User/Test/Mftf/Page/AdminEditUserPage.xml +++ b/app/code/Magento/User/Test/Mftf/Page/AdminEditUserPage.xml @@ -6,6 +6,13 @@ */ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + +<!-- + Please do no use current Page because it has link to new user page. + Use AdminUserEditPage it has parameterized url where you can specicy User Id. + We do not update this page to maintain backward compatibility. +--> + <page name="AdminEditUserPage" url="admin/user/new" area="admin" module="Magento_User"> <section name="AdminEditUserSection"/> <section name="AdminEditUserRoleSection"/> diff --git a/app/code/Magento/User/Test/Mftf/Page/AdminUserEditPage.xml b/app/code/Magento/User/Test/Mftf/Page/AdminUserEditPage.xml new file mode 100644 index 000000000000..2cdadd3694ec --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Page/AdminUserEditPage.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminUserEditPage" url="admin/user/edit/user_id/{{userId}}" area="admin" module="Magento_User" parameterized="true"> + <section name="AdminNewUserForm Section"/> + </page> +</pages> diff --git a/app/code/Magento/User/Test/Mftf/Page/AdminUsersPage.xml b/app/code/Magento/User/Test/Mftf/Page/AdminUsersPage.xml index ceb05ec7bd9c..bae22792bdd2 100644 --- a/app/code/Magento/User/Test/Mftf/Page/AdminUsersPage.xml +++ b/app/code/Magento/User/Test/Mftf/Page/AdminUsersPage.xml @@ -7,6 +7,7 @@ --> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminUsersPage" url="admin/user/" area="admin" module="Magento_User"> - <section name="AdminUserGridSection"/> + <section name="AdminLegacyDataGridFilterSection"/> + <section name="AdminLegacyDataGridTableSection"/> </page> </pages> From c9fad69fb5819eddb29a89e77758cc350866cf83 Mon Sep 17 00:00:00 2001 From: Ievgenii Gryshkun <i.gryshkun@gmail.com> Date: Mon, 20 May 2019 10:03:06 +0300 Subject: [PATCH 036/230] Product media_gallery_entries / types only present if image, thumbnail, small_image is requested --- .../Model/Resolver/Products/DataProvider/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php index 7f1fd7194225..3cd881da8fbc 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php @@ -74,7 +74,7 @@ public function getList( ): SearchResultsInterface { /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */ $collection = $this->collectionFactory->create(); - + $attributes = array_unique(array_merge($attributes, ['small_image', 'thumbnail', 'image'])); $this->collectionProcessor->process($collection, $searchCriteria, $attributes); if (!$isChildSearch) { From fb3289ade17e2c81f60629f5ae6a918dfb30135e Mon Sep 17 00:00:00 2001 From: Ievgenii Gryshkun <i.gryshkun@gmail.com> Date: Mon, 20 May 2019 10:08:24 +0300 Subject: [PATCH 037/230] Revert "Product media_gallery_entries / types only present if image, thumbnail, small_image is requested" This reverts commit c9fad69fb5819eddb29a89e77758cc350866cf83. --- .../Model/Resolver/Products/DataProvider/Product.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php index 3cd881da8fbc..7f1fd7194225 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Product.php @@ -74,7 +74,7 @@ public function getList( ): SearchResultsInterface { /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */ $collection = $this->collectionFactory->create(); - $attributes = array_unique(array_merge($attributes, ['small_image', 'thumbnail', 'image'])); + $this->collectionProcessor->process($collection, $searchCriteria, $attributes); if (!$isChildSearch) { From 03d3596414229c52b85bfbe3633ef91fbc941b65 Mon Sep 17 00:00:00 2001 From: Mila Lesechko <llesechk@adobe.com> Date: Mon, 20 May 2019 16:09:19 -0500 Subject: [PATCH 038/230] MC-4767: Convert PrintOrderFrontendGuestTest to MFTF --- .../ActionGroup/AdminAddToOrderBundleProductActionGroup.xml | 4 ++++ .../AdminAddToOrderConfigurableProductActionGroup.xml | 4 ++++ .../Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml | 4 ++++ .../AdminAddToOrderDownloadableProductActionGroup.xml | 4 ++++ .../AdminFilterProductInCreateOrderActionGroup.xml | 4 ++++ ...orefrontAssertSalesPrintOrderBillingAddressActionGroup.xml | 4 ++++ .../StorefrontFillOrdersAndReturnsFormActionGroup.xml | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml index 2791a5907153..c979dd883b17 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml @@ -9,6 +9,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAddToOrderBundleProductActionGroup"> + <annotations> + <description>Configuration added Bundle Product during creation order by Admin: select bundle option and product with quantity</description> + <page>AdminOrderCreatePage</page> + </annotations> <arguments> <argument name="option" type="string"/> <argument name="selectedProduct" type="entity"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml index 33378a9fa58c..9d824cfa2be5 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml @@ -9,6 +9,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAddToOrderConfigurableProductActionGroup"> + <annotations> + <description>Configuration added Configurable Product during creation order by Admin: select option by attribute and quantity</description> + <page>AdminOrderCreatePage</page> + </annotations> <arguments> <argument name="attribute" type="string"/> <argument name="option" type="string"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml index 457a63efe07d..415d2036722c 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml @@ -9,6 +9,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAddToOrderCouponCodeActionGroup"> + <annotations> + <description>Add and apply Coupon Code to order during creating order by Admin</description> + <page>AdminOrderCreatePage</page> + </annotations> <arguments> <argument name="coupon" type="entity"/> </arguments> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml index ec427fb9b677..e2a49878202a 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml @@ -9,6 +9,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAddToOrderDownloadableProductActionGroup"> + <annotations> + <description>Configuration added Downloadable Product during creation order by Admin: select link and quantity</description> + <page>AdminOrderCreatePage</page> + </annotations> <arguments> <argument name="link" type="string"/> <argument name="quantity" type="string" defaultValue="1"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml index 58d23f4b06bb..baa8a8f5348b 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml @@ -9,6 +9,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminFilterProductInCreateOrderActionGroup"> + <annotations> + <description>Search product in product grid on create order by admin page</description> + <page>AdminOrderCreatePage</page> + </annotations> <arguments> <argument name="productSKU" type="string"/> </arguments> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml index fe7e0064e5c5..0a92d38d65a8 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml @@ -9,6 +9,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AssertSalesPrintOrderBillingAddress"> + <annotations> + <description>Assert billing address data on printed order</description> + <page>StorefrontPrintOrderPage</page> + </annotations> <arguments> <argument name="address" type="entity"/> </arguments> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml index a3c0edf14812..6ce933762a69 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml @@ -9,6 +9,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontFillOrdersAndReturnsFormActionGroup"> + <annotations> + <description>Fill order information in form "Orders and Returns"</description> + <page>StorefrontGuestOrderSearchPage</page> + </annotations> <arguments> <argument name="orderNumber" type="string"/> <argument name="customer" type="entity" defaultValue="$$createCustomer$$"/> From 98d1c9a0d188685792e038cccefb89ada6836f43 Mon Sep 17 00:00:00 2001 From: Maxim Tkachuk <m.tkachuk@ism-ukraine.com> Date: Thu, 23 May 2019 11:13:11 +0300 Subject: [PATCH 039/230] magento/magento2#14071: Not able to change a position of last two related products in case of I've 20+ related products. --- .../AdminSimpleSetEditRelatedProductsTest.xml | 32 +++++++++++++++++++ .../dynamic-rows/templates/grid.html | 22 ++++++++++--- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml index b06502ce94c6..4803c1be6c93 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminSimpleSetEditRelatedProductsTest.xml @@ -22,6 +22,11 @@ <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <createData entity="SimpleProduct2" stepKey="simpleProduct0"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct3"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct4"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct5"/> + <createData entity="SimpleProduct2" stepKey="simpleProduct6"/> </before> <after> <!-- Delete simple product --> @@ -31,6 +36,11 @@ <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> <deleteData createDataKey="simpleProduct0" stepKey="deleteSimpleProduct0"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> + <deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/> + <deleteData createDataKey="simpleProduct4" stepKey="deleteSimpleProduct4"/> + <deleteData createDataKey="simpleProduct5" stepKey="deleteSimpleProduct5"/> + <deleteData createDataKey="simpleProduct6" stepKey="deleteSimpleProduct6"/> </after> <!--Create product--> @@ -69,6 +79,28 @@ <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee"/> <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct1.sku$$" stepKey="seeRelatedProduct"/> + <!--See more related products in admin--> + <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct2"> + <argument name="sku" value="$$simpleProduct2.sku$$"/> + </actionGroup> + <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct3"> + <argument name="sku" value="$$simpleProduct3.sku$$"/> + </actionGroup> + <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct4"> + <argument name="sku" value="$$simpleProduct4.sku$$"/> + </actionGroup> + <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct5"> + <argument name="sku" value="$$simpleProduct5.sku$$"/> + </actionGroup> + <actionGroup ref="addRelatedProductBySku" stepKey="addRelatedProduct6"> + <argument name="sku" value="$$simpleProduct6.sku$$"/> + </actionGroup> + <scrollTo selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" stepKey="scrollTo2"/> + <conditionalClick selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDropdown}}" dependentSelector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedDependent}}" visible="false" stepKey="openDropDownIfClosedRelatedSee2"/> + <see selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.sku$$" stepKey="seeSixthRelatedProduct"/> + <selectOption selector=".admin__collapsible-block-wrapper[data-index='related'] .admin__control-select" userInput="5" stepKey="selectFivePerPage"/> + <dontSee selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$simpleProduct6.sku$$" stepKey="dontSeeSixthRelatedProduct"/> + <!--See related product in storefront--> <amOnPage url="{{SimpleProduct3.sku}}.html" stepKey="goToStorefront"/> <waitForPageLoad stepKey="waitForStorefront"/> diff --git a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html index e5d73a62b329..b214d974e0d5 100644 --- a/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html +++ b/app/code/Magento/Ui/view/base/web/templates/dynamic-rows/templates/grid.html @@ -16,11 +16,23 @@ <div class="admin__field-control" data-role="grid-wrapper"> <div class="admin__control-table-pagination" visible="!!$data.getRecordCount()"> - <div class="admin__data-grid-pager"> - <button class="action-previous" type="button" data-bind="attr: {title: $t('Previous Page')}, click: previousPage, disable: isFirst()"></button> - <input class="admin__control-text" type="number" data-bind="attr: {id: ++ko.uid}, value: currentPage"> - <label class="admin__control-support-text" data-bind="attr: {for: ko.uid}, text: 'of ' + pages()"></label> - <button class="action-next" type="button" data-bind="attr: {title: $t('Next Page')}, click: nextPage, disable: isLast()"></button> + <div class="admin__data-grid-pager-wrap"> + <select class="admin__control-select" data-bind="value:pageSize, event:{change: reload}"> + <option value="5">5</option> + <option value="20" selected="selected">20</option> + <option value="30">30</option> + <option value="50">50</option> + <option value="100">100</option> + <option value="200">200</option> + <option value="500">500</option> + </select> + <label class="admin__control-support-text" data-bind="text: $t('per page')"></label> + <div class="admin__data-grid-pager"> + <button class="action-previous" type="button" data-bind="attr: {title: $t('Previous Page')}, click: previousPage, disable: isFirst()"></button> + <input class="admin__control-text" type="number" data-bind="attr: {id: ++ko.uid}, value: currentPage"> + <label class="admin__control-support-text" data-bind="attr: {for: ko.uid}, text: 'of ' + pages()"></label> + <button class="action-next" type="button" data-bind="attr: {title: $t('Next Page')}, click: nextPage, disable: isLast()"></button> + </div> </div> </div> From bcd34843b20dfa300f4290526d9ddb93f82639ef Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Fri, 24 May 2019 12:28:46 -0500 Subject: [PATCH 040/230] MC-4770: Convert CreateOrderFromEditCustomerPageTest to MFTF Removed unnecessary createData for config sett --- .../Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 3b6246e87f64..f3de31b1db17 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -79,8 +79,7 @@ <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> - <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> - <createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/> + <createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/> <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> From 7941a8bb7b17ddb35520f2877e3e8c82cbc5d93d Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 27 May 2019 18:52:47 +0300 Subject: [PATCH 041/230] Revert "Adding Delete Custom Variable Test" This reverts commit c02e4accef09ee6a99bd90018e189a797b42af6e. --- .../Variable/Test/Mftf/Data/VariableData.xml | 3 -- .../Test/Mftf/Metadata/variable-meta.xml | 21 ---------- .../Test/DeleteCustomVariableEntityTest.xml | 41 ------------------- 3 files changed, 65 deletions(-) delete mode 100644 app/code/Magento/Variable/Test/Mftf/Metadata/variable-meta.xml delete mode 100644 app/code/Magento/Variable/Test/Mftf/Test/DeleteCustomVariableEntityTest.xml diff --git a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml index 923beaad96e6..1160b7902661 100644 --- a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml +++ b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml @@ -17,7 +17,4 @@ <data key="html"> Sample Variable </data> <data key="plain">variable-plain-</data> </entity> - <entity name="customVariableV2" type="system_variable" extends="customVariable"> - <data key="code" unique="suffix">variable-code-</data> - </entity> </entities> diff --git a/app/code/Magento/Variable/Test/Mftf/Metadata/variable-meta.xml b/app/code/Magento/Variable/Test/Mftf/Metadata/variable-meta.xml deleted file mode 100644 index b2a37d20408a..000000000000 --- a/app/code/Magento/Variable/Test/Mftf/Metadata/variable-meta.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. - */ ---> - -<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> - <operation name="CreateCustomVariable" dataType="system_variable" type="create" auth="adminFormKey" - url="/admin/system_variable/save" method="POST" successRegex="/messages-message-success/"> - <contentType>application/x-www-form-urlencoded</contentType> - <object dataType="system_variable" key="variable"> - <field key="code">string</field> - <field key="name">string</field> - <field key="html">string</field> - <field key="plain">string</field> - </object> - </operation> -</operations> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/DeleteCustomVariableEntityTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/DeleteCustomVariableEntityTest.xml deleted file mode 100644 index 9ad67d261d6b..000000000000 --- a/app/code/Magento/Variable/Test/Mftf/Test/DeleteCustomVariableEntityTest.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?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="DeleteCustomVariableEntityTest"> - <annotations> - <features value="Variable"/> - <stories value="Delete Custom Variable."/> - <title value="Delete Custom Variable."/> - <description value="Test for deleting a custom variable."/> - <severity value="MAJOR"/> - <group value="variable"/> - <group value="mtf_migrated"/> - </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <createData entity="customVariableV2" stepKey="createCustomVariable"/> - </before> - <after> - <actionGroup ref="logout" stepKey="logout"/> - </after> - <actionGroup ref="AdminNavigateToVariablesGridPageActionGroup" stepKey="goToVariablesGridAdminPage"/> - <actionGroup ref="AdminFilterGridActionGroup" stepKey="filterVariablesGridByNewVariableCode" > - <argument name="field" value="{{AdminVariablesFilterSection.codeFilter}}"/> - <argument name="value" value="$$customVariableV2.code$$"/> - </actionGroup> - <actionGroup ref="AdminNavigateToVariablePageActionGroup" stepKey="openCustomVariablePage"> - <argument name="code" value="$$customVariableV2.code$$"/> - </actionGroup> - <actionGroup ref="AdminClickDeleteMainButtonWithConfirmationActionGroup" stepKey="clickDeleteVariable"/> - <actionGroup ref="AssertMessageActionGroup" stepKey="seeSuccessMessage"> - <argument name="message" value="You deleted the custom variable."/> - </actionGroup> - </test> -</tests> From 843693c2dc5da3f5fdd6694c87c85dd7c1fb1b8b Mon Sep 17 00:00:00 2001 From: eduard13 <e.chitoraga@atwix.com> Date: Mon, 27 May 2019 19:21:27 +0300 Subject: [PATCH 042/230] Removing the not needed Action Group --- .../ActionGroup/AssertMessageActionGroup.xml | 18 ------------------ .../Test/CreateCustomVariableEntityTest.xml | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageActionGroup.xml deleted file mode 100644 index 25e716a13948..000000000000 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageActionGroup.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertMessageActionGroup"> - <arguments> - <argument name="message" type="string" /> - <argument name="messageType" type="string" defaultValue="success" /> - </arguments> - <see userInput="{{message}}" selector=".messages .message-{{messageType}}" stepKey="verifyMessage" /> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml index cb843f64d341..ff6e648c5998 100644 --- a/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml +++ b/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml @@ -30,7 +30,7 @@ <actionGroup ref="AdminClickMainButtonActionGroup" stepKey="clickSaveCustomVariable"> <argument name="button" value="{{AdminMainActionsSection.save}}"/> </actionGroup> - <actionGroup ref="AssertMessageActionGroup" stepKey="seeSuccessMessage"> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage"> <argument name="message" value="You saved the custom variable."/> </actionGroup> <actionGroup ref="AdminFilterGridActionGroup" stepKey="filterVariablesGridByNewVariableCode" > From d338df50b029e2808b4e00b02997bff3c40c21c4 Mon Sep 17 00:00:00 2001 From: Mila Lesechko <llesechk@adobe.com> Date: Tue, 28 May 2019 15:12:27 -0500 Subject: [PATCH 043/230] MC-4767: Convert PrintOrderFrontendGuestTest to MFTF --- .../Test/Mftf/Section/AdminProductFormBundleSection.xml | 2 +- .../Section/AdminProductFormConfigurationsSection.xml | 2 +- .../Magento/Downloadable/Test/Mftf/Data/ProductData.xml | 2 +- .../AdminAddToOrderBundleProductActionGroup.xml | 8 ++------ .../AdminAddToOrderConfigurableProductActionGroup.xml | 4 ---- .../ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml | 8 ++------ .../AdminAddToOrderDownloadableProductActionGroup.xml | 4 ---- .../AdminFilterProductInCreateOrderActionGroup.xml | 4 ---- ...rontAssertSalesPrintOrderBillingAddressActionGroup.xml | 4 ---- .../StorefrontFillOrdersAndReturnsFormActionGroup.xml | 6 +----- .../Test/Mftf/Section/StorefrontGuestOrderViewSection.xml | 2 +- .../Test/Mftf/Section/StorefrontOrderDetailsSection.xml | 2 +- .../Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml | 6 +++--- 13 files changed, 13 insertions(+), 41 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml index fe9f247c0a2e..909f349b46a5 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml @@ -43,7 +43,7 @@ <element name="shortDescription" type="input" selector="#product_form_short_description"/> <!--BundleOptionsDropDown--> <element name="bundleOptionsDropDown" type="button" selector="div[data-index='bundle-items']" timeout="30"/> - <element name="currentBundleOption" type="text" selector="//div[@data-index='bundle-items']//div[@class='admin__collapsible-title']/span"/> + <element name="currentBundleOption" type="text" selector="//div[@data-index='bundle-items']//div[contains(@class, 'admin__collapsible-title')]/span"/> <!--AddingAnOption--> <element name="addOptions" type="button" selector="//tr[@data-repeat-index='0']//td[4]" timeout="30"/> <!--SEODropdownTab--> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml index 8a54a73bfa29..30c5910e85e2 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml @@ -44,7 +44,7 @@ <element name="productQuantity" type="input" selector=".admin__control-text[name='product[quantity_and_stock_status][qty]']"/> <element name="currentVariationsQuantityCells" type="button" selector="td[data-index='quantity_container']"/> <element name="rowByCode" type="textarea" selector="//span[contains(text(), '{{var1}}-{{var2}}')]//ancestor-or-self::tr" parameterized="true"/> - <element name="currentAttribute" type="text" selector="//fieldset[@class='admin__fieldset']/div[@class='admin__field _disabled']//span"/> + <element name="currentAttribute" type="text" selector="//fieldset[@class='admin__fieldset']/div[contains(@class, 'admin__field _disabled')]//span"/> </section> <section name="AdminConfigurableProductSelectAttributesSlideOut"> <element name="grid" type="button" selector=".admin__data-grid-wrap tbody"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Downloadable/Test/Mftf/Data/ProductData.xml index 3b0be227a194..1a6be43b38d2 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Data/ProductData.xml @@ -74,7 +74,7 @@ <requiredEntity type="custom_attribute_array">ApiProductShortDescription</requiredEntity> <requiredEntity type="downloadable_link">apiDownloadableLink</requiredEntity> </entity> - <entity name="DownloadableProductWithTwoLink1000" type="product"> + <entity name="DownloadableProductWithTwoLink100" type="product"> <data key="sku" unique="suffix">downloadableproduct</data> <data key="type_id">downloadable</data> <data key="attribute_set_id">4</data> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml index c979dd883b17..f5a600b1d259 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderBundleProductActionGroup.xml @@ -9,20 +9,16 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAddToOrderBundleProductActionGroup"> - <annotations> - <description>Configuration added Bundle Product during creation order by Admin: select bundle option and product with quantity</description> - <page>AdminOrderCreatePage</page> - </annotations> <arguments> <argument name="option" type="string"/> - <argument name="selectedProduct" type="entity"/> + <argument name="selectedProductName" type="string"/> <argument name="quantity" type="string"/> </arguments> <scrollTo selector="{{AdminOrderFormConfigureProductSection.bundleItems}}" stepKey="scroll"/> <click selector="{{AdminOrderFormConfigureProductSection.bundleItems}}" stepKey="focusOnSideDialog"/> <waitForAjaxLoad stepKey="waitForAjax"/> <click selector="{{AdminOrderFormConfigureProductSection.bundleSelect(option)}}" stepKey="clickSelector"/> - <selectOption selector="{{AdminOrderFormConfigureProductSection.bundleSelect(option)}}" userInput="{{selectedProduct.name}}" stepKey="selectionOption"/> + <selectOption selector="{{AdminOrderFormConfigureProductSection.bundleSelect(option)}}" userInput="{{selectedProductName}}" stepKey="selectionOption"/> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <fillField userInput="{{quantity}}" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/> <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml index 9d824cfa2be5..33378a9fa58c 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderConfigurableProductActionGroup.xml @@ -9,10 +9,6 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAddToOrderConfigurableProductActionGroup"> - <annotations> - <description>Configuration added Configurable Product during creation order by Admin: select option by attribute and quantity</description> - <page>AdminOrderCreatePage</page> - </annotations> <arguments> <argument name="attribute" type="string"/> <argument name="option" type="string"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml index 415d2036722c..23f83c567c59 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderCouponCodeActionGroup.xml @@ -9,14 +9,10 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAddToOrderCouponCodeActionGroup"> - <annotations> - <description>Add and apply Coupon Code to order during creating order by Admin</description> - <page>AdminOrderCreatePage</page> - </annotations> <arguments> - <argument name="coupon" type="entity"/> + <argument name="couponCode" type="string"/> </arguments> - <fillField userInput="{{coupon.code}}" selector="{{AdminOrderFormDiscountSection.fieldCouponCode}}" stepKey="fillCouponCode"/> + <fillField userInput="{{couponCode}}" selector="{{AdminOrderFormDiscountSection.fieldCouponCode}}" stepKey="fillCouponCode"/> <click selector="{{AdminOrderFormDiscountSection.applyCouponCode}}" stepKey="clickApply"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml index e2a49878202a..ec427fb9b677 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAddToOrderDownloadableProductActionGroup.xml @@ -9,10 +9,6 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminAddToOrderDownloadableProductActionGroup"> - <annotations> - <description>Configuration added Downloadable Product during creation order by Admin: select link and quantity</description> - <page>AdminOrderCreatePage</page> - </annotations> <arguments> <argument name="link" type="string"/> <argument name="quantity" type="string" defaultValue="1"/> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml index baa8a8f5348b..58d23f4b06bb 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminFilterProductInCreateOrderActionGroup.xml @@ -9,10 +9,6 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminFilterProductInCreateOrderActionGroup"> - <annotations> - <description>Search product in product grid on create order by admin page</description> - <page>AdminOrderCreatePage</page> - </annotations> <arguments> <argument name="productSKU" type="string"/> </arguments> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml index 0a92d38d65a8..fe7e0064e5c5 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontAssertSalesPrintOrderBillingAddressActionGroup.xml @@ -9,10 +9,6 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AssertSalesPrintOrderBillingAddress"> - <annotations> - <description>Assert billing address data on printed order</description> - <page>StorefrontPrintOrderPage</page> - </annotations> <arguments> <argument name="address" type="entity"/> </arguments> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml index 6ce933762a69..b137ba71e859 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontFillOrdersAndReturnsFormActionGroup.xml @@ -9,13 +9,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="StorefrontFillOrdersAndReturnsFormActionGroup"> - <annotations> - <description>Fill order information in form "Orders and Returns"</description> - <page>StorefrontGuestOrderSearchPage</page> - </annotations> <arguments> <argument name="orderNumber" type="string"/> - <argument name="customer" type="entity" defaultValue="$$createCustomer$$"/> + <argument name="customer" type="entity"/> </arguments> <fillField selector="{{StorefrontGuestOrderSearchSection.orderId}}" userInput="{{orderNumber}}" stepKey="inputOrderId"/> <fillField selector="{{StorefrontGuestOrderSearchSection.billingLastName}}" userInput="{{customer.lastname}}" stepKey="inputBillingLastName"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontGuestOrderViewSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontGuestOrderViewSection.xml index 3085a591a119..70f37352fb18 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontGuestOrderViewSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontGuestOrderViewSection.xml @@ -10,6 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontGuestOrderViewSection"> <element name="orderInformationTab" type="text" selector="//*[@class='nav item current']/strong[contains(text(), 'Order Information')]"/> - <element name="printOrder" type="button" selector=".order-actions-toolbar .actions .print" timeout="10"/> + <element name="printOrder" type="button" selector=".order-actions-toolbar .actions .print" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml index 4eecebd26476..c255e15cd6ec 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/StorefrontOrderDetailsSection.xml @@ -15,6 +15,6 @@ <element name="grandTotalPrice" type="text" selector="tr.grand_total span.price"/> <element name="paymentMethod" type="text" selector=".box-order-billing-method dt.title"/> <element name="shippingMethod" type="text" selector=".box-order-shipping-method div.box-content"/> - <element name="productNameCell" type="text" selector="//*[@class='product name product-item-name']"/> + <element name="productNameCell" type="text" selector="//*[contains(@class, 'product-item-name')]"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml index 804514ef4922..5c0d40510246 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontPrintOrderGuestTest.xml @@ -23,7 +23,7 @@ <createData entity="ApiCategory" stepKey="createCategory"/> <!-- Create downloadable Product --> - <createData entity="DownloadableProductWithTwoLink1000" stepKey="downloadableProduct"> + <createData entity="DownloadableProductWithTwoLink100" stepKey="downloadableProduct"> <requiredEntity createDataKey="createCategory"/> <field key="price">280</field> </createData> @@ -182,7 +182,7 @@ </actionGroup> <actionGroup ref="AdminAddToOrderBundleProductActionGroup" stepKey="addBundleProduct"> <argument name="option" value="{$grabBundleOption}"/> - <argument name="selectedProduct" value="$$simpleProduct1$$"/> + <argument name="selectedProductName" value="$$simpleProduct1.name$$"/> <argument name="quantity" value="2"/> </actionGroup> @@ -196,7 +196,7 @@ <!-- add Coupon --> <actionGroup ref="AdminAddToOrderCouponCodeActionGroup" stepKey="addCoupon"> - <argument name="coupon" value="$$createCouponForCartPriceRule$$"/> + <argument name="couponCode" value="$$createCouponForCartPriceRule.code$$"/> </actionGroup> <actionGroup ref="fillOrderCustomerInformation" stepKey="fillOrder"> From 39d00937285505c7222a917b0b4631471198954f Mon Sep 17 00:00:00 2001 From: Maria Kovdrysh <kovdrysh@adobe.com> Date: Tue, 28 May 2019 15:17:37 -0500 Subject: [PATCH 044/230] MC-4331: Convert DeleteProductsFromCartOfAdvancedCheckoutEntityTest to MFTF --- .../Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml index a85920998b39..9eed016adc65 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml @@ -47,7 +47,7 @@ <element name="checkoutCartSubtotal" type="text" selector="//td[@class='col subtotal']//span[@class='price']"/> <element name="emptyCart" selector=".cart-empty" type="text"/> <!-- Required attention section --> - <element name="removeProductBySku" type="button" selector="//*[contains(text(), '{{sku}}')]/ancestor::tbody//button" parameterized="true" timeout="30"/> - <element name="failedItemBySku" type="block" selector="//*[@class='cart item' and .//tr[contains(@class,'info') and .//div[contains(.,'{{sku}}')]]]" parameterized="true" timeout="30"/> + <element name="removeProductBySku" type="button" selector="//div[contains(., '{{sku}}')]/ancestor::tbody//button" parameterized="true" timeout="30"/> + <element name="failedItemBySku" type="block" selector="//div[contains(.,'{{sku}}')]/ancestor::tbody" parameterized="true" timeout="30"/> </section> </sections> From c79d722e96cfe2a24492fdfd64cb3f55c015fbe8 Mon Sep 17 00:00:00 2001 From: Yaroslav Rogoza <enarc@atwix.com> Date: Wed, 29 May 2019 19:41:49 +0200 Subject: [PATCH 045/230] Refactoring. Use action groups instead of direct actions in the test --- ...ionErrorForCheckoutAddressFieldsActionGroup.xml | 14 ++++++++++++++ .../Test/Mftf/Section/CheckoutShippingSection.xml | 1 + .../StorefrontOnePageCheckoutJsValidationTest.xml | 11 +++++------ .../TestCase/OnePageCheckoutJsValidationTest.xml | 3 +-- 4 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertNoValidationErrorForCheckoutAddressFieldsActionGroup.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertNoValidationErrorForCheckoutAddressFieldsActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertNoValidationErrorForCheckoutAddressFieldsActionGroup.xml new file mode 100644 index 000000000000..93e73a0c62b2 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAssertNoValidationErrorForCheckoutAddressFieldsActionGroup.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertNoValidationErrorForCheckoutAddressFieldsActionGroup"> + <dontSeeElement selector="{{CheckoutShippingSection.addressFieldValidationError}}" stepKey="checkFieldsValidationIsPassed"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml index 97ae206a6700..0b86a1e7c394 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml @@ -39,5 +39,6 @@ <element name="editActiveAddress" type="button" selector="//div[@class='shipping-address-item selected-item']//span[text()='Edit']" timeout="30"/> <element name="loginButton" type="button" selector=".action.login" timeout="30"/> <element name="shipHereButton" type="button" selector="//div[text()='{{street}}']/button[@class='action action-select-shipping-item']" parameterized="true" timeout="30"/> + <element name="addressFieldValidationError" type="text" selector="div.address div.field .field-error"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml index b699ecdc5a15..e1bff8654274 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml @@ -21,17 +21,16 @@ <createData entity="ApiSimpleProduct" stepKey="createProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage"> - <argument name="product" value="$$createProduct$$"/> - </actionGroup> - <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="guestGoToCheckoutFromMinicart"/> - <waitForPageLoad stepKey="waitForCheckoutPage"/> </before> <after> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> </after> - <dontSeeElement selector="div .field-error" stepKey="dontSeeValidationErrors"/> + <actionGroup ref="AddSimpleProductToCart" stepKey="addToCartFromStorefrontProductPage"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="guestGoToCheckout"/> + <actionGroup ref="StorefrontAssertNoValidationErrorForCheckoutAddressFieldsActionGroup" stepKey="seeNoValidationErrors"/> </test> </tests> diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml index 65ae2dd442d7..8bc5a4d00856 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml @@ -9,10 +9,9 @@ <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutJsValidationTest" summary="JS validation verification for Checkout flow" ticketId="MAGETWO-59697"> <variation name="OnePageCheckoutJsValidationTestVariation1" summary="JS validation is not applied for empty required checkout fields if customer did not fill them"> <data name="issue" xsi:type="string">MAGETWO-97990: [MTF] OnePageCheckoutJsValidationTestVariation1_0 randomly fails on jenkins</data> - <data name="tag" xsi:type="string">severity:S2</data> + <data name="tag" xsi:type="string">severity:S2,mftf_migrated:yes</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="checkoutMethod" xsi:type="string">guest</data> - <data name="tag" xsi:type="string">mftf_migrated:yes</data> <constraint name="Magento\Checkout\Test\Constraint\AssertShippingAddressJsValidationMessagesIsAbsent" /> </variation> </testCase> From 6621abc9a1474b54f23ad5af7489fcb9295dfcf6 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Wed, 5 Jun 2019 15:53:04 -0500 Subject: [PATCH 046/230] MC-4770: Convert CreateOrderFromEditCustomerPageTest to MFTF fixed as per review comments --- .../Sales/Test/Mftf/Data/OrderData.xml | 7 +++++- .../AdminCreateOrderShoppingCartSection.xml | 2 +- .../AdminCreateOrderWishListSection.xml | 2 +- .../AdminOrderFormItemsOrderedSection.xml | 1 + .../CreateOrderFromEditCustomerPageTest.xml | 22 ++++++++++--------- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Data/OrderData.xml b/app/code/Magento/Sales/Test/Mftf/Data/OrderData.xml index eb5600f112ea..39ce03692e0b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Data/OrderData.xml +++ b/app/code/Magento/Sales/Test/Mftf/Data/OrderData.xml @@ -23,7 +23,11 @@ <data key="from">200</data> <data key="to">400</data> </entity> - + <entity name="AdminOrderMultipleProducts" type="order"> + <data key="subtotal">60.00</data> + <data key="shipping">0.00</data> + <data key="grandTotal">60.00</data> + </entity> <entity name="OrderStatus" type="status"> <data key="canceled">Canceled</data> <data key="closed">Closed</data> @@ -34,5 +38,6 @@ <data key="pending">Pending</data> <data key="pendingPayment">Pending Payment</data> <data key="processing">Processing</data> + <data key="ordered">Ordered</data> </entity> </entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderShoppingCartSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderShoppingCartSection.xml index 76826f9571f3..fdd80a1813aa 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderShoppingCartSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderShoppingCartSection.xml @@ -12,4 +12,4 @@ <element name="shoppingCartBlock" type="text" selector="#sidebar_data_cart"/> <element name="addToOrderCheckBox" type="checkbox" selector="//div[@id='order-sidebar_cart']//tr[td[.='{{productName}}']]//input[contains(@name,'sidebar[add_cart_item]')]" parameterized="true" timeout="30"/> </section> -</sections> \ No newline at end of file +</sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderWishListSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderWishListSection.xml index 86145a7221ad..d6c0c994dda3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderWishListSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreateOrderWishListSection.xml @@ -13,4 +13,4 @@ <element name="addProductToOrderCheckBox" type="checkbox" selector="//div[@id='order-sidebar_wishlist']//tr[td[.='{{productName}}']]//input[contains(@name,'sidebar[add_wishlist_item]')]" parameterized="true" timeout="30"/> <element name="addConfigProductToOrder" type="text" selector="//div[@id='order-sidebar_wishlist']//tr[td[contains(.,'{{configProductName}}')]]//a[contains(@class, 'icon-configure')]" parameterized="true" timeout="30"/> </section> -</sections> \ No newline at end of file +</sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml index 52f311cef721..c28ec58cebbe 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml @@ -19,3 +19,4 @@ <element name="moveProduct" type="select" selector="//td[contains(.,'{{productName}}')]/../..//td//select" parameterized="true"/> </section> </sections> + diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index f3de31b1db17..647570038070 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -191,14 +191,16 @@ <click selector="{{AdminEditCustomerOrdersSection.orderIdInGrid('$orderId')}}" stepKey="selectOnOrderID"/> <!-- Assert ordered product in customer order section--> - <waitForPageLoad stepKey="waitForOrderInformationTolLoad"/> - <see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$$createConfigProduct.name$$" stepKey="seeConfigurableProductInGrid"/> - <see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$$simpleProduct.name$$" stepKey="seeFirstProductInGrid"/> - <see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$$simpleProduct1.name$$" stepKey="seeSecondProductInGrid"/> - <see selector="{{AdminOrderItemsOrderedSection.statusColumn}}" userInput="Ordered" stepKey="seeProductStatus"/> - <see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$30.00" stepKey="seeConfigurableProductSubtotal"/> - <see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$10.00" stepKey="seeFirstProductSubtotal"/> - <see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$20.00" stepKey="seeSecondProductSubtotal"/> - <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="$60.00" stepKey="seeOrderGrandTotal"/> + <waitForPageLoad stepKey="waitForOrderInformationToLoad"/> + <see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$createConfigProduct.name$" stepKey="seeConfigurableProductInGrid"/> + <see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$simpleProduct.name$" stepKey="seeFirstProductInGrid"/> + <see selector="{{AdminOrderItemsOrderedSection.productNameColumn}}" userInput="$simpleProduct1.name$" stepKey="seeSecondProductInGrid"/> + <see selector="{{AdminOrderItemsOrderedSection.statusColumn}}" userInput="{{OrderStatus.ordered}}" stepKey="seeProductStatus"/> + <see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$createConfigChildProduct1.price$" stepKey="seeConfigurableProductSubtotal"/> + <see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$simpleProduct.price$" stepKey="seeFirstProductSubtotal"/> + <see selector="{{AdminOrderItemsOrderedSection.subtotalColumn}}" userInput="$simpleProduct1.price$" stepKey="seeSecondProductSubtotal"/> + <see selector="{{AdminOrderTotalSection.subTotal}}" userInput="{{AdminOrderMultipleProducts.subtotal}}" stepKey="checkSubtotal" /> + <see selector="{{AdminOrderTotalSection.shippingAndHandling}}" userInput="{{AdminOrderMultipleProducts.shipping}}" stepKey="checkShippingAndHandling" /> + <see selector="{{AdminOrderTotalSection.grandTotal}}" userInput="{{AdminOrderMultipleProducts.grandTotal}}" stepKey="checkGrandTotal" /> </test> -</tests> \ No newline at end of file +</tests> From 6a694a9bab15ab20531ffb2f70a744127611a1e3 Mon Sep 17 00:00:00 2001 From: Aliaksei Yakimovich2 <aliaksei_yakimovich2@epam.com> Date: Thu, 6 Jun 2019 17:33:57 +0300 Subject: [PATCH 047/230] MC-17218: php bin/magento catalog:image:resize error if image is missing - Fixed an issue with resize command; --- .../Console/Command/ImagesResizeCommand.php | 39 +++++++++++++++---- .../MediaStorage/Service/ImageResize.php | 25 ++++++++---- 2 files changed, 48 insertions(+), 16 deletions(-) diff --git a/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php b/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php index a4b78287df01..38d333ed649f 100644 --- a/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php +++ b/app/code/Magento/MediaStorage/Console/Command/ImagesResizeCommand.php @@ -15,6 +15,9 @@ use Symfony\Component\Console\Helper\ProgressBar; use Magento\Framework\ObjectManagerInterface; +/** + * Class for catalog image resizing via CLI + */ class ImagesResizeCommand extends \Symfony\Component\Console\Command\Command { /** @@ -49,7 +52,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ protected function configure() { @@ -58,19 +61,23 @@ protected function configure() } /** - * {@inheritdoc} + * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output) { try { + $errors = []; $this->appState->setAreaCode(Area::AREA_GLOBAL); $generator = $this->resize->resizeFromThemes(); /** @var ProgressBar $progress */ - $progress = $this->objectManager->create(ProgressBar::class, [ - 'output' => $output, - 'max' => $generator->current() - ]); + $progress = $this->objectManager->create( + ProgressBar::class, + [ + 'output' => $output, + 'max' => $generator->current() + ] + ); $progress->setFormat( "%current%/%max% [%bar%] %percent:3s%% %elapsed% %memory:6s% \t| <info>%message%</info>" ); @@ -79,8 +86,17 @@ protected function execute(InputInterface $input, OutputInterface $output) $progress->setOverwrite(false); } + // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall for (; $generator->valid(); $generator->next()) { - $progress->setMessage($generator->key()); + $resizeInfo = $generator->key(); + $error = $resizeInfo['error']; + $filename = $resizeInfo['filename']; + + if ($error !== '') { + $errors[$filename] = $error; + } + + $progress->setMessage($filename); $progress->advance(); } } catch (\Exception $e) { @@ -90,6 +106,13 @@ protected function execute(InputInterface $input, OutputInterface $output) } $output->write(PHP_EOL); - $output->writeln("<info>Product images resized successfully</info>"); + if (count($errors)) { + $output->writeln("<info>Product images resized with errors:</info>"); + foreach ($errors as $error) { + $output->writeln("<error>{$error}</error>"); + } + } else { + $output->writeln("<info>Product images resized successfully</info>"); + } } } diff --git a/app/code/Magento/MediaStorage/Service/ImageResize.php b/app/code/Magento/MediaStorage/Service/ImageResize.php index aae90512b3d9..5ac0ac688619 100644 --- a/app/code/Magento/MediaStorage/Service/ImageResize.php +++ b/app/code/Magento/MediaStorage/Service/ImageResize.php @@ -161,14 +161,21 @@ public function resizeFromThemes(array $themes = null): \Generator $viewImages = $this->getViewImages($themes ?? $this->getThemesInUse()); foreach ($productImages as $image) { + $error = ''; $originalImageName = $image['filepath']; $originalImagePath = $this->mediaDirectory->getAbsolutePath( $this->imageConfig->getMediaPath($originalImageName) ); - foreach ($viewImages as $viewImage) { - $this->resize($viewImage, $originalImagePath, $originalImageName); + + if ($this->mediaDirectory->isFile($originalImagePath)) { + foreach ($viewImages as $viewImage) { + $this->resize($viewImage, $originalImagePath, $originalImageName); + } + } else { + $error = __('Cannot resize image "%1" - original image not found', $originalImagePath); } - yield $originalImageName => $count; + + yield ['filename' => $originalImageName, 'error' => $error] => $count; } } @@ -202,10 +209,12 @@ private function getViewImages(array $themes): array $viewImages = []; /** @var \Magento\Theme\Model\Theme $theme */ foreach ($themes as $theme) { - $config = $this->viewConfig->getViewConfig([ - 'area' => Area::AREA_FRONTEND, - 'themeModel' => $theme, - ]); + $config = $this->viewConfig->getViewConfig( + [ + 'area' => Area::AREA_FRONTEND, + 'themeModel' => $theme, + ] + ); $images = $config->getMediaEntities('Magento_Catalog', ImageHelper::MEDIA_TYPE_CONFIG_NODE); foreach ($images as $imageId => $imageData) { $uniqIndex = $this->getUniqueImageIndex($imageData); @@ -226,7 +235,7 @@ private function getUniqueImageIndex(array $imageData): string { ksort($imageData); unset($imageData['type']); - return md5(json_encode($imageData)); + return hash('sha256', json_encode($imageData)); } /** From f55d2ee1252236f1739cc6dcff13ae4b62fd6ab0 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Thu, 6 Jun 2019 12:59:31 -0500 Subject: [PATCH 048/230] MC-4770: Convert CreateOrderFromEditCustomerPageTest to MFTF --- .../Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 647570038070..1801e19f1fe6 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -17,6 +17,7 @@ <severity value="CRITICAL"/> <testCaseId value="MC-16161"/> <group value="mtf_migrated"/> + <group value="banana"/> </annotations> <before> @@ -120,6 +121,7 @@ <selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveProductToWishList"/> <selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$createConfigProduct.name$$)}}" userInput="Move to Wish List" stepKey="moveConfigurableProductToWishList"/> <click selector="{{OrdersGridSection.update}}" stepKey="clickOnUpdateItemsAndQuantity"/> + <waitForPageLoad stepKey="waitForAdminCreateOrderWishListSectionPageLoad"/> <!-- Assert products in Wish List section --> <see selector="{{AdminCreateOrderWishListSection.wishListBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInWishList"/> From 2b81e8c212961248fc8ca9ec0770e37e007e9a47 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Thu, 6 Jun 2019 16:10:09 -0500 Subject: [PATCH 049/230] MC-4770: Convert CreateOrderFromEditCustomerPageTest to MFTF fixing jenkins builds --- .../Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml | 1 - .../Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml index 1dd5ffd67d21..e3417e7c662b 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml @@ -20,4 +20,3 @@ <element name="moveProduct" type="select" selector="//td[contains(.,'{{productName}}')]/../..//td//select" parameterized="true"/> </section> </sections> - diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 1801e19f1fe6..7ead092a1aea 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -135,6 +135,7 @@ <selectOption selector="{{AdminOrderFormConfigureProductSection.optionSelect($$createConfigProductAttribute.default_frontend_label$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="selectConfigurableOption"/> <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/> <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton"/> + <waitForPageLoad stepKey="waitForAdminOrderItemsOrderedSectionPageLoad1"/> <!-- Assert Products in Order item section --> <see selector="{{AdminOrderItemsOrderedSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeSimpleProductInOrderItemGrid"/> @@ -144,6 +145,7 @@ <selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct.name$$)}}" userInput="Move to Shopping Cart" stepKey="moveFirstSimpleProductToShoppingCart"/> <selectOption selector="{{AdminOrderFormItemsOrderedSection.moveProduct($$simpleProduct1.name$$)}}" userInput="Move to Shopping Cart" stepKey="moveSecondSimpleProductToShoppingCart"/> <click selector="{{OrdersGridSection.update}}" stepKey="clickOnUpdateItems"/> + <waitForPageLoad stepKey="waitForAdminCreateOrderShoppingCartSectionPageLoad"/> <!-- Assert products in Shopping cart section --> <see selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct.name$$" stepKey="seeProductInShoppingCart"/> @@ -154,6 +156,7 @@ <click selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox($$simpleProduct.name$$)}}" stepKey="selectFirstProduct"/> <click selector="{{AdminCreateOrderShoppingCartSection.addToOrderCheckBox($$simpleProduct1.name$$)}}" stepKey="selectSecondProduct"/> <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickOnUpdateButton1"/> + <waitForPageLoad stepKey="waitForAdminCreateOrderShoppingCartSectionPageLoad1"/> <!-- After move, assert products are not present in Shopping cart section --> <dontSee selector="{{AdminCreateOrderShoppingCartSection.shoppingCartBlock}}" userInput="$$simpleProduct.name$$" stepKey="donSeeProductInShoppingCart"/> @@ -177,6 +180,7 @@ <!-- Submit order --> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> + <waitForPageLoad stepKey="waitForAdminOrderFormLoad"/> <!-- Verify order information --> <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> From 783d6a2b4bd3ad52831a1237fa0951fde9ddafd1 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Mon, 10 Jun 2019 16:03:47 -0500 Subject: [PATCH 050/230] MC-4554: Convert CreateCustomerCustomAttributesEntityTest to MFTF --- .../Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml index 7ead092a1aea..4c1f16192c88 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreateOrderFromEditCustomerPageTest.xml @@ -17,7 +17,6 @@ <severity value="CRITICAL"/> <testCaseId value="MC-16161"/> <group value="mtf_migrated"/> - <group value="banana"/> </annotations> <before> From fb99d8f354e8ead9d31df126047ed381c1e99c8a Mon Sep 17 00:00:00 2001 From: Ievgenii Gryshkun <i.gryshkun@gmail.com> Date: Tue, 11 Jun 2019 08:41:08 +0300 Subject: [PATCH 051/230] customizable_options.values contains everything but value(s) --- app/code/Magento/QuoteGraphQl/etc/schema.graphqls | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index dda8fe3bf337..0720e64c3d90 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -314,6 +314,7 @@ type SelectedCustomizableOption { type SelectedCustomizableOptionValue { id: Int! label: String! + value: String @deprecated (reason: "The value field is deprecated. It was moved to CartItemSelectedOptionValuePrice.") price: CartItemSelectedOptionValuePrice! } From ae1ffd19c5b47484926655a54f094877cf052e7f Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Tue, 11 Jun 2019 14:35:36 -0500 Subject: [PATCH 052/230] MC-4459: Convert OnePageCheckoutOfflinePaymentMethodsTest to MFTF - Rename data entity that collided with an already existing entity --- .../Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml index 37687461d8db..11b8931618f7 100644 --- a/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml +++ b/app/code/Magento/Store/Test/Mftf/Data/StoreShippingMethodsData.xml @@ -36,9 +36,9 @@ </entity> <entity name="MinimumOrderAmount100" type="minimum_order_amount"> - <requiredEntity type="free_shipping_subtotal">Price</requiredEntity> + <requiredEntity type="free_shipping_subtotal">FreeShippingSubtotal100</requiredEntity> </entity> - <entity name="Price" type="free_shipping_subtotal"> + <entity name="FreeShippingSubtotal100" type="free_shipping_subtotal"> <data key="value">100</data> </entity> From 6dc3e54cf7d7090c26934affcb3bce75bd618008 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Tue, 11 Jun 2019 16:01:23 -0500 Subject: [PATCH 053/230] MC-4459: Convert OnePageCheckoutOfflinePaymentMethodsTest to MFTF - Fortify waiting for tax in shopping cart --- .../StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index 728225d46008..e6b85e2ebd33 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -166,8 +166,7 @@ </actionGroup> <reloadPage stepKey="reloadThePage"/> <waitForPageLoad stepKey="waitForPageToReload"/> - <waitForElementVisible selector="{{CheckoutCartSummarySection.taxAmount}}" stepKey="waitForShippingOption"/> - <see selector="{{CheckoutCartSummarySection.taxAmount}}" userInput="$9.60" stepKey="seeTaxInTheCartSummary"/> + <waitForText selector="{{CheckoutCartSummarySection.taxAmount}}" userInput="$9.60" time="90" stepKey="waitForTaxAmount"/> <!--Select Free Shipping and proceed to checkout --> <click selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="selectFlatRateShippingMethod"/> From fde7dc76e6fd4f5cb3429e79d43203fd196489e4 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Wed, 12 Jun 2019 12:32:55 -0500 Subject: [PATCH 054/230] MC-4459: Convert OnePageCheckoutOfflinePaymentMethodsTest to MFTF - Skip MC-14709 --- .../StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml index e6b85e2ebd33..c8c6407363b4 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontGuestCheckoutUsingFreeShippingAndTaxesTest.xml @@ -15,6 +15,9 @@ <severity value="CRITICAL"/> <testCaseId value="MC-14709"/> <group value="mtf_migrated"/> + <skip> + <issueId value="MC-16684"/> + </skip> </annotations> <before> From 4778bbb2880d0ad94ec65975d8d4481b21f719ea Mon Sep 17 00:00:00 2001 From: vitaliyboyko <v.boyko@atwix.com> Date: Mon, 10 Sep 2018 17:16:29 +0000 Subject: [PATCH 055/230] GraphQl-167: Add support for '@magentoConfigFixture' annotation on API-functional tests --- .../TestFramework/App/MutableScopeConfig.php | 125 ++++++++++++++++++ .../Bootstrap/WebapiDocBlock.php | 11 +- .../ProductOnlyXLeftInStockTest.php | 1 - .../ProductStockStatusTest.php | 1 - .../Annotation/ConfigFixture.php | 9 +- .../SendFriend/Controller/SendmailTest.php | 3 +- .../_files/disable_allow_guest_config.php | 24 ---- .../_files/product_simple_rollback.php | 26 ---- 8 files changed, 144 insertions(+), 56 deletions(-) create mode 100644 dev/tests/api-functional/framework/Magento/TestFramework/App/MutableScopeConfig.php delete mode 100644 dev/tests/integration/testsuite/Magento/SendFriend/_files/disable_allow_guest_config.php delete mode 100644 dev/tests/integration/testsuite/Magento/SendFriend/_files/product_simple_rollback.php diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/App/MutableScopeConfig.php b/dev/tests/api-functional/framework/Magento/TestFramework/App/MutableScopeConfig.php new file mode 100644 index 000000000000..efcb5be34e59 --- /dev/null +++ b/dev/tests/api-functional/framework/Magento/TestFramework/App/MutableScopeConfig.php @@ -0,0 +1,125 @@ +<?php +/** + * Application configuration object. Used to access configuration when application is installed. + * + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +declare(strict_types=1); + +namespace Magento\TestFramework\App; + +use Magento\Framework\App\Config\MutableScopeConfigInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\TestFramework\ObjectManager; + +/** + * @inheritdoc + */ +class MutableScopeConfig implements MutableScopeConfigInterface +{ + /** + * @var Config + */ + private $testAppConfig; + + /** + * @inheritdoc + */ + public function isSetFlag($path, $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null) + { + return $this->getTestAppConfig()->isSetFlag($path, $scopeType, $scopeCode); + } + + /** + * @inheritdoc + */ + public function getValue($path, $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null) + { + return $this->getTestAppConfig()->getValue($path, $scopeType, $scopeCode); + } + + /** + * @inheritdoc + */ + public function setValue( + $path, + $value, + $scopeType = \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT, + $scopeCode = null + ) { + $this->persistConfig($path, $value, $scopeType, $scopeCode); + return $this->getTestAppConfig()->setValue($path, $value, $scopeType, $scopeCode); + } + + /** + * Clean app config cache + * + * @param string|null $type + * @return void + */ + public function clean() + { + $this->getTestAppConfig()->clean(); + } + + /** + * Retrieve test app config instance + * + * @return \Magento\TestFramework\App\Config + */ + private function getTestAppConfig() + { + if (!$this->testAppConfig) { + $this->testAppConfig = ObjectManager::getInstance()->get(ScopeConfigInterface::class); + } + + return $this->testAppConfig; + } + + /** + * Persist config in database + * + * @param string $path + * @param string $value + * @param string $scopeType + * @param string|null $scopeCode + */ + private function persistConfig($path, $value, $scopeType, $scopeCode): void + { + $pathParts = explode('/', $path); + $store = ''; + if ($scopeType === \Magento\Store\Model\ScopeInterface::SCOPE_STORE) { + if ($scopeCode !== null) { + $store = ObjectManager::getInstance() + ->get(\Magento\Store\Api\StoreRepositoryInterface::class) + ->get($scopeCode) + ->getId(); + } else { + $store = ObjectManager::getInstance() + ->get(\Magento\Store\Model\StoreManagerInterface::class) + ->getStore() + ->getId(); + } + } + $configData = [ + 'section' => $pathParts[0], + 'website' => '', + 'store' => $store, + 'groups' => [ + $pathParts[1] => [ + 'fields' => [ + $pathParts[2] => [ + 'value' => $value + ] + ] + ] + ] + ]; + ObjectManager::getInstance() + ->get(\Magento\Config\Model\Config\Factory::class) + ->create(['data' => $configData]) + ->save(); + } +} diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php b/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php index 514d8e5344d5..bd26c1e640e9 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php @@ -7,10 +7,18 @@ */ namespace Magento\TestFramework\Bootstrap; +use Magento\TestFramework\Annotation\ConfigFixture; + +/** + * @inheritdoc + */ class WebapiDocBlock extends \Magento\TestFramework\Bootstrap\DocBlock { /** - * Get list of subscribers. In addition, register <b>magentoApiDataFixture</b> annotation processing. + * Get list of subscribers. + * + * In addition, register magentoApiDataFixture and magentoApiConfigFixture + * annotation processors * * @param \Magento\TestFramework\Application $application * @return array @@ -19,6 +27,7 @@ protected function _getSubscribers(\Magento\TestFramework\Application $applicati { $subscribers = parent::_getSubscribers($application); $subscribers[] = new \Magento\TestFramework\Annotation\ApiDataFixture($this->_fixturesBaseDir); + $subscribers[] = new ConfigFixture(); return $subscribers; } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductOnlyXLeftInStockTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductOnlyXLeftInStockTest.php index 3969c758f12d..3c18892df3c2 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductOnlyXLeftInStockTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductOnlyXLeftInStockTest.php @@ -42,7 +42,6 @@ public function testQueryProductOnlyXLeftInStockDisabled() */ public function testQueryProductOnlyXLeftInStockEnabled() { - $this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/167'); $productSku = 'simple'; $query = <<<QUERY diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductStockStatusTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductStockStatusTest.php index c5571a4a338c..a383e18b40ae 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductStockStatusTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductStockStatusTest.php @@ -55,7 +55,6 @@ public function testQueryProductStockStatusInStock() */ public function testQueryProductStockStatusOutOfStock() { - $this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/167'); $productSku = 'simple'; $query = <<<QUERY diff --git a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php index dcac794703a5..1ec0b3eac6fc 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php @@ -39,6 +39,11 @@ class ConfigFixture */ private $_storeConfigValues = []; + /** + * @var string + */ + protected $annotation = 'magentoConfigFixture'; + /** * Retrieve configuration node value * @@ -104,10 +109,10 @@ protected function _setConfigValue($configPath, $value, $storeCode = false) protected function _assignConfigData(\PHPUnit\Framework\TestCase $test) { $annotations = $test->getAnnotations(); - if (!isset($annotations['method']['magentoConfigFixture'])) { + if (!isset($annotations['method'][$this->annotation])) { return; } - foreach ($annotations['method']['magentoConfigFixture'] as $configPathAndValue) { + foreach ($annotations['method'][$this->annotation] as $configPathAndValue) { if (preg_match('/^.+?(?=_store\s)/', $configPathAndValue, $matches)) { /* Store-scoped config value */ $storeCode = $matches[0] != 'current' ? $matches[0] : null; diff --git a/dev/tests/integration/testsuite/Magento/SendFriend/Controller/SendmailTest.php b/dev/tests/integration/testsuite/Magento/SendFriend/Controller/SendmailTest.php index f5851a55d760..8dbe9468923f 100644 --- a/dev/tests/integration/testsuite/Magento/SendFriend/Controller/SendmailTest.php +++ b/dev/tests/integration/testsuite/Magento/SendFriend/Controller/SendmailTest.php @@ -26,7 +26,8 @@ class SendmailTest extends AbstractController * * @magentoDbIsolation enabled * @magentoAppIsolation enabled - * @magentoDataFixture Magento/SendFriend/_files/disable_allow_guest_config.php + * @magentoConfigFixture default/sendfriend/email/allow_guest 0 + * @magentoConfigFixture default/sendfriend/email/enabled 1 * @magentoDataFixture Magento/Customer/_files/customer.php * @magentoDataFixture Magento/Catalog/_files/products.php */ diff --git a/dev/tests/integration/testsuite/Magento/SendFriend/_files/disable_allow_guest_config.php b/dev/tests/integration/testsuite/Magento/SendFriend/_files/disable_allow_guest_config.php deleted file mode 100644 index 202a39613248..000000000000 --- a/dev/tests/integration/testsuite/Magento/SendFriend/_files/disable_allow_guest_config.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -use Magento\Framework\App\Config\Value; -use Magento\TestFramework\Helper\Bootstrap; - -/** @var Value $config */ -$config = Bootstrap::getObjectManager()->create(Value::class); -$config->setPath('sendfriend/email/enabled'); -$config->setScope('default'); -$config->setScopeId(0); -$config->setValue(1); -$config->save(); - -/** @var Value $config */ -$config = Bootstrap::getObjectManager()->create(Value::class); -$config->setPath('sendfriend/email/allow_guest'); -$config->setScope('default'); -$config->setScopeId(0); -$config->setValue(0); -$config->save(); diff --git a/dev/tests/integration/testsuite/Magento/SendFriend/_files/product_simple_rollback.php b/dev/tests/integration/testsuite/Magento/SendFriend/_files/product_simple_rollback.php deleted file mode 100644 index ed98732fc870..000000000000 --- a/dev/tests/integration/testsuite/Magento/SendFriend/_files/product_simple_rollback.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - -/** @var \Magento\Framework\Registry $registry */ -$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class); - -$registry->unregister('isSecureArea'); -$registry->register('isSecureArea', true); - -/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ -$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); - -try { - $product = $productRepository->get('simple', false, null, true); - $productRepository->delete($product); -} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { - //Product already removed -} - -$registry->unregister('isSecureArea'); -$registry->register('isSecureArea', false); From 6e350d1a703199ded6d872367a5668f57c9f92cb Mon Sep 17 00:00:00 2001 From: Aliaksei Yakimovich2 <aliaksei_yakimovich2@epam.com> Date: Fri, 14 Jun 2019 17:19:17 +0300 Subject: [PATCH 056/230] MC-17218: php bin/magento catalog:image:resize error if image is missing - Added integration test; --- .../Command/ImageResizeCommandTest.php | 64 +++++++++++++++++++ .../_files/product_with_missed_image.php | 59 +++++++++++++++++ .../product_with_missed_image_rollback.php | 9 +++ 3 files changed, 132 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/MediaStorage/Console/Command/ImageResizeCommandTest.php create mode 100644 dev/tests/integration/testsuite/Magento/MediaStorage/_files/product_with_missed_image.php create mode 100644 dev/tests/integration/testsuite/Magento/MediaStorage/_files/product_with_missed_image_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/MediaStorage/Console/Command/ImageResizeCommandTest.php b/dev/tests/integration/testsuite/Magento/MediaStorage/Console/Command/ImageResizeCommandTest.php new file mode 100644 index 000000000000..121288973ff0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/MediaStorage/Console/Command/ImageResizeCommandTest.php @@ -0,0 +1,64 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types = 1); + +namespace Magento\MediaStorage\Console\Command; + +use Symfony\Component\Console\Input\ArgvInput; +use Symfony\Component\Console\Output\ConsoleOutput; + +/** + * Integration testing for ImageResizeCommand class + */ +class ImageResizeCommandTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + + /** + * @var \Magento\MediaStorage\Console\Command\ImagesResizeCommand + */ + private $imageResizeCommand; + + /** + * @var ArgvInput + */ + private $input; + + /** + * @var ConsoleOutput + */ + private $output; + + /** + * @inheritDoc + */ + protected function setUp() + { + parent::setUp(); + + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->imageResizeCommand = $this->objectManager->create( + \Magento\MediaStorage\Console\Command\ImagesResizeCommand::class + ); + + $this->input = $this->objectManager->create(ArgvInput::class, ['argv' => ['catalog:image:resize']]); + $this->output = $this->objectManager->create(ConsoleOutput::class); + } + + /** + * Test that catalog:image:resize command executed successfully with missing image file + * + * @magentoDataFixture Magento/MediaStorage/_files/product_with_missed_image.php + */ + public function testRunResizeWithMissingFile() + { + $resultCode = $this->imageResizeCommand->run($this->input, $this->output); + $this->assertSame($resultCode, 0); + } +} diff --git a/dev/tests/integration/testsuite/Magento/MediaStorage/_files/product_with_missed_image.php b/dev/tests/integration/testsuite/Magento/MediaStorage/_files/product_with_missed_image.php new file mode 100644 index 000000000000..04f42b13caa8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/MediaStorage/_files/product_with_missed_image.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types = 1); + +use Magento\Framework\App\Filesystem\DirectoryList; + +require dirname(__DIR__, 2) . '/Catalog/_files/product_image.php'; +require dirname(__DIR__, 2) . '/Catalog/_files/product_simple.php'; + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); +$product = $productRepository->get('simple'); +$product->setStoreId(0) + ->setImage('/m/a/magento_image.jpg') + ->setSmallImage('/m/a/magento_image.jpg') + ->setThumbnail('/m/a/magento_image.jpg') + ->setData( + 'media_gallery', + [ + 'images' => [ + [ + 'file' => '/m/a/magento_image.jpg', + 'position' => 1, + 'label' => 'Image Alt Text', + 'disabled' => 0, + 'media_type' => 'image', + ], + ], + ] + )->save(); +$image = array_shift($product->getData('media_gallery')['images']); +$product = $productRepository->get('simple', false, 1, true); +$product->setData( + 'media_gallery', + [ + 'images' => [ + [ + 'value_id' => $image['value_id'], + 'file' => $image['file'], + 'disabled' => 1, + 'media_type' => 'image', + ], + ], + ] +); +$productRepository->save($product); + +$mediaDirectory = $objectManager->get(\Magento\Framework\Filesystem::class) + ->getDirectoryWrite(DirectoryList::MEDIA); + +$config = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( + \Magento\Catalog\Model\Product\Media\Config::class +); + +$mediaDirectory->delete($config->getBaseMediaPath() . '/m/a/magento_image.jpg'); diff --git a/dev/tests/integration/testsuite/Magento/MediaStorage/_files/product_with_missed_image_rollback.php b/dev/tests/integration/testsuite/Magento/MediaStorage/_files/product_with_missed_image_rollback.php new file mode 100644 index 000000000000..239a33116aa3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/MediaStorage/_files/product_with_missed_image_rollback.php @@ -0,0 +1,9 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types = 1); + +require dirname(__DIR__, 2) . '/Catalog/_files/product_image_rollback.php'; +require dirname(__DIR__, 2) . '/Catalog/_files/product_simple_rollback.php'; From ff7b120bbd67a92c2f890b2817b1b2d1972aacd7 Mon Sep 17 00:00:00 2001 From: natalia <natalia_marozava@epam.com> Date: Mon, 24 Jun 2019 12:11:41 +0300 Subject: [PATCH 057/230] MAGETWO-54438: Simple Product don't appear on Storefront after order cancelation with Bundle --- ...ontAssertProductStockStatusActionGroup.xml | 21 +++ .../Sales/Test/Mftf/Data/ProductData.xml | 70 +++++++++ ...erWithCheckMoneyOrderPaymentMethodTest.xml | 138 ++++++++++-------- 3 files changed, 170 insertions(+), 59 deletions(-) create mode 100644 app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/ProductData.xml diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusActionGroup.xml new file mode 100644 index 000000000000..04d37c2a9042 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="storefrontCheckProductStockStatus"> + <arguments> + <argument name="productUrlKey" type="string"/> + <argument name="productName" type="string"/> + </arguments> + <amOnPage url="{{StorefrontProductPage.url(productUrlKey)}}" stepKey="navigateToProductPage"/> + <waitForPageLoad stepKey="waitForProductPageLoad"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductName"/> + <see userInput="IN STOCK" stepKey="assertProductStockStatus"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Sales/Test/Mftf/Data/ProductData.xml new file mode 100644 index 000000000000..5f754ad99843 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/ProductData.xml @@ -0,0 +1,70 @@ +<?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="SimpleProductPrice10Qty1" type="product"> + <data key="sku" unique="suffix">simple-product_</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="visibility">4</data> + <data key="name" unique="suffix">SimpleProduct_</data> + <data key="price">10.00</data> + <data key="urlKey" unique="suffix">simple-product_</data> + <data key="status">1</data> + <requiredEntity type="product_extension_attribute">EavStock1</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="VirtualProductPrice10Qty1" type="product"> + <data key="sku" unique="suffix">virtual-product_</data> + <data key="type_id">virtual</data> + <data key="attribute_set_id">4</data> + <data key="name" unique="suffix">VirtualProduct_</data> + <data key="price">10.00</data> + <data key="weight">0</data> + <data key="status">1</data> + <requiredEntity type="product_extension_attribute">EavStock1</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> + <entity name="SimpleProduct2Price10Qty1" type="product"> + <data key="sku" unique="suffix">simple-product-2_</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="name" unique="suffix">SimpleProduct2_</data> + <data key="price">10.00</data> + <data key="visibility">4</data> + <data key="status">1</data> + <requiredEntity type="product_extension_attribute">EavStock1</requiredEntity> + </entity> + <entity name="SimpleProduct3Price10Qty1" type="product2"> + <data key="sku" unique="suffix">simple-product-3_</data> + <data key="type_id">simple</data> + <data key="attribute_set_id">4</data> + <data key="visibility">4</data> + <data key="name" unique="suffix">SimpleProduct3_</data> + <data key="price">10.00</data> + <data key="urlKey" unique="suffix">simple-product-3_</data> + <data key="status">1</data> + <requiredEntity type="product_extension_attribute">EavStock1</requiredEntity> + <requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity> + </entity> + <entity name="ConfigurableProductPrice10Qty1" type="product"> + <data key="sku" unique="suffix">configurable-product_</data> + <data key="type_id">configurable</data> + <data key="attribute_set_id">4</data> + <data key="visibility">4</data> + <data key="name" unique="suffix">ConfigurableProduct_</data> + <data key="urlKey" unique="suffix">configurable-product_</data> + <data key="price">10.00</data> + <data key="weight">2</data> + <data key="status">1</data> + <data key="quantity">1</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity> + </entity> +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml index 614946d7f8a8..232eaf566d8d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml @@ -18,34 +18,30 @@ <testCaseId value="MC-16066"/> <group value="mtf_migrated"/> </annotations> - <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - - <!--Set default flat rate shipping method settings--> + <!-- Set default flat rate shipping method settings --> + <comment userInput="Set default flat rate shipping method settings" stepKey="SetDefaultFlatRateShippingMethodSetting"/> <createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/> - - <!--Create simple customer--> + <!-- Create simple customer --> + <comment userInput="Create simple customer" stepKey="CreateSimpleCustomer"/> <createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/> - <!-- Create the category --> + <comment userInput="Create the category" stepKey="CreateTheCategory"/> <createData entity="ApiCategory" stepKey="createCategory"/> - <!-- Create Virtual Product --> - <createData entity="VirtualProduct" stepKey="virtualProduct"> - <field key="price">10.00</field> + <comment userInput="Create Virtual Product" stepKey="CreateVirtualProduct"/> + <createData entity="VirtualProductPrice10Qty1" stepKey="virtualProduct"> + <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Create Simple Product --> - <createData entity="ApiSimplePrice10Qty10" stepKey="simpleProduct"> + <comment userInput="Create Simple Product" stepKey="CreateSimpleProduct"/> + <createData entity="SimpleProductPrice10Qty1" stepKey="simpleProduct"> <requiredEntity createDataKey="createCategory"/> - <field key="price">10.00</field> - </createData> - - <!--Create Bundle product--> - <createData entity="SimpleProduct2" stepKey="simpleProduct1"> - <field key="price">10.00</field> </createData> + <!-- Create Bundle product --> + <comment userInput="Create Bundle Product" stepKey="CreateBundleProduct"/> + <createData entity="SimpleProduct2Price10Qty1" stepKey="simpleProduct1"/> <createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> @@ -58,42 +54,42 @@ <requiredEntity createDataKey="createBundleOption1_1"/> <requiredEntity createDataKey="simpleProduct1"/> </createData> - <!-- Create configurable product and add it to the category --> - <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <comment userInput="Create configurable product and add it to the category" stepKey="CreateConfigProduct"/> + <createData entity="ConfigurableProductPrice10Qty1" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> </createData> - <!-- Create an attribute with two options to be used in the first child product --> + <comment userInput="Create an attribute with two options to be used in the first child product" stepKey="CreateOptionsOfTheFirstChildProduct"/> <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> <requiredEntity createDataKey="createConfigProductAttribute"/> </createData> - <!-- Add the attribute we just created to default attribute set --> + <comment userInput="Add the attribute we just created to default attribute set" stepKey="AddAttributeToDefaultAttrSet"/> <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> <requiredEntity createDataKey="createConfigProductAttribute"/> </createData> - <!-- Get the option of the attribute we created --> + <comment userInput="Get the option of the attribute we created" stepKey="GetAttributeOption"/> <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> <requiredEntity createDataKey="createConfigProductAttribute"/> </getData> - <!-- Create a simple product and give it the attribute with option --> - <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> + <comment userInput="Create a simple product and give it the attribute with option" stepKey="CreateSimpleProductWithOptions"/> + <createData entity="SimpleProduct3Price10Qty1" stepKey="createConfigChildProduct1"> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption1"/> </createData> - <!-- Create the configurable product --> + <comment userInput="Create the configurable product" stepKey="CreateTheConfigurableProduct"/> <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption1"/> </createData> - <!-- Add simple product to the configurable product --> + <comment userInput="Add simple product to the configurable product" stepKey="AddSimpleProductToConfigurable"/> <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct1"/> @@ -113,103 +109,127 @@ <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <actionGroup ref="logout" stepKey="logout"/> </after> - - <!--Create new customer order--> + <!-- Create new customer order --> + <comment userInput="Create new customer order" stepKey="CreateNewCustomerOrder"/> <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> - - <!--Add bundle product to order and check product price in grid--> + <!-- Add bundle product to order and check product price in grid --> + <comment userInput="Add bundle product to order and check product price in grid" stepKey="AddBundleProductToOrder"/> <actionGroup ref="addBundleProductToOrder" stepKey="addBundleProductToOrder"> <argument name="product" value="$$createBundleProduct$$"/> <argument name="quantity" value="1"/> </actionGroup> - - <!--Add configurable product to order--> + <!-- Add configurable product to order --> + <comment userInput="Add configurable product to order" stepKey="AddConfigurableProductToOrder"/> <actionGroup ref="newAddConfigurableProductToOrder" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> - - <!--Add Simple product to order--> + <!-- Add Simple product to order --> + <comment userInput="Add Simple product to order" stepKey="AddSimpleProductToOrder"/> <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> - - <!--Add Virtual product to order--> + <!-- Add Virtual product to order --> + <comment userInput="Add Virtual product to order" stepKey="AddVirtualProductToOrder"/> <actionGroup ref="addSimpleProductToOrder" stepKey="addVirtualProductToTheOrder"> <argument name="product" value="$$virtualProduct$$"/> </actionGroup> - - <!--Select FlatRate shipping method--> + <!-- Select FlatRate shipping method --> + <comment userInput="Select FlatRate shipping method" stepKey="SelectFlatRateShippingMethod"/> <actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> - <!-- Submit order --> + <comment userInput="Submit order" stepKey="SubmitOrder"/> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> - - <!--Verify order information--> + <!-- Verify order information --> + <comment userInput="Verify order information" stepKey="VerifyOrderInformation"/> <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> - <!-- Cancel the Order --> + <comment userInput="Cancel the Order" stepKey="CancelTheOrder"/> <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> - <!-- Assert Simple Product Quantity in backend after order Canceled --> + <comment userInput="Assert Simple Product Quantity in backend after order Canceled" stepKey="AssertSimpleProductQuantityAfterOrderCanceled"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad"/> <seeInField selector="{{AdminProductFormSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeProductName"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="10" stepKey="seeProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1" stepKey="seeProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStockStatus"/> - - <!-- Assert Virtual Product Quantity in backend after order canceled--> + <!-- Assert Simple Product Stock Status in frontend after order canceled --> + <comment userInput="Assert Simple Product Stock Status in frontend after order Canceled" stepKey="AssertSimpleProductStockStatus"/> + <actionGroup ref="storefrontCheckProductStockStatus" stepKey="checkProductQtyOfSimpleProduct"> + <argument name="productUrlKey" value="$$simpleProduct.custom_attributes[url_key]$$"/> + <argument name="productName" value="$$simpleProduct.name$$"/> + </actionGroup> + <!-- Assert Virtual Product Quantity in backend after order canceled --> + <comment userInput="Assert Virtual Product Quantity in backend after order canceled" stepKey="AssertVirtualProductQuantityAfterOrderCanceled"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheVirtualProduct"> <argument name="productSku" value="$$virtualProduct.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad1"/> <seeInField selector="{{AdminProductFormSection.productName}}" userInput="$$virtualProduct.name$$" stepKey="seeVirtualProductName"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1000" stepKey="seeVirtualProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1" stepKey="seeVirtualProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeVirtualProductStockStatus"/> - - <!-- Assert Bundle Product quantity in backend after order canceled--> + <!-- Assert Virtual Product Stock Status in frontend after order canceled --> + <comment userInput="Assert Virtual Product Stock Status in frontend after order Canceled" stepKey="AssertVirtualProductStockStatus"/> + <actionGroup ref="storefrontCheckProductStockStatus" stepKey="checkProductQtyOfVirtualProduct"> + <argument name="productUrlKey" value="$$virtualProduct.custom_attributes[url_key]$$"/> + <argument name="productName" value="$$virtualProduct.name$$"/> + </actionGroup> + <!-- Assert Bundle Product Quantity in backend after order canceled --> + <comment userInput="Assert Bundle Product Quantity in backend after order canceled" stepKey="AssertBundleProductQuantityAfterOrderCanceled"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheBundleProduct"> <argument name="productSku" value="$$simpleProduct1.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad2"/> <seeInField selector="{{AdminProductFormSection.productName}}" userInput="$$simpleProduct1.name$$" stepKey="seeBundleProductName"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1000" stepKey="seeBundleProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1" stepKey="seeBundleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeBundleProductStockStatus"/> - - <!-- Assert Configurable Product quantity in backend after order canceled--> + <!-- Assert Bundle Product Stock Status in frontend after order canceled --> + <comment userInput="Assert Bundle Product Stock Status in frontend after order Canceled" stepKey="AssertBundleProductStockStatus"/> + <actionGroup ref="storefrontCheckProductStockStatus" stepKey="checkProductQtyOfBundleProduct"> + <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> + <argument name="productName" value="$$createBundleProduct.name$$"/> + </actionGroup> + <!-- Assert Configurable Product Quantity in backend after order canceled --> + <comment userInput="Assert Configurable Product quantity in backend after order canceled" stepKey="AssertConfigurableProductQuantityAfterOrderCanceled"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheConfigProduct"> <argument name="productSku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> <waitForElementVisible selector="{{AdminProductFormSection.productName}}" stepKey="waitForProductDetailsToLoad3"/> <seeInField selector="{{AdminProductFormSection.productName}}" userInput="$$createConfigChildProduct1.name$$" stepKey="seeConfigProductName"/> - <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1000" stepKey="seeConfigProductQuantity"/> + <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1" stepKey="seeConfigProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeConfigProductStockStatus"/> - + <!-- Assert Configurable Product Stock Status in frontend after order canceled --> + <comment userInput="Assert Configurable Product Stock Status in frontend after order Canceled" stepKey="AssertConfigurableProductStockStatus"/> + <actionGroup ref="storefrontCheckProductStockStatus" stepKey="checkProductQtyOfConfigProductInFrontend"> + <argument name="productUrlKey" value="$$createConfigProduct.custom_attributes[url_key]$$"/> + <argument name="productName" value="$$createConfigProduct.name$$"/> + </actionGroup> <!-- Open Order Index Page --> + <comment userInput="Open Order Index Page" stepKey="OpenOrderIndexPage"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForPageLoad5"/> - <!-- Filter order using orderId --> + <comment userInput="Filter order using orderId" stepKey="FilterOrderUsingOrderId"/> <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="$orderId" stepKey="seeOrderIdInGrid"/> <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="Canceled" stepKey="seeStatusInGrid"/> - - <!--Log in to Storefront as Customer --> + <!-- Log in to Storefront as Customer --> + <comment userInput="Log in to Storefront as Customer" stepKey="LogInAsCustomer"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> <argument name="Customer" value="$$simpleCustomer$$"/> </actionGroup> - <!-- Assert Order status in frontend order grid --> + <comment userInput="Assert Order status in frontend order grid " stepKey="AssertOrderStatusInFrontend"/> <click selector="{{StorefrontCustomerSidebarSection.sidebarCurrentTab('My Orders')}}" stepKey="clickOnMyOrders"/> <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> </test> -</tests> \ No newline at end of file +</tests> From 7429610351c380a894cba548f7628c28cb59d387 Mon Sep 17 00:00:00 2001 From: Dzmitry Tabusheu <dzmitry_tabusheu@epam.com> Date: Mon, 24 Jun 2019 17:09:19 +0300 Subject: [PATCH 058/230] MC-17387: Fatal error appears when adding bundle product to Cart from Wish list page - Added required blocks viewmodels --- .../wishlist_index_configure_type_bundle.xml | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml index f8a0d4a9a0b1..9b3259c0fee8 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml @@ -23,7 +23,11 @@ <block class="Magento\Wishlist\Block\Item\Configure" name="view.addto.wishlist.bundle" template="Magento_Wishlist::item/configure/addto/wishlist.phtml" /> <block class="Magento\Catalog\Block\Product\View\AddTo\Compare" name="view.addto.compare.bundle" after="view.addto.wishlist" - template="Magento_Catalog::product/view/addto/compare.phtml" /> + template="Magento_Catalog::product/view/addto/compare.phtml"> + <arguments> + <argument name="addToCompareViewModel" xsi:type="object">Magento\Catalog\ViewModel\Product\Checker\AddToCompareAvailability</argument> + </arguments> + </block> </block> </block> </referenceBlock> @@ -33,10 +37,22 @@ <container name="product.info.bundle.options.top" as="product_info_bundle_options_top"> <block class="Magento\Catalog\Block\Product\View" name="bundle.back.button" as="backButton" before="-" template="Magento_Bundle::catalog/product/view/backbutton.phtml"/> </container> - <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Select" name="product.info.bundle.options.select" as="select"/> + <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Select" name="product.info.bundle.options.select" as="select"> + <arguments> + <argument name="tier_price_renderer" xsi:type="object">\Magento\Bundle\Block\DataProviders\OptionPriceRenderer</argument> + </arguments> + </block> <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Multi" name="product.info.bundle.options.multi" as="multi"/> - <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Radio" name="product.info.bundle.options.radio" as="radio"/> - <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox" name="product.info.bundle.options.checkbox" as="checkbox"/> + <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Radio" name="product.info.bundle.options.radio" as="radio"> + <arguments> + <argument name="tier_price_renderer" xsi:type="object">\Magento\Bundle\Block\DataProviders\OptionPriceRenderer</argument> + </arguments> + </block> + <block class="Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox" name="product.info.bundle.options.checkbox" as="checkbox"> + <arguments> + <argument name="tier_price_renderer" xsi:type="object">\Magento\Bundle\Block\DataProviders\OptionPriceRenderer</argument> + </arguments> + </block> </block> </referenceBlock> <move element="product.price.tier" destination="product.info.options.wrapper.bottom" before="-" /> From 03e03131100041789a2c58891d4e94b6a222addc Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Mon, 24 Jun 2019 13:12:00 -0500 Subject: [PATCH 059/230] Test improvements: - removed duplicate action groups - added test case id - updated annotations - issue magento/magento-functional-tests-migration/381 - pull request magento/magento-functional-tests-migration/699 --- ...ssertAdminLoginErrorMessageActionGroup.xml | 20 ------- .../AssertMessageOnAdminActionGroup.xml | 18 ------ .../AdminFillIntegrationFormActionGroup.xml | 25 ++++++++ ...llIntegrationRequiredFieldsActionGroup.xml | 19 ------ .../AdminSaveIntegrationActionGroup.xml | 4 +- .../Test/Mftf/Data/IntegrationData.xml | 6 +- .../Mftf/Page/AdminNewIntegrationPage.xml | 2 +- ...xml => AdminNewIntegrationFormSection.xml} | 8 ++- ...dminUserWhenCreatingNewIntegrationTest.xml | 60 +++++++++++++------ 9 files changed, 80 insertions(+), 82 deletions(-) delete mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminLoginErrorMessageActionGroup.xml delete mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnAdminActionGroup.xml create mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationFormActionGroup.xml delete mode 100644 app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationRequiredFieldsActionGroup.xml rename app/code/Magento/Integration/Test/Mftf/Section/{AdminNewIntegrationSection.xml => AdminNewIntegrationFormSection.xml} (50%) diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminLoginErrorMessageActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminLoginErrorMessageActionGroup.xml deleted file mode 100644 index 6ad3b7cfb912..000000000000 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminLoginErrorMessageActionGroup.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertAdminLoginErrorMessageActionGroup"> - <arguments> - <argument name="message" type="string" defaultValue="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later"/> - <argument name="messageType" type="string" defaultValue="error" /> - </arguments> - <waitForPageLoad stepKey="waitForPageReload"/> - <see selector="{{AdminLoginMessagesSection.messageByType(messageType)}}" userInput="{{message}}" - stepKey="seeLoginAdminError"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnAdminActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnAdminActionGroup.xml deleted file mode 100644 index 414a9b56b8b0..000000000000 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnAdminActionGroup.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertMessageOnAdminActionGroup"> - <arguments> - <argument name="message" type="string" defaultValue="The password entered for the current user is invalid. Verify the password and try again." /> - <argument name="messageType" type="string" defaultValue="error" /> - </arguments> - <see userInput="{{message}}" selector="{{AdminMessagesSection.messageByType(messageType)}}" stepKey="verifyMessage" /> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationFormActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationFormActionGroup.xml new file mode 100644 index 000000000000..85e4efb49595 --- /dev/null +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationFormActionGroup.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillIntegrationFormActionGroup"> + <arguments> + <argument name="integration" type="entity" /> + <argument name="currentAdminPassword" type="string" defaultValue="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" /> + </arguments> + + <fillField selector="{{AdminNewIntegrationFormSection.integrationName}}" userInput="{{integration.name}}" stepKey="fillIntegrationName"/> + <fillField selector="{{AdminNewIntegrationFormSection.currentPassword}}" userInput="{{currentAdminPassword}}" stepKey="fillCurrentUserPassword"/> + + <click selector="{{AdminNewIntegrationFormSection.apiTab}}" stepKey="clickToOpenApiTab"/> + <waitForPageLoad stepKey="waitForApiTab" /> + + <selectOption userInput="{{integration.resourceAccess}}" selector="{{AdminNewIntegrationFormSection.resourceAccess}}" stepKey="selectResourceAccess" /> + <performOn stepKey="checkNeededResources" selector="{{AdminNewIntegrationFormSection.resourceTree}}" function="function($I,$apiResources={{integration.resources}}){foreach($apiResources as $apiResource){$I->conditionalClick('//li[@data-id=\'' . $apiResource . '\']//*[@class=\'jstree-checkbox\']','//li[@data-id=\'' . $apiResource . '\' and contains(@class, \'jstree-checked\')]',false);}}" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationRequiredFieldsActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationRequiredFieldsActionGroup.xml deleted file mode 100644 index d1dc2996ee2e..000000000000 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminFillIntegrationRequiredFieldsActionGroup.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminFillIntegrationRequiredFieldsActionGroup"> - <arguments> - <argument name="integrationName" type="string" defaultValue="{{IntegrationData.name}}"/> - <argument name="currentAdminPassword" type="string" defaultValue="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" /> - </arguments> - <fillField selector="{{AdminNewIntegrationSection.integrationName}}" userInput="{{integrationName}}" stepKey="fillIntegrationName"/> - <fillField selector="{{AdminNewIntegrationSection.currentPassword}}" userInput="{{currentAdminPassword}}" stepKey="fillCurrentUserPassword"/> - <scrollToTopOfPage stepKey="ScrollToTopOfPage"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSaveIntegrationActionGroup.xml b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSaveIntegrationActionGroup.xml index 5169fd947636..e6e3f3397d4b 100644 --- a/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSaveIntegrationActionGroup.xml +++ b/app/code/Magento/Integration/Test/Mftf/ActionGroup/AdminSaveIntegrationActionGroup.xml @@ -7,8 +7,8 @@ --> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminSaveIntegrationActionGroup"> - <click selector="{{AdminNewIntegrationSection.save}}" stepKey="saveIntegration"/> + <actionGroup name="AdminClickSaveButtonIntegrationFormActionGroup"> + <click selector="{{AdminNewIntegrationFormSection.save}}" stepKey="saveIntegration"/> <waitForPageLoad stepKey="waitForSaveResultLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Integration/Test/Mftf/Data/IntegrationData.xml b/app/code/Magento/Integration/Test/Mftf/Data/IntegrationData.xml index 3e7b6c49e2bc..21fefcdf0b26 100644 --- a/app/code/Magento/Integration/Test/Mftf/Data/IntegrationData.xml +++ b/app/code/Magento/Integration/Test/Mftf/Data/IntegrationData.xml @@ -8,7 +8,9 @@ <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> - <entity name="IntegrationData" type="admin"> - <data key="name" unique="prefix">_Integration</data> + <entity name="defaultIntegrationData"> + <data key="name" unique="prefix"> Integration</data> + <data key="resourceAccess">All</data> + <data key="resources">[]</data> </entity> </entities> diff --git a/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml b/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml index 7b46029aa1ee..a3511887b2cd 100644 --- a/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml +++ b/app/code/Magento/Integration/Test/Mftf/Page/AdminNewIntegrationPage.xml @@ -9,6 +9,6 @@ <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> <page name="AdminNewIntegrationPage" url="admin/integration/new/" area="admin" module="Magento_Integration"> - <section name="AdminNewIntegrationSection"/> + <section name="AdminNewIntegrationFormSection"/> </page> </pages> diff --git a/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml b/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationFormSection.xml similarity index 50% rename from app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml rename to app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationFormSection.xml index 89588f777509..edb9e5dd5eb5 100644 --- a/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationSection.xml +++ b/app/code/Magento/Integration/Test/Mftf/Section/AdminNewIntegrationFormSection.xml @@ -8,9 +8,15 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="AdminNewIntegrationSection"> + <section name="AdminNewIntegrationFormSection"> + <element name="integrationInfoTab" type="block" selector="#integration_edit_tabs #integration_edit_tabs_info_section" /> <element name="integrationName" type="input" selector="#edit_form input[name='name']"/> <element name="currentPassword" type="input" selector="#edit_form input[name='current_password']"/> + + <element name="apiTab" type="block" selector="#integration_edit_tabs #integration_edit_tabs_api_section" /> + <element name="resourceAccess" type="select" selector="[data-ui-id='integration-edit-tabs-tab-content-api-section'] [name='all_resources']" /> + <element name="resourceTree" type="block" selector="[data-ui-id='integration-edit-tabs-tab-content-api-section'] [data-role='resource-tree']"/> + <element name="save" type="button" selector="#save-split-button-button"/> </section> </sections> diff --git a/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml index ce101c09dfee..03681a175328 100644 --- a/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml +++ b/app/code/Magento/Security/Test/Mftf/Test/AdminLockAdminUserWhenCreatingNewIntegrationTest.xml @@ -15,6 +15,7 @@ <title value="Lock admin user when creating new integration"/> <description value="Runs Lock admin user when creating new integration test."/> <severity value="MAJOR"/> + <testCaseId value="MC-14382" /> <group value="security"/> <group value="mtf_migrated"/> </annotations> @@ -30,47 +31,68 @@ <actionGroup ref="AdminOpenNewIntegrationPageActionGroup" stepKey="openNewIntegrationPage"/> <!-- Perform add new admin user 6 specified number of times. "The password entered for the current user is invalid. Verify the password and try again." appears after each attempt.--> - <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldFirstAttempt"> + <actionGroup ref="AdminFillIntegrationFormActionGroup" stepKey="fillFieldFirstAttempt"> + <argument name="integration" value="defaultIntegrationData" /> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationFirstAttempt"/> - <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkFirstSaveIntegrationError"/> + <actionGroup ref="AdminClickSaveButtonIntegrationFormActionGroup" stepKey="saveIntegrationFirstAttempt"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkFirstSaveIntegrationError"> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="messageType" value="error" /> + </actionGroup> - <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldSecondAttempt"> + <actionGroup ref="AdminFillIntegrationFormActionGroup" stepKey="fillFieldSecondAttempt"> + <argument name="integration" value="defaultIntegrationData" /> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationSecondAttempt"/> - <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkSecondSaveIntegrationError"/> + <actionGroup ref="AdminClickSaveButtonIntegrationFormActionGroup" stepKey="saveIntegrationSecondAttempt"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkSecondSaveIntegrationError"> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="messageType" value="error" /> + </actionGroup> - <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldThirdAttempt"> + <actionGroup ref="AdminFillIntegrationFormActionGroup" stepKey="fillFieldThirdAttempt"> + <argument name="integration" value="defaultIntegrationData" /> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationThirdAttempt"/> - <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkThirdSaveIntegrationError"/> + <actionGroup ref="AdminClickSaveButtonIntegrationFormActionGroup" stepKey="saveIntegrationThirdAttempt"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkThirdSaveIntegrationError"> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="messageType" value="error" /> + </actionGroup> - <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldFourthAttempt"> + <actionGroup ref="AdminFillIntegrationFormActionGroup" stepKey="fillFieldFourthAttempt"> + <argument name="integration" value="defaultIntegrationData" /> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationFourthAttempt"/> - <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkFourthSaveIntegrationError"/> + <actionGroup ref="AdminClickSaveButtonIntegrationFormActionGroup" stepKey="saveIntegrationFourthAttempt"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkFourthSaveIntegrationError"> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="messageType" value="error" /> + </actionGroup> - <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldFifthAttempt"> + <actionGroup ref="AdminFillIntegrationFormActionGroup" stepKey="fillFieldFifthAttempt"> + <argument name="integration" value="defaultIntegrationData" /> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationFifthAttempt"/> - <actionGroup ref="AssertMessageOnAdminActionGroup" stepKey="checkFifthSaveIntegrationError"/> + <actionGroup ref="AdminClickSaveButtonIntegrationFormActionGroup" stepKey="saveIntegrationFifthAttempt"/> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="checkFifthSaveIntegrationError"> + <argument name="message" value="The password entered for the current user is invalid. Verify the password and try again." /> + <argument name="messageType" value="error" /> + </actionGroup> <!-- Last invalid current password save integration attempt and check logout error --> - <actionGroup ref="AdminFillIntegrationRequiredFieldsActionGroup" stepKey="fillFieldLastAttempt"> + <actionGroup ref="AdminFillIntegrationFormActionGroup" stepKey="fillFieldLastAttempt"> + <argument name="integration" value="defaultIntegrationData" /> <argument name="currentAdminPassword" value="{{_ENV.MAGENTO_ADMIN_PASSWORD}}INVALID" /> </actionGroup> - <actionGroup ref="AdminSaveIntegrationActionGroup" stepKey="saveIntegrationLastAttempt"/> - <actionGroup ref="AssertAdminLoginErrorMessageActionGroup" stepKey="checkFifthError"> + <actionGroup ref="AdminClickSaveButtonIntegrationFormActionGroup" stepKey="saveIntegrationLastAttempt"/> + <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkFifthError"> <argument name="message" value="Your account is temporarily disabled. Please try again later."/> </actionGroup> <!-- Try to login as admin and check error --> <actionGroup ref="LoginAsAdmin" stepKey="loginAsLockedAdmin"/> - <actionGroup ref="AssertAdminLoginErrorMessageActionGroup" stepKey="checkLoginError"/> + <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="checkLoginError" /> </test> </tests> From 1e8dc58cbf1fdd9d4ae235f678973791841b2252 Mon Sep 17 00:00:00 2001 From: Aliaksei_Manenak <Aliaksei_Manenak@epam.com> Date: Mon, 24 Jun 2019 17:40:54 +0300 Subject: [PATCH 060/230] MAGETWO-92712: Sorting does not work for \Magento\Catalog\Model\CategoryList::getList - Use collection->getData() to get right id order --- .../Magento/Catalog/Model/CategoryList.php | 12 ++++++---- .../Test/Unit/Model/CategoryListTest.php | 18 ++++++++++----- .../Magento/Catalog/Api/CategoryListTest.php | 22 +++++++++++-------- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/Catalog/Model/CategoryList.php b/app/code/Magento/Catalog/Model/CategoryList.php index cab8e013d9ba..cc8920203526 100644 --- a/app/code/Magento/Catalog/Model/CategoryList.php +++ b/app/code/Magento/Catalog/Model/CategoryList.php @@ -3,6 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Catalog\Model; use Magento\Catalog\Api\CategoryListInterface; @@ -50,7 +53,7 @@ class CategoryList implements CategoryListInterface * @param JoinProcessorInterface $extensionAttributesJoinProcessor * @param CategorySearchResultsInterfaceFactory $categorySearchResultsFactory * @param CategoryRepositoryInterface $categoryRepository - * @param CollectionProcessorInterface $collectionProcessor + * @param CollectionProcessorInterface|null $collectionProcessor */ public function __construct( CollectionFactory $categoryCollectionFactory, @@ -74,12 +77,13 @@ public function getList(SearchCriteriaInterface $searchCriteria) /** @var Collection $collection */ $collection = $this->categoryCollectionFactory->create(); $this->extensionAttributesJoinProcessor->process($collection); - $this->collectionProcessor->process($searchCriteria, $collection); $items = []; - foreach ($collection->getAllIds() as $id) { - $items[] = $this->categoryRepository->get($id); + foreach ($collection->getData() as $categoryData) { + $items[] = $this->categoryRepository->get( + $categoryData[$collection->getEntity()->getIdFieldName()] + ); } /** @var CategorySearchResultsInterface $searchResult */ diff --git a/app/code/Magento/Catalog/Test/Unit/Model/CategoryListTest.php b/app/code/Magento/Catalog/Test/Unit/Model/CategoryListTest.php index b8b76524099f..c7821f06985b 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/CategoryListTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/CategoryListTest.php @@ -3,6 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Catalog\Test\Unit\Model; use Magento\Catalog\Api\CategoryRepositoryInterface; @@ -52,6 +55,9 @@ class CategoryListTest extends \PHPUnit\Framework\TestCase */ private $collectionProcessorMock; + /** + * @inheritdoc + */ protected function setUp() { $this->categoryCollectionFactory = $this->getMockBuilder(CollectionFactory::class) @@ -93,7 +99,12 @@ public function testGetList() $collection = $this->getMockBuilder(Collection::class)->disableOriginalConstructor()->getMock(); $collection->expects($this->once())->method('getSize')->willReturn($totalCount); - $collection->expects($this->once())->method('getAllIds')->willReturn([$categoryIdFirst, $categoryIdSecond]); + $collection->expects($this->once())->method('getData')->willReturn( + [['entity_id' => $categoryIdFirst], ['entity_id' => $categoryIdSecond]] + ); + $collection->expects($this->any())->method('getEntity')->willReturn( + new \Magento\Framework\DataObject(['id_field_name' => 'entity_id']) + ); $this->collectionProcessorMock->expects($this->once()) ->method('process') @@ -106,10 +117,7 @@ public function testGetList() $this->categoryRepository->expects($this->exactly(2)) ->method('get') - ->willReturnMap([ - [$categoryIdFirst, $categoryFirst], - [$categoryIdSecond, $categorySecond], - ]) + ->willReturnMap([[$categoryIdFirst, $categoryFirst], [$categoryIdSecond, $categorySecond]]) ->willReturn($categoryFirst); $this->categorySearchResultsFactory->expects($this->once())->method('create')->willReturn($searchResult); diff --git a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryListTest.php b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryListTest.php index 4160f8371890..d0cd93b3ccd9 100644 --- a/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryListTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/CategoryListTest.php @@ -3,11 +3,17 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Catalog\Api; use Magento\Framework\Webapi\Rest\Request; use Magento\TestFramework\TestCase\WebapiAbstract; +/** + * Checks the categories/list api + */ class CategoryListTest extends WebapiAbstract { const RESOURCE_PATH = '/V1/categories/list'; @@ -35,14 +41,11 @@ public function testGetList() ], ], ], + ], + 'sort_orders' => [ [ - 'filters' => [ - [ - 'field' => 'level', - 'value' => 2, - 'condition_type' => 'eq', - ], - ], + 'field' => 'name', + 'direction' => 'DESC', ], ], 'current_page' => 1, @@ -69,9 +72,10 @@ public function testGetList() $this->assertEquals($searchCriteria['searchCriteria'], $response['search_criteria']); $this->assertTrue($response['total_count'] > 0); - $this->assertTrue(count($response['items']) > 0); + $this->assertTrue(count($response['items']) === 2); $this->assertNotNull($response['items'][0]['name']); - $this->assertEquals('Category 1', $response['items'][0]['name']); + $this->assertEquals('Category 1.1', $response['items'][0]['name']); + $this->assertEquals('Category 1', $response['items'][1]['name']); } } From 3a818b218434eb8dd4961a0a8b8b20013c593c14 Mon Sep 17 00:00:00 2001 From: Aliaksei Yakimovich2 <aliaksei_yakimovich2@epam.com> Date: Tue, 25 Jun 2019 14:26:37 +0300 Subject: [PATCH 061/230] MC-17218: php bin/magento catalog:image:resize error if image is missing - Fixed integration test; --- .../Console/Command/ImageResizeCommandTest.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/MediaStorage/Console/Command/ImageResizeCommandTest.php b/dev/tests/integration/testsuite/Magento/MediaStorage/Console/Command/ImageResizeCommandTest.php index 2647fcca03b8..c766a175c4ef 100644 --- a/dev/tests/integration/testsuite/Magento/MediaStorage/Console/Command/ImageResizeCommandTest.php +++ b/dev/tests/integration/testsuite/Magento/MediaStorage/Console/Command/ImageResizeCommandTest.php @@ -130,13 +130,6 @@ public function testExecuteWithZeroByteImage() $this->tester->execute([]); $this->assertContains('Wrong file', $this->tester->getDisplay()); - } - - /** - * @inheritDoc - */ - public function tearDown() - { $this->mediaDirectory->getDriver()->deleteFile($this->mediaDirectory->getAbsolutePath($this->fileName)); } } From 793b420c22fb561ae23a86b969f1c3c9a8cad4cd Mon Sep 17 00:00:00 2001 From: Yuliya Labudova <Yuliya_Labudova@epam.com> Date: Wed, 26 Jun 2019 14:00:25 +0300 Subject: [PATCH 062/230] MC-15524: Unwanted Created/Last Updated fieltes are being displayed. - Fix filter format data. --- .../Ui/Component/Listing/Columns/Date.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Ui/Component/Listing/Columns/Date.php b/app/code/Magento/Ui/Component/Listing/Columns/Date.php index ad876b66b603..f376bae71127 100644 --- a/app/code/Magento/Ui/Component/Listing/Columns/Date.php +++ b/app/code/Magento/Ui/Component/Listing/Columns/Date.php @@ -55,17 +55,19 @@ public function __construct( public function prepare() { $config = $this->getData('config'); - $config['filter'] = [ - 'filterType' => 'dateRange', - 'templates' => [ - 'date' => [ - 'options' => [ - 'dateFormat' => $this->timezone->getDateFormatWithLongYear() + if (isset($config['filter'])) { + $config['filter'] = [ + 'filterType' => 'dateRange', + 'templates' => [ + 'date' => [ + 'options' => [ + 'dateFormat' => $config['dateFormat'] ?? $this->timezone->getDateFormatWithLongYear() + ] ] ] - ] - ]; - $this->setData('config', $config); + ]; + $this->setData('config', $config); + } parent::prepare(); } From 88a26ebaa40f177a33104c9027cc24879d246c03 Mon Sep 17 00:00:00 2001 From: Serhii Voloshkov <serhii.voloshkov@transoftgroup.com> Date: Wed, 26 Jun 2019 16:29:41 +0300 Subject: [PATCH 063/230] MAGETWO-99312: Wishlist name cannot be edited --- .../Mftf/Section/StorefrontMessagesSection.xml | 0 .../AdminCustomerWishlistConfigurationPage.xml | 14 ++++++++++++++ .../Test/Mftf/Section/WishlistGeneralSection.xml | 15 +++++++++++++++ 3 files changed, 29 insertions(+) rename app/code/Magento/{Catalog => Ui}/Test/Mftf/Section/StorefrontMessagesSection.xml (100%) create mode 100644 app/code/Magento/Wishlist/Test/Mftf/Page/AdminCustomerWishlistConfigurationPage.xml create mode 100644 app/code/Magento/Wishlist/Test/Mftf/Section/WishlistGeneralSection.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontMessagesSection.xml b/app/code/Magento/Ui/Test/Mftf/Section/StorefrontMessagesSection.xml similarity index 100% rename from app/code/Magento/Catalog/Test/Mftf/Section/StorefrontMessagesSection.xml rename to app/code/Magento/Ui/Test/Mftf/Section/StorefrontMessagesSection.xml diff --git a/app/code/Magento/Wishlist/Test/Mftf/Page/AdminCustomerWishlistConfigurationPage.xml b/app/code/Magento/Wishlist/Test/Mftf/Page/AdminCustomerWishlistConfigurationPage.xml new file mode 100644 index 000000000000..3d19fe4cb2c2 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Page/AdminCustomerWishlistConfigurationPage.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminCustomerWishlistConfigurationPage" url="admin/system_config/edit/section/wishlist/" area="admin" module="Magento_Wishlist"> + <section name="WishlistGeneralSection"/> + </page> +</pages> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Section/WishlistGeneralSection.xml b/app/code/Magento/Wishlist/Test/Mftf/Section/WishlistGeneralSection.xml new file mode 100644 index 000000000000..c355255aa549 --- /dev/null +++ b/app/code/Magento/Wishlist/Test/Mftf/Section/WishlistGeneralSection.xml @@ -0,0 +1,15 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="WishlistGeneralSection"> + <element name="GeneralOptionsTab" type="button" selector="#wishlist_general-head"/> + <element name="CheckIfGeneralOptionsTabExpand" type="button" selector="#wishlist_general-head:not(.open)"/> + </section> +</sections> From 23ecf93961fe766e0e952f359932cfaaf882d2ea Mon Sep 17 00:00:00 2001 From: Ani Tumanyan <ani_tumanyan@epam.com> Date: Fri, 28 Jun 2019 20:00:23 +0400 Subject: [PATCH 064/230] MC-17387: Fatal error appears when adding bundle product to Cart from Wish list page - Added automated test script --- ...undleProductToCartFromWishListPageTest.xml | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml new file mode 100644 index 000000000000..76a2c4c739e0 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml @@ -0,0 +1,83 @@ +<?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="AdminAddBundleProductToCartFromWishListPageTest"> + <annotations> + <features value="Catalog"/> + <title value="Add bundle product to Cart from Wish list page"/> + <description value="Add bundle product to Cart from Wish list page"/> + <severity value="MAJOR"/> + <testCaseId value="MC-17782"/> + <useCaseId value="MC-17387"/> + <group value="catalog"/> + </annotations> + <before> + <!-- Login as Admin --> + <comment userInput="Login as Admin" stepKey="commentLoginAsAdmin"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <!-- Create customer on Storefront and bundle product --> + <comment userInput="Create customer on Storefront and bundle product" stepKey="commentCreateData"/> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + <createData entity="CustomerEntityOne" stepKey="createCustomerViaTheStorefront"/> + <createData entity="_defaultProduct" stepKey="createSimpleProduct1"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="_defaultProduct" stepKey="createSimpleProduct2"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="ApiBundleProductPriceViewRange" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <!-- Create Attribute --> + <comment userInput="Create Attribute" stepKey="commentCreateAttribute"/> + <createData entity="DropDownBundleOption" stepKey="bundleOption"> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="ApiBundleLink" stepKey="createBundleLink1"> + <requiredEntity createDataKey="createProduct"/> + <requiredEntity createDataKey="bundleOption"/> + <requiredEntity createDataKey="createSimpleProduct1"/> + </createData> + <createData entity="ApiBundleLink" stepKey="createBundleLink2"> + <requiredEntity createDataKey="createProduct"/> + <requiredEntity createDataKey="bundleOption"/> + <requiredEntity createDataKey="createSimpleProduct2"/> + </createData> + <amOnPage url="{{AdminProductEditPage.url($$createProduct.id$$)}}" stepKey="goToProductEditPage"/> + <actionGroup ref="saveProductForm" stepKey="saveProduct"/> + </before> + <after> + <!-- Delete created data --> + <comment userInput="Delete created data" stepKey="commentDeleteCreatedData"/> + <deleteData createDataKey="createCustomerViaTheStorefront" stepKey="deleteCustomerViaTheStorefront"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct" /> + <!-- Log out --> + <comment userInput="Log out" stepKey="commentLogOut"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <!-- Login to the Storefront as created customer --> + <comment userInput="Login to the Storefront as created customer" stepKey="commentLoginAsCustomer"/> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$$createCustomerViaTheStorefront$$"/> + </actionGroup> + <!-- Add product to Wish List --> + <comment userInput="Add product to Wish List" stepKey="commentAddProductToWishList"/> + <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="amOnBundleProductPage"/> + <waitForPageLoad stepKey="waitForProductPage"/> + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addToWishlistProduct"> + <argument name="productVar" value="$$createProduct$$"/> + </actionGroup> + <moveMouseOver selector="{{StorefrontCategoryProductSection.ProductInfoByName($$createProduct.name$$)}}" stepKey="moveMouseOverProduct" /> + <click selector="{{StorefrontCategoryProductSection.ProductAddToCartByName($$createProduct.name$$)}}" stepKey="clickAddToCart" /> + <waitForPageLoad stepKey="waitForProductBundlePage"/> + <!-- See error message --> + <comment userInput="See error message" stepKey="commentSeeErrorMessage"/> + <see userInput=" Please specify product option(s)." stepKey="seeErrorMessage"/> + </test> +</tests> From b38e9ccf5f8d43950c20efdc46d642d55086bd11 Mon Sep 17 00:00:00 2001 From: natalia <natalia_marozava@epam.com> Date: Tue, 2 Jul 2019 09:39:28 +0300 Subject: [PATCH 065/230] MAGETWO-54438: Simple Product don't appear on Storefront after order cancelation with Bundle - Changed actionGroup name - Added actionGroup argument - Changed comment stepKeys --- ...ontAssertProductStockStatusActionGroup.xml | 6 +- ...erWithCheckMoneyOrderPaymentMethodTest.xml | 76 +++++++++---------- 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusActionGroup.xml b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusActionGroup.xml index 04d37c2a9042..30fddba4241b 100644 --- a/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusActionGroup.xml +++ b/app/code/Magento/CatalogInventory/Test/Mftf/ActionGroup/StorefrontAssertProductStockStatusActionGroup.xml @@ -8,14 +8,16 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="storefrontCheckProductStockStatus"> + <actionGroup name="StorefrontCheckProductStockStatus"> <arguments> <argument name="productUrlKey" type="string"/> <argument name="productName" type="string"/> + <argument name="stockStatus" type="string" defaultValue="IN STOCK"/> </arguments> <amOnPage url="{{StorefrontProductPage.url(productUrlKey)}}" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productName}}" stepKey="seeProductName"/> - <see userInput="IN STOCK" stepKey="assertProductStockStatus"/> + <see userInput="{{stockStatus}}" stepKey="assertProductStockStatus"/> </actionGroup> </actionGroups> + \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml index 232eaf566d8d..116b8e7d6ca7 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCheckMoneyOrderPaymentMethodTest.xml @@ -21,26 +21,26 @@ <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> <!-- Set default flat rate shipping method settings --> - <comment userInput="Set default flat rate shipping method settings" stepKey="SetDefaultFlatRateShippingMethodSetting"/> + <comment userInput="Set default flat rate shipping method settings" stepKey="setDefaultFlatRateShippingMethodComment"/> <createData entity="FlatRateShippingMethodDefault" stepKey="setDefaultFlatRateShippingMethod"/> <!-- Create simple customer --> - <comment userInput="Create simple customer" stepKey="CreateSimpleCustomer"/> + <comment userInput="Create simple customer" stepKey="createSimpleCustomerComment"/> <createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/> <!-- Create the category --> - <comment userInput="Create the category" stepKey="CreateTheCategory"/> + <comment userInput="Create the category" stepKey="createCategoryComment"/> <createData entity="ApiCategory" stepKey="createCategory"/> <!-- Create Virtual Product --> - <comment userInput="Create Virtual Product" stepKey="CreateVirtualProduct"/> + <comment userInput="Create Virtual Product" stepKey="createVirtualProductComment"/> <createData entity="VirtualProductPrice10Qty1" stepKey="virtualProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <!-- Create Simple Product --> - <comment userInput="Create Simple Product" stepKey="CreateSimpleProduct"/> + <comment userInput="Create Simple Product" stepKey="createSimpleProductComment"/> <createData entity="SimpleProductPrice10Qty1" stepKey="simpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <!-- Create Bundle product --> - <comment userInput="Create Bundle Product" stepKey="CreateBundleProduct"/> + <comment userInput="Create Bundle Product" stepKey="createBundleProductComment"/> <createData entity="SimpleProduct2Price10Qty1" stepKey="simpleProduct1"/> <createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct"> <requiredEntity createDataKey="createCategory"/> @@ -55,41 +55,41 @@ <requiredEntity createDataKey="simpleProduct1"/> </createData> <!-- Create configurable product and add it to the category --> - <comment userInput="Create configurable product and add it to the category" stepKey="CreateConfigProduct"/> + <comment userInput="Create configurable product and add it to the category" stepKey="createConfigProductComment"/> <createData entity="ConfigurableProductPrice10Qty1" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <!-- Create an attribute with two options to be used in the first child product --> - <comment userInput="Create an attribute with two options to be used in the first child product" stepKey="CreateOptionsOfTheFirstChildProduct"/> + <comment userInput="Create an attribute with two options to be used in the first child product" stepKey="createOptionsOfTheFirstChildProductComment"/> <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> <requiredEntity createDataKey="createConfigProductAttribute"/> </createData> <!-- Add the attribute we just created to default attribute set --> - <comment userInput="Add the attribute we just created to default attribute set" stepKey="AddAttributeToDefaultAttrSet"/> + <comment userInput="Add the attribute we just created to default attribute set" stepKey="addAttributeToDefaultAttrSetComment"/> <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> <requiredEntity createDataKey="createConfigProductAttribute"/> </createData> <!-- Get the option of the attribute we created --> - <comment userInput="Get the option of the attribute we created" stepKey="GetAttributeOption"/> + <comment userInput="Get the option of the attribute we created" stepKey="getAttributeOptionComment"/> <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> <requiredEntity createDataKey="createConfigProductAttribute"/> </getData> <!-- Create a simple product and give it the attribute with option --> - <comment userInput="Create a simple product and give it the attribute with option" stepKey="CreateSimpleProductWithOptions"/> + <comment userInput="Create a simple product and give it the attribute with option" stepKey="createSimpleProductWithOptionsComment"/> <createData entity="SimpleProduct3Price10Qty1" stepKey="createConfigChildProduct1"> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption1"/> </createData> <!-- Create the configurable product --> - <comment userInput="Create the configurable product" stepKey="CreateTheConfigurableProduct"/> + <comment userInput="Create the configurable product" stepKey="createConfigurableProductComment"/> <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption1"/> </createData> <!-- Add simple product to the configurable product --> - <comment userInput="Add simple product to the configurable product" stepKey="AddSimpleProductToConfigurable"/> + <comment userInput="Add simple product to the configurable product" stepKey="addSimpleProductToConfigurableComment"/> <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct1"/> @@ -110,48 +110,48 @@ <actionGroup ref="logout" stepKey="logout"/> </after> <!-- Create new customer order --> - <comment userInput="Create new customer order" stepKey="CreateNewCustomerOrder"/> + <comment userInput="Create new customer order" stepKey="createNewCustomerOrderComment"/> <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> <argument name="customer" value="$$simpleCustomer$$"/> </actionGroup> <!-- Add bundle product to order and check product price in grid --> - <comment userInput="Add bundle product to order and check product price in grid" stepKey="AddBundleProductToOrder"/> + <comment userInput="Add bundle product to order and check product price in grid" stepKey="addBundleProductToOrderComment"/> <actionGroup ref="addBundleProductToOrder" stepKey="addBundleProductToOrder"> <argument name="product" value="$$createBundleProduct$$"/> <argument name="quantity" value="1"/> </actionGroup> <!-- Add configurable product to order --> - <comment userInput="Add configurable product to order" stepKey="AddConfigurableProductToOrder"/> + <comment userInput="Add configurable product to order" stepKey="addConfigurableProductToOrderComment"/> <actionGroup ref="newAddConfigurableProductToOrder" stepKey="addConfigurableProductToOrder"> <argument name="product" value="$$createConfigProduct$$"/> <argument name="attribute" value="$$createConfigProductAttribute$$"/> <argument name="option" value="$$getConfigAttributeOption1$$"/> </actionGroup> <!-- Add Simple product to order --> - <comment userInput="Add Simple product to order" stepKey="AddSimpleProductToOrder"/> + <comment userInput="Add Simple product to order" stepKey="addSimpleProductToOrderComment"/> <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToTheOrder"> <argument name="product" value="$$simpleProduct$$"/> </actionGroup> <!-- Add Virtual product to order --> - <comment userInput="Add Virtual product to order" stepKey="AddVirtualProductToOrder"/> + <comment userInput="Add Virtual product to order" stepKey="addVirtualProductToOrderComment"/> <actionGroup ref="addSimpleProductToOrder" stepKey="addVirtualProductToTheOrder"> <argument name="product" value="$$virtualProduct$$"/> </actionGroup> <!-- Select FlatRate shipping method --> - <comment userInput="Select FlatRate shipping method" stepKey="SelectFlatRateShippingMethod"/> + <comment userInput="Select FlatRate shipping method" stepKey="selectFlatRateShippingMethodComment"/> <actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> <!-- Submit order --> - <comment userInput="Submit order" stepKey="SubmitOrder"/> + <comment userInput="Submit order" stepKey="submitOrderComment"/> <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="submitOrder"/> <!-- Verify order information --> - <comment userInput="Verify order information" stepKey="VerifyOrderInformation"/> + <comment userInput="Verify order information" stepKey="verifyOrderInformationComment"/> <actionGroup ref="verifyCreatedOrderInformation" stepKey="verifyCreatedOrderInformation"/> <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> <!-- Cancel the Order --> - <comment userInput="Cancel the Order" stepKey="CancelTheOrder"/> + <comment userInput="Cancel the Order" stepKey="cancelTheOrder"/> <actionGroup ref="cancelPendingOrder" stepKey="cancelPendingOrder"/> <!-- Assert Simple Product Quantity in backend after order Canceled --> - <comment userInput="Assert Simple Product Quantity in backend after order Canceled" stepKey="AssertSimpleProductQuantityAfterOrderCanceled"/> + <comment userInput="Assert Simple Product Quantity in backend after order Canceled" stepKey="assertSimpleProductQuantityAfterOrderCanceledComment"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheProduct"> <argument name="productSku" value="$$simpleProduct.sku$$"/> </actionGroup> @@ -160,13 +160,13 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1" stepKey="seeProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStockStatus"/> <!-- Assert Simple Product Stock Status in frontend after order canceled --> - <comment userInput="Assert Simple Product Stock Status in frontend after order Canceled" stepKey="AssertSimpleProductStockStatus"/> - <actionGroup ref="storefrontCheckProductStockStatus" stepKey="checkProductQtyOfSimpleProduct"> + <comment userInput="Assert Simple Product Stock Status in frontend after order Canceled" stepKey="assertSimpleProductStockStatusComment"/> + <actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkProductQtyOfSimpleProduct"> <argument name="productUrlKey" value="$$simpleProduct.custom_attributes[url_key]$$"/> <argument name="productName" value="$$simpleProduct.name$$"/> </actionGroup> <!-- Assert Virtual Product Quantity in backend after order canceled --> - <comment userInput="Assert Virtual Product Quantity in backend after order canceled" stepKey="AssertVirtualProductQuantityAfterOrderCanceled"/> + <comment userInput="Assert Virtual Product Quantity in backend after order canceled" stepKey="assertVirtualProductQuantityAfterOrderCanceledComment"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheVirtualProduct"> <argument name="productSku" value="$$virtualProduct.sku$$"/> </actionGroup> @@ -175,13 +175,13 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1" stepKey="seeVirtualProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeVirtualProductStockStatus"/> <!-- Assert Virtual Product Stock Status in frontend after order canceled --> - <comment userInput="Assert Virtual Product Stock Status in frontend after order Canceled" stepKey="AssertVirtualProductStockStatus"/> - <actionGroup ref="storefrontCheckProductStockStatus" stepKey="checkProductQtyOfVirtualProduct"> + <comment userInput="Assert Virtual Product Stock Status in frontend after order Canceled" stepKey="assertVirtualProductStockStatusComment"/> + <actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkProductQtyOfVirtualProduct"> <argument name="productUrlKey" value="$$virtualProduct.custom_attributes[url_key]$$"/> <argument name="productName" value="$$virtualProduct.name$$"/> </actionGroup> <!-- Assert Bundle Product Quantity in backend after order canceled --> - <comment userInput="Assert Bundle Product Quantity in backend after order canceled" stepKey="AssertBundleProductQuantityAfterOrderCanceled"/> + <comment userInput="Assert Bundle Product Quantity in backend after order canceled" stepKey="assertBundleProductQuantityAfterOrderCanceledComment"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheBundleProduct"> <argument name="productSku" value="$$simpleProduct1.sku$$"/> </actionGroup> @@ -190,13 +190,13 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1" stepKey="seeBundleProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeBundleProductStockStatus"/> <!-- Assert Bundle Product Stock Status in frontend after order canceled --> - <comment userInput="Assert Bundle Product Stock Status in frontend after order Canceled" stepKey="AssertBundleProductStockStatus"/> - <actionGroup ref="storefrontCheckProductStockStatus" stepKey="checkProductQtyOfBundleProduct"> + <comment userInput="Assert Bundle Product Stock Status in frontend after order Canceled" stepKey="assertBundleProductStockStatusComment"/> + <actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkProductQtyOfBundleProduct"> <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> <argument name="productName" value="$$createBundleProduct.name$$"/> </actionGroup> <!-- Assert Configurable Product Quantity in backend after order canceled --> - <comment userInput="Assert Configurable Product quantity in backend after order canceled" stepKey="AssertConfigurableProductQuantityAfterOrderCanceled"/> + <comment userInput="Assert Configurable Product quantity in backend after order canceled" stepKey="assertConfigurableProductQuantityAfterOrderCanceledComment"/> <actionGroup ref="filterAndSelectProduct" stepKey="filterAndSelectTheConfigProduct"> <argument name="productSku" value="$$createConfigChildProduct1.sku$$"/> </actionGroup> @@ -205,29 +205,29 @@ <seeInField selector="{{AdminProductFormSection.productQuantity}}" userInput="1" stepKey="seeConfigProductQuantity"/> <seeInField selector="{{AdminProductFormSection.productStockStatus}}" userInput="In Stock" stepKey="seeConfigProductStockStatus"/> <!-- Assert Configurable Product Stock Status in frontend after order canceled --> - <comment userInput="Assert Configurable Product Stock Status in frontend after order Canceled" stepKey="AssertConfigurableProductStockStatus"/> - <actionGroup ref="storefrontCheckProductStockStatus" stepKey="checkProductQtyOfConfigProductInFrontend"> + <comment userInput="Assert Configurable Product Stock Status in frontend after order Canceled" stepKey="assertConfigurableProductStockStatusComment"/> + <actionGroup ref="StorefrontCheckProductStockStatus" stepKey="checkProductQtyOfConfigProductInFrontend"> <argument name="productUrlKey" value="$$createConfigProduct.custom_attributes[url_key]$$"/> <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <!-- Open Order Index Page --> - <comment userInput="Open Order Index Page" stepKey="OpenOrderIndexPage"/> + <comment userInput="Open Order Index Page" stepKey="openOrderIndexPageComemnt"/> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForPageLoad5"/> <!-- Filter order using orderId --> - <comment userInput="Filter order using orderId" stepKey="FilterOrderUsingOrderId"/> + <comment userInput="Filter order using orderId" stepKey="filterOrderUsingOrderIdComment"/> <actionGroup ref="filterOrderGridById" stepKey="filterOrderGridById"> <argument name="orderId" value="$orderId"/> </actionGroup> <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="$orderId" stepKey="seeOrderIdInGrid"/> <see selector="{{AdminOrdersGridSection.firstRow}}" userInput="Canceled" stepKey="seeStatusInGrid"/> <!-- Log in to Storefront as Customer --> - <comment userInput="Log in to Storefront as Customer" stepKey="LogInAsCustomer"/> + <comment userInput="Log in to Storefront as Customer" stepKey="logInAsCustomerComment"/> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> <argument name="Customer" value="$$simpleCustomer$$"/> </actionGroup> <!-- Assert Order status in frontend order grid --> - <comment userInput="Assert Order status in frontend order grid " stepKey="AssertOrderStatusInFrontend"/> + <comment userInput="Assert Order status in frontend order grid " stepKey="assertOrderStatusInFrontendComment"/> <click selector="{{StorefrontCustomerSidebarSection.sidebarCurrentTab('My Orders')}}" stepKey="clickOnMyOrders"/> <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> From c03084cc77e96bc48c615d29ab2ac343f2762637 Mon Sep 17 00:00:00 2001 From: Bohdan Shevchenko <1408sheva@gmail.com> Date: Tue, 2 Jul 2019 15:09:07 +0300 Subject: [PATCH 066/230] MC-6425: [API] Order with state STATE_HOLDED should not be canceled --- .../Sales/Service/V1/OrderCancelTest.php | 24 +++++++++++++++++++ .../Magento/Sales/_files/order_state_hold.php | 14 +++++++++++ 2 files changed, 38 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold.php diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php index 62a44f851e40..f0d10208d885 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php @@ -36,4 +36,28 @@ public function testOrderCancel() $result = $this->_webApiCall($serviceInfo, $requestData); $this->assertTrue($result); } + + /** + * @magentoApiDataFixture Magento/Sales/_files/order_state_hold.php + */ + public function testOrderWithStateHoldedShouldNotBeCanceled() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $order = $objectManager->get(\Magento\Sales\Model\Order::class)->loadByIncrementId('100000001'); + $serviceInfo = [ + 'rest' => [ + 'resourcePath' => '/V1/orders/' . $order->getId() . '/cancel', + 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, + ], + 'soap' => [ + 'service' => self::SERVICE_NAME, + 'serviceVersion' => self::SERVICE_VERSION, + 'operation' => self::SERVICE_NAME . 'cancel', + ], + ]; + + $requestData = ['id' => $order->getId()]; + $result = $this->_webApiCall($serviceInfo, $requestData); + $this->assertFalse($result); + } } diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold.php new file mode 100644 index 000000000000..a2814c0641c4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold.php @@ -0,0 +1,14 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Sales\Model\Order; + +require 'order.php'; + +/** @var Order $order */ +$order->setState(Order::STATE_HOLDED); +$order->setStatus(Order::STATE_HOLDED); +$order->save(); From c1e9db2a45b310542eed5b34485f7965efa9566f Mon Sep 17 00:00:00 2001 From: Bohdan Shevchenko <1408sheva@gmail.com> Date: Tue, 2 Jul 2019 16:42:47 +0300 Subject: [PATCH 067/230] MC-6425: [API] Order with state STATE_HOLDED should not be canceled --- .../testsuite/Magento/Sales/Service/V1/OrderCancelTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php index f0d10208d885..4fa044272055 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php @@ -8,6 +8,10 @@ use Magento\TestFramework\TestCase\WebapiAbstract; +/** + * Class OrderCancelTest + * @package Magento\Sales\Service\V1 + */ class OrderCancelTest extends WebapiAbstract { const SERVICE_VERSION = 'V1'; From a3adb31fa73d0a62b83e9c1e4479ed61152ca6fc Mon Sep 17 00:00:00 2001 From: Bohdan Shevchenko <1408sheva@gmail.com> Date: Wed, 3 Jul 2019 11:14:04 +0300 Subject: [PATCH 068/230] MC-6425: [API] Order with state STATE_HOLDED should not be canceled --- .../testsuite/Magento/Sales/Service/V1/OrderCancelTest.php | 3 +-- .../testsuite/Magento/Sales/_files/order_state_hold.php | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php index 4fa044272055..cf295229df55 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php @@ -9,8 +9,7 @@ use Magento\TestFramework\TestCase\WebapiAbstract; /** - * Class OrderCancelTest - * @package Magento\Sales\Service\V1 + * Canceling of the order, in different states */ class OrderCancelTest extends WebapiAbstract { diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold.php index a2814c0641c4..5578a55b57e8 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold.php @@ -3,10 +3,11 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); use Magento\Sales\Model\Order; -require 'order.php'; +require __DIR__ . '/order.php'; /** @var Order $order */ $order->setState(Order::STATE_HOLDED); From 1537251bc266b9386dcc2694957d71d5203d61f0 Mon Sep 17 00:00:00 2001 From: Bohdan Shevchenko <1408sheva@gmail.com> Date: Wed, 3 Jul 2019 12:38:51 +0300 Subject: [PATCH 069/230] MC-6425: [API] Order with state STATE_HOLDED should not be canceled --- .../testsuite/Magento/Sales/Service/V1/OrderCancelTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php index cf295229df55..42541099a236 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php @@ -9,7 +9,7 @@ use Magento\TestFramework\TestCase\WebapiAbstract; /** - * Canceling of the order, in different states + * Canceling of the order */ class OrderCancelTest extends WebapiAbstract { From e8fe05400a8f5e080a860817a2ffd6a3b36c2a72 Mon Sep 17 00:00:00 2001 From: Bohdan Shevchenko <1408sheva@gmail.com> Date: Wed, 3 Jul 2019 15:17:14 +0300 Subject: [PATCH 070/230] MC-6425: [API] Order with state STATE_HOLDED should not be canceled --- .../Sales/Service/V1/OrderCancelTest.php | 65 ++++++++++++------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php index 42541099a236..d030b07ba528 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php @@ -6,6 +6,8 @@ namespace Magento\Sales\Service\V1; +use Magento\Framework\ObjectManagerInterface; +use Magento\Sales\Model\Order\Interceptor; use Magento\TestFramework\TestCase\WebapiAbstract; /** @@ -14,16 +16,40 @@ class OrderCancelTest extends WebapiAbstract { const SERVICE_VERSION = 'V1'; - const SERVICE_NAME = 'salesOrderManagementV1'; /** - * @magentoApiDataFixture Magento/Sales/_files/order.php + * @var ObjectManagerInterface */ - public function testOrderCancel() + private $objectManager; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + } + + /** + * Gets order by increment ID. + * + * @param string $incrementId + * @return Interceptor + */ + private function getOrder(string $incrementId): Interceptor + { + return $this->objectManager->get(\Magento\Sales\Model\Order::class)->loadByIncrementId($incrementId); + } + + /** + * Send API request for canceling the order + * + * @param object $order + * @return array|bool|float|int|string + */ + private function sendCancelRequest($order) { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $order = $objectManager->get(\Magento\Sales\Model\Order::class)->loadByIncrementId('100000001'); $serviceInfo = [ 'rest' => [ 'resourcePath' => '/V1/orders/' . $order->getId() . '/cancel', @@ -36,7 +62,16 @@ public function testOrderCancel() ], ]; $requestData = ['id' => $order->getId()]; - $result = $this->_webApiCall($serviceInfo, $requestData); + return $this->_webApiCall($serviceInfo, $requestData); + } + + /** + * @magentoApiDataFixture Magento/Sales/_files/order.php + */ + public function testOrderCancel() + { + $order = $this->getOrder('100000001'); + $result = $this->sendCancelRequest($order); $this->assertTrue($result); } @@ -45,22 +80,8 @@ public function testOrderCancel() */ public function testOrderWithStateHoldedShouldNotBeCanceled() { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $order = $objectManager->get(\Magento\Sales\Model\Order::class)->loadByIncrementId('100000001'); - $serviceInfo = [ - 'rest' => [ - 'resourcePath' => '/V1/orders/' . $order->getId() . '/cancel', - 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST, - ], - 'soap' => [ - 'service' => self::SERVICE_NAME, - 'serviceVersion' => self::SERVICE_VERSION, - 'operation' => self::SERVICE_NAME . 'cancel', - ], - ]; - - $requestData = ['id' => $order->getId()]; - $result = $this->_webApiCall($serviceInfo, $requestData); + $order = $this->getOrder('100000001'); + $result = $this->sendCancelRequest($order); $this->assertFalse($result); } } From 554f2e2c3a693d6108bd20bc7e721bb6fca06fe0 Mon Sep 17 00:00:00 2001 From: Bohdan Shevchenko <1408sheva@gmail.com> Date: Wed, 3 Jul 2019 15:48:17 +0300 Subject: [PATCH 071/230] MC-6425: [API] Order with state STATE_HOLDED should not be canceled --- .../Magento/Sales/Service/V1/OrderCancelTest.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php index d030b07ba528..80a6535f2633 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php @@ -7,7 +7,8 @@ namespace Magento\Sales\Service\V1; use Magento\Framework\ObjectManagerInterface; -use Magento\Sales\Model\Order\Interceptor; +use Magento\Sales\Model\Order; +use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\WebapiAbstract; /** @@ -28,27 +29,27 @@ class OrderCancelTest extends WebapiAbstract */ protected function setUp() { - $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->objectManager = Bootstrap::getObjectManager(); } /** * Gets order by increment ID. * * @param string $incrementId - * @return Interceptor + * @return Order */ - private function getOrder(string $incrementId): Interceptor + private function getOrder(string $incrementId): Order { - return $this->objectManager->get(\Magento\Sales\Model\Order::class)->loadByIncrementId($incrementId); + return $this->objectManager->create(Order::class)->loadByIncrementId($incrementId); } /** * Send API request for canceling the order * - * @param object $order + * @param Order $order * @return array|bool|float|int|string */ - private function sendCancelRequest($order) + private function sendCancelRequest(Order $order) { $serviceInfo = [ 'rest' => [ From 39938098b45d79edbb5b75b2f8eba60758118c25 Mon Sep 17 00:00:00 2001 From: Bohdan Shevchenko <1408sheva@gmail.com> Date: Thu, 4 Jul 2019 11:48:22 +0300 Subject: [PATCH 072/230] MC-6459: [API] Order with state STATE_COMPLETE should not be canceled --- .../Sales/Service/V1/OrderCancelTest.php | 61 +++++++++++++++++-- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php index 62a44f851e40..4e847ac62cf5 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderCancelTest.php @@ -6,21 +6,51 @@ namespace Magento\Sales\Service\V1; +use Magento\Framework\ObjectManagerInterface; +use Magento\Sales\Model\Order; +use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\WebapiAbstract; +/** + * Canceling of the order + */ class OrderCancelTest extends WebapiAbstract { const SERVICE_VERSION = 'V1'; - const SERVICE_NAME = 'salesOrderManagementV1'; /** - * @magentoApiDataFixture Magento/Sales/_files/order.php + * @var ObjectManagerInterface */ - public function testOrderCancel() + private $objectManager; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->objectManager = Bootstrap::getObjectManager(); + } + + /** + * Gets order by increment ID. + * + * @param string $incrementId + * @return Order + */ + private function getOrder(string $incrementId): Order + { + return $this->objectManager->create(Order::class)->loadByIncrementId($incrementId); + } + + /** + * Send API request for canceling the order + * + * @param Order $order + * @return array|bool|float|int|string + */ + private function sendCancelRequest(Order $order) { - $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $order = $objectManager->get(\Magento\Sales\Model\Order::class)->loadByIncrementId('100000001'); $serviceInfo = [ 'rest' => [ 'resourcePath' => '/V1/orders/' . $order->getId() . '/cancel', @@ -33,7 +63,26 @@ public function testOrderCancel() ], ]; $requestData = ['id' => $order->getId()]; - $result = $this->_webApiCall($serviceInfo, $requestData); + return $this->_webApiCall($serviceInfo, $requestData); + } + + /** + * @magentoApiDataFixture Magento/Sales/_files/order.php + */ + public function testOrderCancel() + { + $order = $this->getOrder('100000001'); + $result = $this->sendCancelRequest($order); $this->assertTrue($result); } + + /** + * @magentoApiDataFixture Magento/Sales/_files/order_with_shipping_and_invoice.php + */ + public function testOrderWithStateCompleteShouldNotBeCanceled() + { + $order = $this->getOrder('100000001'); + $result = $this->sendCancelRequest($order); + $this->assertFalse($result); + } } From 8ae68ec40075eef8f1fe0a7ef085c9e0066a67fb Mon Sep 17 00:00:00 2001 From: Dmitriy Kogut <kogut.dmitriy@gmail.com> Date: Fri, 5 Jul 2019 10:09:16 +0300 Subject: [PATCH 073/230] MC-12129: [B2B-Company Credit] Change company credit currency for different admin locale --- .../AdminSetBaseCurrencyActionGroup.xml | 19 +++++++++++++++++++ .../Mftf/Section/CurrencySetupSection.xml | 4 +++- .../VerifyDisabledCustomerGroupFieldTest.xml | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetBaseCurrencyActionGroup.xml diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetBaseCurrencyActionGroup.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetBaseCurrencyActionGroup.xml new file mode 100644 index 000000000000..1dc9b83b4500 --- /dev/null +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/ActionGroup/AdminSetBaseCurrencyActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <!-- Set base currency --> + <actionGroup name="AdminSetBaseCurrencyActionGroup" extends="AdminSaveConfigActionGroup"> + <arguments> + <argument name="currency" type="string"/> + </arguments> + <uncheckOption selector="{{CurrencySetupSection.baseCurrencyUseDefault}}" before="clickSaveConfigBtn" stepKey="uncheckUseDefaultOption"/> + <selectOption selector="{{CurrencySetupSection.baseCurrency}}" userInput="{{currency}}" after="uncheckUseDefaultOption" stepKey="setBaseCurrencyField"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/CurrencySetupSection.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/CurrencySetupSection.xml index 20fcd1e89360..5d03c83b50b9 100644 --- a/app/code/Magento/CurrencySymbol/Test/Mftf/Section/CurrencySetupSection.xml +++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Section/CurrencySetupSection.xml @@ -10,6 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="CurrencySetupSection"> <element name="allowCurrencies" type="select" selector="#currency_options_allow"/> + <element name="baseCurrency" type="select" selector="#currency_options_base"/> + <element name="baseCurrencyUseDefault" type="checkbox" selector="#currency_options_base_inherit"/> <element name="currencyOptions" type="select" selector="#currency_options-head"/> </section> -</sections> \ No newline at end of file +</sections> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/VerifyDisabledCustomerGroupFieldTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/VerifyDisabledCustomerGroupFieldTest.xml index 648c30b1ca0b..0f98184aafb4 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/VerifyDisabledCustomerGroupFieldTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/VerifyDisabledCustomerGroupFieldTest.xml @@ -26,7 +26,7 @@ <!-- 2. Navigate to Customers > Customer Groups --> <amOnPage url="{{AdminCustomerGroupPage.url}}" stepKey="amOnCustomerGroupPage" /> - <waitForPageLoad stepKey="waitForCustomerGroupsPageLoad" /> + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFiltersIfTheySet"/> <!-- 3. Select system Customer Group specified in data set from grid --> <click selector="{{AdminCustomerGroupMainSection.editButtonByCustomerGroupCode(NotLoggedInCustomerGroup.code)}}" stepKey="clickOnEditCustomerGroup" /> From fd5621c0ecb9b71881e7b1e233ffe153ac320312 Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Fri, 5 Jul 2019 11:57:14 +0300 Subject: [PATCH 074/230] MC-17928: Unable to edit customer address on admin page with "file" or "image" customer address attribute --- .../Customer/Model/FileUploaderDataResolver.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Customer/Model/FileUploaderDataResolver.php b/app/code/Magento/Customer/Model/FileUploaderDataResolver.php index 535bfe97bc45..b9e912572489 100644 --- a/app/code/Magento/Customer/Model/FileUploaderDataResolver.php +++ b/app/code/Magento/Customer/Model/FileUploaderDataResolver.php @@ -88,9 +88,7 @@ private function getFileUploaderData( $file = $customerData[$attributeCode] ?? null; /** @var FileProcessor $fileProcessor */ - $fileProcessor = $this->fileProcessorFactory->create([ - 'entityTypeCode' => $entityType->getEntityTypeCode(), - ]); + $fileProcessor = $this->fileProcessorFactory->create(['entityTypeCode' => $entityType->getEntityTypeCode()]); if (!empty($file) && $fileProcessor->isExist($file) @@ -103,6 +101,7 @@ private function getFileUploaderData( 'file' => $file, 'size' => null !== $stat ? $stat['size'] : 0, 'url' => $viewUrl ?? '', + // phpcs:ignore Magento2.Functions.DiscouragedFunction 'name' => basename($file), 'type' => $fileProcessor->getMimeType($file), ], @@ -138,9 +137,12 @@ public function overrideFileUploaderMetadata( if (isset($config['validation']['file_extensions'])) { $allowedExtensions = explode(',', $config['validation']['file_extensions']); - array_walk($allowedExtensions, function (&$value) { - $value = strtolower(trim($value)); - }); + array_walk( + $allowedExtensions, + function (&$value) { + $value = strtolower(trim($value)); + } + ); } $allowedExtensions = implode(' ', $allowedExtensions); @@ -149,6 +151,7 @@ public function overrideFileUploaderMetadata( $url = $this->getFileUploadUrl($entityTypeCode); $config = [ + 'dataType' => $this->getMetadataValue($config, 'dataType'), 'formElement' => 'fileUploader', 'componentType' => 'fileUploader', 'maxFileSize' => $maxFileSize, From fd41e224afd8058414ae6c799f13fd6b33f3fdc1 Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Fri, 5 Jul 2019 13:29:51 +0300 Subject: [PATCH 075/230] MC-17928: Unable to edit customer address on admin page with "file" or "image" customer address attribute --- .../Customer/Test/Unit/Model/Customer/DataProviderTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php index 3cbcbdf80b2a..01cb60364459 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php @@ -931,6 +931,7 @@ function ($origName) { 'arguments' => [ 'data' => [ 'config' => [ + 'dataType' => 'frontend_input', 'formElement' => 'fileUploader', 'componentType' => 'fileUploader', 'maxFileSize' => $maxFileSize, From 25226bb3c748f14de59b42f4c875b1fe46334dfa Mon Sep 17 00:00:00 2001 From: Viktor Petryk <victor.petryk@transoftgroup.com> Date: Fri, 5 Jul 2019 15:24:51 +0300 Subject: [PATCH 076/230] MC-17928: Unable to edit customer address on admin page with "file" or "image" customer address attribute --- .../Unit/Model/Customer/DataProviderTest.php | 286 ++++++++++-------- 1 file changed, 154 insertions(+), 132 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php index 01cb60364459..8ad7363a1c31 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php @@ -3,23 +3,33 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Customer\Test\Unit\Model\Customer; use Magento\Customer\Api\CustomerMetadataInterface; +use Magento\Customer\Model\Address; use Magento\Customer\Model\Config\Share; +use Magento\Customer\Model\Customer; +use Magento\Customer\Model\Customer\DataProvider as CustomerDataProvider; +use Magento\Customer\Model\FileProcessor; +use Magento\Customer\Model\FileUploaderDataResolver; use Magento\Customer\Model\ResourceModel\Address\Attribute\Source\CountryWithWebsites; +use Magento\Customer\Model\ResourceModel\Customer\Collection; use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory; use Magento\Eav\Model\Config; use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; +use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; use Magento\Eav\Model\Entity\Type; +use Magento\Framework\ObjectManagerInterface; +use Magento\Framework\Session\SessionManagerInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Ui\Component\Form\Field; use Magento\Ui\DataProvider\EavValidationRules; +use PHPUnit_Framework_MockObject_MockObject as MockObject; /** - * Class DataProviderTest - * - * Test for class \Magento\Customer\Model\Customer\DataProvider + * Unit tests for \Magento\Customer\Model\Customer\DataProvider class. * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ @@ -29,69 +39,64 @@ class DataProviderTest extends \PHPUnit\Framework\TestCase const OPTIONS_RESULT = 'test-options'; /** - * @var Config|\PHPUnit_Framework_MockObject_MockObject + * @var Config|MockObject */ protected $eavConfigMock; /** - * @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @var CollectionFactory|MockObject */ protected $customerCollectionFactoryMock; /** - * @var EavValidationRules|\PHPUnit_Framework_MockObject_MockObject + * @var EavValidationRules|MockObject */ protected $eavValidationRulesMock; /** - * @var \Magento\Framework\Session\SessionManagerInterface|\PHPUnit_Framework_MockObject_MockObject + * @var SessionManagerInterface|MockObject */ protected $sessionMock; /** - * @var \Magento\Customer\Model\FileProcessor|\PHPUnit_Framework_MockObject_MockObject + * @var FileProcessor|MockObject */ protected $fileProcessor; /** - * @var \Magento\Customer\Model\FileUploaderDataResolver|\PHPUnit_Framework_MockObject_MockObject + * @var FileUploaderDataResolver|MockObject */ private $fileUploaderDataResolver; /** - * Set up - * - * @return void + * @inheritdoc */ protected function setUp() { - $this->eavConfigMock = $this->getMockBuilder(\Magento\Eav\Model\Config::class) + $this->eavConfigMock = $this->getMockBuilder(Config::class) ->disableOriginalConstructor() ->getMock(); - $this->customerCollectionFactoryMock = $this->createPartialMock( - \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory::class, - ['create'] - ); + $this->customerCollectionFactoryMock = $this->createPartialMock(CollectionFactory::class, ['create']); $this->eavValidationRulesMock = $this - ->getMockBuilder(\Magento\Ui\DataProvider\EavValidationRules::class) + ->getMockBuilder(EavValidationRules::class) ->disableOriginalConstructor() ->getMock(); $this->sessionMock = $this - ->getMockBuilder(\Magento\Framework\Session\SessionManagerInterface::class) + ->getMockBuilder(SessionManagerInterface::class) ->setMethods(['getCustomerFormData', 'unsCustomerFormData']) ->getMockForAbstractClass(); - $this->fileProcessor = $this->getMockBuilder(\Magento\Customer\Model\FileProcessor::class) + $this->fileProcessor = $this->getMockBuilder(FileProcessor::class) ->disableOriginalConstructor() ->getMock(); - $this->fileUploaderDataResolver = $this->getMockBuilder(\Magento\Customer\Model\FileUploaderDataResolver::class) + $this->fileUploaderDataResolver = $this->getMockBuilder(FileUploaderDataResolver::class) ->disableOriginalConstructor() ->setMethods(['overrideFileUploaderMetadata', 'overrideFileUploaderData']) ->getMock(); } /** - * Run test getAttributesMeta method + * Run test getAttributesMeta method. * * @param array $expected * @return void @@ -101,9 +106,9 @@ protected function setUp() public function testGetAttributesMetaWithOptions(array $expected) { $helper = new ObjectManager($this); - /** @var \Magento\Customer\Model\Customer\DataProvider $dataProvider */ + /** @var CustomerDataProvider $dataProvider */ $dataProvider = $helper->getObject( - \Magento\Customer\Model\Customer\DataProvider::class, + CustomerDataProvider::class, [ 'name' => 'test-name', 'primaryFieldName' => 'primary-field-name', @@ -111,7 +116,7 @@ public function testGetAttributesMetaWithOptions(array $expected) 'eavValidationRules' => $this->eavValidationRulesMock, 'customerCollectionFactory' => $this->getCustomerCollectionFactoryMock(), 'eavConfig' => $this->getEavConfigMock(), - 'fileUploaderDataResolver' => $this->fileUploaderDataResolver + 'fileUploaderDataResolver' => $this->fileUploaderDataResolver, ] ); @@ -121,7 +126,7 @@ public function testGetAttributesMetaWithOptions(array $expected) } /** - * Data provider for testGetAttributesMeta + * Data provider for testGetAttributesMeta. * * @return array * @SuppressWarnings(PHPMD.ExcessiveMethodLength) @@ -238,8 +243,8 @@ public function getAttributesMetaDataProvider() 'componentType' => Field::NAME, 'filterBy' => [ 'target' => '${ $.provider }:data.customer.website_id', - 'field' => 'website_ids' - ] + 'field' => 'website_ids', + ], ], ], ], @@ -252,11 +257,11 @@ public function getAttributesMetaDataProvider() } /** - * @return CollectionFactory|\PHPUnit_Framework_MockObject_MockObject + * @return CollectionFactory|MockObject */ protected function getCustomerCollectionFactoryMock() { - $collectionMock = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + $collectionMock = $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); @@ -272,7 +277,7 @@ protected function getCustomerCollectionFactoryMock() } /** - * @return Config|\PHPUnit_Framework_MockObject_MockObject + * @return Config|MockObject */ protected function getEavConfigMock($customerAttributes = []) { @@ -289,11 +294,11 @@ protected function getEavConfigMock($customerAttributes = []) } /** - * @return Type|\PHPUnit_Framework_MockObject_MockObject + * @return Type|MockObject */ protected function getTypeCustomerMock($customerAttributes = []) { - $typeCustomerMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Type::class) + $typeCustomerMock = $this->getMockBuilder(Type::class) ->disableOriginalConstructor() ->getMock(); $attributesCollection = !empty($customerAttributes) ? $customerAttributes : $this->getAttributeMock(); @@ -314,11 +319,11 @@ protected function getTypeCustomerMock($customerAttributes = []) } /** - * @return Type|\PHPUnit_Framework_MockObject_MockObject + * @return Type|MockObject */ protected function getTypeAddressMock() { - $typeAddressMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Type::class) + $typeAddressMock = $this->getMockBuilder(Type::class) ->disableOriginalConstructor() ->getMock(); @@ -330,13 +335,13 @@ protected function getTypeAddressMock() } /** - * @param \PHPUnit_Framework_MockObject_MockObject $attributeMock - * @param \PHPUnit_Framework_MockObject_MockObject $attributeBooleanMock + * @param MockObject $attributeMock + * @param MockObject $attributeBooleanMock * @param array $options */ private function injectVisibilityProps( - \PHPUnit_Framework_MockObject_MockObject $attributeMock, - \PHPUnit_Framework_MockObject_MockObject $attributeBooleanMock, + MockObject $attributeMock, + MockObject $attributeBooleanMock, array $options = [] ) { if (isset($options[self::ATTRIBUTE_CODE]['visible'])) { @@ -377,11 +382,11 @@ private function injectVisibilityProps( } /** - * @return AbstractAttribute[]|\PHPUnit_Framework_MockObject_MockObject[] + * @return AbstractAttribute[]|MockObject[] */ protected function getAttributeMock($type = 'customer', $options = []) { - $attributeMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class) + $attributeMock = $this->getMockBuilder(AbstractAttribute::class) ->setMethods( [ 'getAttributeCode', @@ -397,7 +402,7 @@ protected function getAttributeMock($type = 'customer', $options = []) ) ->disableOriginalConstructor() ->getMockForAbstractClass(); - $sourceMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource::class) + $sourceMock = $this->getMockBuilder(AbstractSource::class) ->disableOriginalConstructor() ->getMockForAbstractClass(); @@ -425,7 +430,7 @@ protected function getAttributeMock($type = 'customer', $options = []) ->method('getSource') ->willReturn($sourceMock); - $attributeBooleanMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class) + $attributeBooleanMock = $this->getMockBuilder(AbstractAttribute::class) ->setMethods( [ 'getAttributeCode', @@ -463,10 +468,12 @@ protected function getAttributeMock($type = 'customer', $options = []) $this->eavValidationRulesMock->expects($this->any()) ->method('build') - ->willReturnMap([ - [$attributeMock, $this->logicalNot($this->isEmpty()), []], - [$attributeBooleanMock, $this->logicalNot($this->isEmpty()), []], - ]); + ->willReturnMap( + [ + [$attributeMock, $this->logicalNot($this->isEmpty()), []], + [$attributeBooleanMock, $this->logicalNot($this->isEmpty()), []], + ] + ); $mocks = [$attributeMock, $attributeBooleanMock]; $this->injectVisibilityProps($attributeMock, $attributeBooleanMock, $options); if ($type == "address") { @@ -476,7 +483,7 @@ protected function getAttributeMock($type = 'customer', $options = []) } /** - * Callback for ::getDataUsingMethod + * Callback for ::getDataUsingMethod. * * @return \Closure */ @@ -488,7 +495,7 @@ private function attributeGetUsingMethodCallback() } /** - * @return \PHPUnit_Framework_MockObject_MockObject + * @return MockObject */ private function getCountryAttrMock() { @@ -501,15 +508,17 @@ private function getCountryAttrMock() $shareMock = $this->getMockBuilder(Share::class) ->disableOriginalConstructor() ->getMock(); - $objectManagerMock = $this->createMock(\Magento\Framework\ObjectManagerInterface::class); + $objectManagerMock = $this->createMock(ObjectManagerInterface::class); $objectManagerMock->expects($this->any()) ->method('get') - ->willReturnMap([ - [CountryWithWebsites::class, $countryByWebsiteMock], - [Share::class, $shareMock], - ]); + ->willReturnMap( + [ + [CountryWithWebsites::class, $countryByWebsiteMock], + [Share::class, $shareMock], + ] + ); \Magento\Framework\App\ObjectManager::setInstance($objectManagerMock); - $countryAttrMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class) + $countryAttrMock = $this->getMockBuilder(AbstractAttribute::class) ->setMethods(['getAttributeCode', 'getDataUsingMethod', 'usesSource', 'getSource', 'getLabel']) ->disableOriginalConstructor() ->getMockForAbstractClass(); @@ -558,13 +567,13 @@ public function testGetData() 'street' => "street\nstreet", ]; - $customer = $this->getMockBuilder(\Magento\Customer\Model\Customer::class) + $customer = $this->getMockBuilder(Customer::class) ->disableOriginalConstructor() ->getMock(); - $address = $this->getMockBuilder(\Magento\Customer\Model\Address::class) + $address = $this->getMockBuilder(Address::class) ->disableOriginalConstructor() ->getMock(); - $collectionMock = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + $collectionMock = $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); @@ -598,7 +607,7 @@ public function testGetData() $helper = new ObjectManager($this); $dataProvider = $helper->getObject( - \Magento\Customer\Model\Customer\DataProvider::class, + CustomerDataProvider::class, [ 'name' => 'test-name', 'primaryFieldName' => 'primary-field-name', @@ -606,7 +615,7 @@ public function testGetData() 'eavValidationRules' => $this->eavValidationRulesMock, 'customerCollectionFactory' => $this->customerCollectionFactoryMock, 'eavConfig' => $this->getEavConfigMock(), - 'fileUploaderDataResolver' => $this->fileUploaderDataResolver + 'fileUploaderDataResolver' => $this->fileUploaderDataResolver, ] ); @@ -635,9 +644,9 @@ public function testGetData() 'street' => "street\nstreet", 'default_billing' => 2, 'default_shipping' => 2, - ] - ] - ] + ], + ], + ], ], $dataProvider->getData() ); @@ -671,13 +680,13 @@ public function testGetDataWithCustomerFormData() ], ]; - $customer = $this->getMockBuilder(\Magento\Customer\Model\Customer::class) + $customer = $this->getMockBuilder(Customer::class) ->disableOriginalConstructor() ->getMock(); - $address = $this->getMockBuilder(\Magento\Customer\Model\Address::class) + $address = $this->getMockBuilder(Address::class) ->disableOriginalConstructor() ->getMock(); - $collectionMock = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + $collectionMock = $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); @@ -694,11 +703,13 @@ public function testGetDataWithCustomerFormData() ->willReturn([$customer]); $customer->expects($this->once()) ->method('getData') - ->willReturn([ - 'email' => 'test@test.ua', - 'default_billing' => 2, - 'default_shipping' => 2, - ]); + ->willReturn( + [ + 'email' => 'test@test.ua', + 'default_billing' => 2, + 'default_shipping' => 2, + ] + ); $customer->expects($this->once()) ->method('getId') ->willReturn($customerId); @@ -714,14 +725,16 @@ public function testGetDataWithCustomerFormData() ->willReturnSelf(); $address->expects($this->once()) ->method('getData') - ->willReturn([ - 'firstname' => 'firstname', - 'lastname' => 'lastname', - 'street' => "street\nstreet", - ]); + ->willReturn( + [ + 'firstname' => 'firstname', + 'lastname' => 'lastname', + 'street' => "street\nstreet", + ] + ); $helper = new ObjectManager($this); $dataProvider = $helper->getObject( - \Magento\Customer\Model\Customer\DataProvider::class, + CustomerDataProvider::class, [ 'name' => 'test-name', 'primaryFieldName' => 'primary-field-name', @@ -729,7 +742,7 @@ public function testGetDataWithCustomerFormData() 'eavValidationRules' => $this->eavValidationRulesMock, 'customerCollectionFactory' => $this->customerCollectionFactoryMock, 'eavConfig' => $this->getEavConfigMock(), - 'fileUploaderDataResolver' => $this->fileUploaderDataResolver + 'fileUploaderDataResolver' => $this->fileUploaderDataResolver, ] ); @@ -758,22 +771,24 @@ public function testGetDataWithCustomAttributeImage() $filename = '/filename.ext1'; - $customerMock = $this->getMockBuilder(\Magento\Customer\Model\Customer::class) + $customerMock = $this->getMockBuilder(Customer::class) ->disableOriginalConstructor() ->getMock(); $customerMock->expects($this->once()) ->method('getData') - ->willReturn([ - 'email' => $customerEmail, - 'img1' => $filename, - ]); + ->willReturn( + [ + 'email' => $customerEmail, + 'img1' => $filename, + ] + ); $customerMock->expects($this->once()) ->method('getAddresses') ->willReturn([]); $customerMock->expects($this->once()) ->method('getId') ->willReturn($customerId); - $collectionMock = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + $collectionMock = $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); $collectionMock->expects($this->once()) @@ -790,7 +805,7 @@ public function testGetDataWithCustomAttributeImage() $objectManager = new ObjectManager($this); $dataProvider = $objectManager->getObject( - \Magento\Customer\Model\Customer\DataProvider::class, + CustomerDataProvider::class, [ 'name' => 'test-name', 'primaryFieldName' => 'primary-field-name', @@ -798,7 +813,7 @@ public function testGetDataWithCustomAttributeImage() 'eavValidationRules' => $this->eavValidationRulesMock, 'customerCollectionFactory' => $this->customerCollectionFactoryMock, 'eavConfig' => $this->getEavConfigMock(), - 'fileUploaderDataResolver' => $this->fileUploaderDataResolver + 'fileUploaderDataResolver' => $this->fileUploaderDataResolver, ] ); @@ -830,7 +845,7 @@ public function testGetAttributesMetaWithCustomAttributeImage() $attributeCode = 'img1'; - $collectionMock = $this->getMockBuilder(\Magento\Customer\Model\ResourceModel\Customer\Collection::class) + $collectionMock = $this->getMockBuilder(Collection::class) ->disableOriginalConstructor() ->getMock(); $collectionMock->expects($this->once()) @@ -841,12 +856,14 @@ public function testGetAttributesMetaWithCustomAttributeImage() ->method('create') ->willReturn($collectionMock); - $attributeMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class) - ->setMethods([ - 'getAttributeCode', - 'getFrontendInput', - 'getDataUsingMethod', - ]) + $attributeMock = $this->getMockBuilder(AbstractAttribute::class) + ->setMethods( + [ + 'getAttributeCode', + 'getFrontendInput', + 'getDataUsingMethod', + ] + ) ->disableOriginalConstructor() ->getMockForAbstractClass(); $attributeMock->expects($this->any()) @@ -863,7 +880,7 @@ function ($origName) { } ); - $typeCustomerMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Type::class) + $typeCustomerMock = $this->getMockBuilder(Type::class) ->disableOriginalConstructor() ->getMock(); $typeCustomerMock->expects($this->once()) @@ -873,7 +890,7 @@ function ($origName) { ->method('getEntityTypeCode') ->willReturn(CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER); - $typeAddressMock = $this->getMockBuilder(\Magento\Eav\Model\Entity\Type::class) + $typeAddressMock = $this->getMockBuilder(Type::class) ->disableOriginalConstructor() ->getMock(); $typeAddressMock->expects($this->once()) @@ -891,32 +908,37 @@ function ($origName) { $this->eavValidationRulesMock->expects($this->once()) ->method('build') - ->with($attributeMock, [ - 'dataType' => 'frontend_input', - 'formElement' => 'frontend_input', - 'visible' => 'is_visible', - 'required' => 'is_required', - 'sortOrder' => 'sort_order', - 'notice' => 'note', - 'default' => 'default_value', - 'size' => 'multiline_count', - 'label' => __('frontend_label'), - ]) - ->willReturn([ - 'max_file_size' => $maxFileSize, - 'file_extensions' => 'ext1, eXt2 ', // Added spaces and upper-cases - ]); + ->with( + $attributeMock, + [ + 'dataType' => 'frontend_input', + 'formElement' => 'frontend_input', + 'visible' => 'is_visible', + 'required' => 'is_required', + 'sortOrder' => 'sort_order', + 'notice' => 'note', + 'default' => 'default_value', + 'size' => 'multiline_count', + 'label' => __('frontend_label'), + ] + ) + ->willReturn( + [ + 'max_file_size' => $maxFileSize, + 'file_extensions' => 'ext1, eXt2 ', // Added spaces and upper-cases + ] + ); $objectManager = new ObjectManager($this); $dataProvider = $objectManager->getObject( - \Magento\Customer\Model\Customer\DataProvider::class, + CustomerDataProvider::class, [ 'name' => 'test-name', 'primaryFieldName' => 'primary-field-name', 'requestFieldName' => 'request-field-name', 'eavValidationRules' => $this->eavValidationRulesMock, 'customerCollectionFactory' => $this->customerCollectionFactoryMock, - 'eavConfig' => $this->eavConfigMock + 'eavConfig' => $this->eavConfigMock, ] ); @@ -974,13 +996,13 @@ public function testGetDataWithVisibleAttributes() 'visible' => true, 'is_used_in_forms' => ['customer_account_edit'], 'user_defined' => true, - 'specific_code_prefix' => "_1" + 'specific_code_prefix' => "_1", ], 'test-code-boolean' => [ 'visible' => true, 'is_used_in_forms' => ['customer_account_create'], 'user_defined' => true, - 'specific_code_prefix' => "_1" + 'specific_code_prefix' => "_1", ] ] ); @@ -991,21 +1013,21 @@ public function testGetDataWithVisibleAttributes() 'visible' => true, 'is_used_in_forms' => ['customer_account_create'], 'user_defined' => false, - 'specific_code_prefix' => "_2" + 'specific_code_prefix' => "_2", ], 'test-code-boolean' => [ 'visible' => true, 'is_used_in_forms' => ['customer_account_create'], 'user_defined' => true, - 'specific_code_prefix' => "_2" + 'specific_code_prefix' => "_2", ] ] ); $helper = new ObjectManager($this); - /** @var \Magento\Customer\Model\Customer\DataProvider $dataProvider */ + /** @var DataProvider $dataProvider */ $dataProvider = $helper->getObject( - \Magento\Customer\Model\Customer\DataProvider::class, + CustomerDataProvider::class, [ 'name' => 'test-name', 'primaryFieldName' => 'primary-field-name', @@ -1013,7 +1035,7 @@ public function testGetDataWithVisibleAttributes() 'eavValidationRules' => $this->eavValidationRulesMock, 'customerCollectionFactory' => $this->getCustomerCollectionFactoryMock(), 'eavConfig' => $this->getEavConfigMock(array_merge($firstAttributesBundle, $secondAttributesBundle)), - 'fileUploaderDataResolver' => $this->fileUploaderDataResolver + 'fileUploaderDataResolver' => $this->fileUploaderDataResolver, ] ); @@ -1034,13 +1056,13 @@ public function testGetDataWithVisibleAttributesWithAccountEdit() 'visible' => true, 'is_used_in_forms' => ['customer_account_edit'], 'user_defined' => true, - 'specific_code_prefix' => "_1" + 'specific_code_prefix' => "_1", ], 'test-code-boolean' => [ 'visible' => true, 'is_used_in_forms' => ['customer_account_create'], 'user_defined' => true, - 'specific_code_prefix' => "_1" + 'specific_code_prefix' => "_1", ] ] ); @@ -1051,28 +1073,28 @@ public function testGetDataWithVisibleAttributesWithAccountEdit() 'visible' => true, 'is_used_in_forms' => ['customer_account_create'], 'user_defined' => false, - 'specific_code_prefix' => "_2" + 'specific_code_prefix' => "_2", ], 'test-code-boolean' => [ 'visible' => true, 'is_used_in_forms' => ['customer_account_create'], 'user_defined' => true, - 'specific_code_prefix' => "_2" + 'specific_code_prefix' => "_2", ] ] ); $helper = new ObjectManager($this); - $context = $this->getMockBuilder(\Magento\Framework\View\Element\UiComponent\ContextInterface::class) + $context = $this->getMockBuilder(ContextInterface::class) ->setMethods(['getRequestParam']) ->getMockForAbstractClass(); $context->expects($this->any()) ->method('getRequestParam') ->with('request-field-name') ->willReturn(1); - /** @var \Magento\Customer\Model\Customer\DataProvider $dataProvider */ + /** @var DataProvider $dataProvider */ $dataProvider = $helper->getObject( - \Magento\Customer\Model\Customer\DataProvider::class, + CustomerDataProvider::class, [ 'name' => 'test-name', 'primaryFieldName' => 'primary-field-name', @@ -1081,7 +1103,7 @@ public function testGetDataWithVisibleAttributesWithAccountEdit() 'customerCollectionFactory' => $this->getCustomerCollectionFactoryMock(), 'context' => $context, 'eavConfig' => $this->getEavConfigMock(array_merge($firstAttributesBundle, $secondAttributesBundle)), - 'fileUploaderDataResolver' => $this->fileUploaderDataResolver + 'fileUploaderDataResolver' => $this->fileUploaderDataResolver, ] ); @@ -1092,7 +1114,7 @@ public function testGetDataWithVisibleAttributesWithAccountEdit() } /** - * Retrieve all customer variations of attributes with all variations of visibility + * Retrieve all customer variations of attributes with all variations of visibility. * * @return array */ @@ -1187,7 +1209,7 @@ private function getCustomerAttributeExpectations() } /** - * Retrieve all variations of attributes with all variations of visibility + * Retrieve all variations of attributes with all variations of visibility. * * @return array */ @@ -1258,12 +1280,12 @@ private function getExpectationForVisibleAttributes() 'componentType' => Field::NAME, 'filterBy' => [ 'target' => '${ $.provider }:data.customer.website_id', - 'field' => 'website_ids' - ] + 'field' => 'website_ids', + ], ], ], ], - ] + ], ], ], ]; From 3028d51664074ec55380a9408cc7fa15d1069503 Mon Sep 17 00:00:00 2001 From: Harald Deiser <h.deiser@techdivision.com> Date: Wed, 22 May 2019 17:35:57 +0200 Subject: [PATCH 077/230] MC-16705: Update composer.json for 7.3 --- composer.json | 16 +- composer.lock | 1195 ++++++++++++++++++++++--------------------------- 2 files changed, 542 insertions(+), 669 deletions(-) diff --git a/composer.json b/composer.json index 4f235d4622cc..1d6c794f947b 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "ext-bcmath": "*", "ext-ctype": "*", "ext-curl": "*", @@ -36,7 +36,7 @@ "colinmollenhour/php-redis-session-abstract": "~1.4.0", "composer/composer": "^1.6", "elasticsearch/elasticsearch": "~2.0|~5.1|~6.1", - "magento/composer": "~1.4.0", + "magento/composer": "dev-master", "magento/magento-composer-installer": ">=0.1.11", "magento/zendframework1": "~1.14.1", "monolog/monolog": "^1.17", @@ -60,7 +60,7 @@ "zendframework/zend-crypt": "^2.6.0", "zendframework/zend-db": "^2.8.2", "zendframework/zend-di": "^2.6.1", - "zendframework/zend-eventmanager": "^2.6.3", + "zendframework/zend-eventmanager": "^3.0.0", "zendframework/zend-feed": "^2.9.0", "zendframework/zend-form": "^2.10.0", "zendframework/zend-http": "^2.6.0", @@ -75,7 +75,7 @@ "zendframework/zend-servicemanager": "^2.7.8", "zendframework/zend-session": "^2.7.3", "zendframework/zend-soap": "^2.7.0", - "zendframework/zend-stdlib": "^2.7.7", + "zendframework/zend-stdlib": "^3.2.1", "zendframework/zend-text": "^2.6.0", "zendframework/zend-uri": "^2.5.1", "zendframework/zend-validator": "^2.6.0", @@ -84,7 +84,7 @@ }, "require-dev": { "allure-framework/allure-phpunit": "~1.2.0", - "friendsofphp/php-cs-fixer": "~2.13.0", + "friendsofphp/php-cs-fixer": "~2.14.0", "lusitanian/oauth": "~0.8.10", "magento/magento-coding-standard": "~1.0.0", "magento/magento2-functional-testing-framework": "~2.4.1", @@ -334,5 +334,11 @@ "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/" } }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/magento/composer" + } + ], "prefer-stable": true } diff --git a/composer.lock b/composer.lock index 413e700c87b1..bc72c69760d7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ad16b0301a9bb01887ee4504b5f6a842", + "content-hash": "0d1d76199a3ce384dc07177d2710a6c5", "packages": [ { "name": "braintree/braintree_php", @@ -55,16 +55,16 @@ }, { "name": "colinmollenhour/cache-backend-file", - "version": "v1.4.5", + "version": "v1.4.4", "source": { "type": "git", "url": "https://github.com/colinmollenhour/Cm_Cache_Backend_File.git", - "reference": "03c7d4c0f43b2de1b559a3527d18ff697d306544" + "reference": "184171cc79933a828c3f9b1a1054724cea22a216" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_File/zipball/03c7d4c0f43b2de1b559a3527d18ff697d306544", - "reference": "03c7d4c0f43b2de1b559a3527d18ff697d306544", + "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_File/zipball/184171cc79933a828c3f9b1a1054724cea22a216", + "reference": "184171cc79933a828c3f9b1a1054724cea22a216", "shasum": "" }, "type": "magento-module", @@ -84,7 +84,7 @@ ], "description": "The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the number of cached items increases. This backend makes many changes resulting in a huge performance boost, especially for tag cleaning.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_File", - "time": "2019-04-18T21:54:31+00:00" + "time": "2018-04-05T15:28:43+00:00" }, { "name": "colinmollenhour/cache-backend-redis", @@ -257,16 +257,16 @@ }, { "name": "composer/composer", - "version": "1.8.6", + "version": "1.8.4", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "19b5f66a0e233eb944f134df34091fe1c5dfcc11" + "reference": "bc364c2480c17941e2135cfc568fa41794392534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/19b5f66a0e233eb944f134df34091fe1c5dfcc11", - "reference": "19b5f66a0e233eb944f134df34091fe1c5dfcc11", + "url": "https://api.github.com/repos/composer/composer/zipball/bc364c2480c17941e2135cfc568fa41794392534", + "reference": "bc364c2480c17941e2135cfc568fa41794392534", "shasum": "" }, "require": { @@ -333,7 +333,7 @@ "dependency", "package" ], - "time": "2019-06-11T13:03:06+00:00" + "time": "2019-02-11T09:52:10+00:00" }, { "name": "composer/semver", @@ -459,16 +459,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.3.3", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" + "reference": "d17708133b6c276d6e42ef887a877866b909d892" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892", + "reference": "d17708133b6c276d6e42ef887a877866b909d892", "shasum": "" }, "require": { @@ -499,7 +499,7 @@ "Xdebug", "performance" ], - "time": "2019-05-27T17:52:04+00:00" + "time": "2019-01-28T20:25:53+00:00" }, { "name": "container-interop/container-interop", @@ -534,16 +534,16 @@ }, { "name": "elasticsearch/elasticsearch", - "version": "v6.7.1", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "7be453dd36d1b141b779f2cb956715f8e04ac2f4" + "reference": "b237a37b2cdf23a5a17fd3576cdea771394ad00d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/7be453dd36d1b141b779f2cb956715f8e04ac2f4", - "reference": "7be453dd36d1b141b779f2cb956715f8e04ac2f4", + "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/b237a37b2cdf23a5a17fd3576cdea771394ad00d", + "reference": "b237a37b2cdf23a5a17fd3576cdea771394ad00d", "shasum": "" }, "require": { @@ -553,12 +553,12 @@ "psr/log": "~1.0" }, "require-dev": { - "cpliakas/git-wrapper": "^1.7 || ^2.1", + "cpliakas/git-wrapper": "~1.0", "doctrine/inflector": "^1.1", - "mockery/mockery": "^1.2", - "phpstan/phpstan-shim": "^0.9 || ^0.11", - "phpunit/phpunit": "^5.7 || ^6.5", - "squizlabs/php_codesniffer": "^3.4", + "mockery/mockery": "0.9.4", + "phpstan/phpstan-shim": "0.8.3", + "phpunit/phpunit": "6.3.0", + "squizlabs/php_codesniffer": "3.0.2", "symfony/finder": "^2.8", "symfony/yaml": "^2.8" }, @@ -579,9 +579,6 @@ "authors": [ { "name": "Zachary Tong" - }, - { - "name": "Enrico Zimuel" } ], "description": "PHP Client for Elasticsearch", @@ -590,190 +587,7 @@ "elasticsearch", "search" ], - "time": "2019-05-20T14:15:55+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.3.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.3-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2018-04-22T15:46:56+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.5.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "9f83dded91781a01c63574e387eaa769be769115" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", - "reference": "9f83dded91781a01c63574e387eaa769be769115", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2018-12-04T20:46:45+00:00" + "time": "2019-01-08T18:53:46+00:00" }, { "name": "guzzlehttp/ringphp", @@ -944,21 +758,21 @@ }, { "name": "magento/composer", - "version": "1.4.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/magento/composer.git", - "reference": "6fb9eb3dd72a5e70aa53983f132f8e1883e79978" + "reference": "e79070bc6fa9e3967b6db693e425c3f6fa493712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/composer/zipball/6fb9eb3dd72a5e70aa53983f132f8e1883e79978", - "reference": "6fb9eb3dd72a5e70aa53983f132f8e1883e79978", + "url": "https://api.github.com/repos/magento/composer/zipball/e79070bc6fa9e3967b6db693e425c3f6fa493712", + "reference": "e79070bc6fa9e3967b6db693e425c3f6fa493712", "shasum": "" }, "require": { "composer/composer": "^1.6", - "php": "~7.1.3|~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "symfony/console": "~4.0.0 || ~4.1.0" }, "require-dev": { @@ -970,13 +784,16 @@ "Magento\\Composer\\": "src" } }, - "notification-url": "https://packagist.org/downloads/", "license": [ "OSL-3.0", "AFL-3.0" ], "description": "Magento composer library helps to instantiate Composer application and run composer commands.", - "time": "2018-06-29T18:46:51+00:00" + "support": { + "source": "https://github.com/magento/composer/tree/master", + "issues": "https://github.com/magento/composer/issues" + }, + "time": "2019-05-21T16:27:33+00:00" }, { "name": "magento/magento-composer-installer", @@ -1291,16 +1108,16 @@ }, { "name": "paragonie/sodium_compat", - "version": "v1.10.0", + "version": "v1.9.1", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "228a9fc64cf4ba84c7967c1076d94209db03e0ee" + "reference": "87125d5b265f98c4d1b8d83a1f0726607c229421" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/228a9fc64cf4ba84c7967c1076d94209db03e0ee", - "reference": "228a9fc64cf4ba84c7967c1076d94209db03e0ee", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/87125d5b265f98c4d1b8d83a1f0726607c229421", + "reference": "87125d5b265f98c4d1b8d83a1f0726607c229421", "shasum": "" }, "require": { @@ -1369,7 +1186,7 @@ "secret-key cryptography", "side-channel resistant" ], - "time": "2019-05-13T16:04:50+00:00" + "time": "2019-03-20T17:19:05+00:00" }, { "name": "pelago/emogrifier", @@ -1567,16 +1384,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.18", + "version": "2.0.15", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "60519001db8d791215a822efd366d24cafee9e63" + "reference": "11cf67cf78dc4acb18dc9149a57be4aee5036ce0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/60519001db8d791215a822efd366d24cafee9e63", - "reference": "60519001db8d791215a822efd366d24cafee9e63", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/11cf67cf78dc4acb18dc9149a57be4aee5036ce0", + "reference": "11cf67cf78dc4acb18dc9149a57be4aee5036ce0", "shasum": "" }, "require": { @@ -1655,7 +1472,7 @@ "x.509", "x509" ], - "time": "2019-06-13T06:15:54+00:00" + "time": "2019-03-10T16:53:45+00:00" }, { "name": "psr/container", @@ -1803,46 +1620,6 @@ ], "time": "2018-11-20T15:27:04+00:00" }, - { - "name": "ralouphie/getallheaders", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "~3.7.0", - "satooshi/php-coveralls": ">=1.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "time": "2016-02-11T07:05:27+00:00" - }, { "name": "ramsey/uuid", "version": "3.8.0", @@ -2066,7 +1843,7 @@ }, { "name": "symfony/console", - "version": "v4.1.12", + "version": "v4.1.11", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -2137,16 +1914,16 @@ }, { "name": "symfony/css-selector", - "version": "v4.3.1", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "105c98bb0c5d8635bea056135304bd8edcc42b4d" + "reference": "48eddf66950fa57996e1be4a55916d65c10c604a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/105c98bb0c5d8635bea056135304bd8edcc42b4d", - "reference": "105c98bb0c5d8635bea056135304bd8edcc42b4d", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/48eddf66950fa57996e1be4a55916d65c10c604a", + "reference": "48eddf66950fa57996e1be4a55916d65c10c604a", "shasum": "" }, "require": { @@ -2155,7 +1932,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2186,11 +1963,11 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-01-16T21:53:39+00:00" + "time": "2019-01-16T20:31:39+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.1.12", + "version": "v4.1.11", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2253,16 +2030,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.1", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf" + "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/bf2af40d738dec5e433faea7b00daa4431d0a4cf", - "reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e16b9e471703b2c60b95f14d31c1239f68f11601", + "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601", "shasum": "" }, "require": { @@ -2272,7 +2049,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2299,20 +2076,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-06-03T20:27:40+00:00" + "time": "2019-02-07T11:40:08+00:00" }, { "name": "symfony/finder", - "version": "v4.3.1", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "b3d4f4c0e4eadfdd8b296af9ca637cfbf51d8176" + "reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/b3d4f4c0e4eadfdd8b296af9ca637cfbf51d8176", - "reference": "b3d4f4c0e4eadfdd8b296af9ca637cfbf51d8176", + "url": "https://api.github.com/repos/symfony/finder/zipball/267b7002c1b70ea80db0833c3afe05f0fbde580a", + "reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a", "shasum": "" }, "require": { @@ -2321,7 +2098,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2348,7 +2125,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-05-26T20:47:49+00:00" + "time": "2019-02-23T15:42:05+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2395,7 +2172,7 @@ }, { "name": "Gert de Pagter", - "email": "backendtea@gmail.com" + "email": "BackEndTea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -2469,7 +2246,7 @@ }, { "name": "symfony/process", - "version": "v4.1.12", + "version": "v4.1.11", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -2518,16 +2295,16 @@ }, { "name": "tedivm/jshrink", - "version": "v1.3.2", + "version": "v1.3.1", "source": { "type": "git", "url": "https://github.com/tedious/JShrink.git", - "reference": "d9b51729f3c6692c2da3e3fe6c5cd7c9d1d3fa8f" + "reference": "21254058dc3ce6aba6bef458cff4bfa25cf8b198" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tedious/JShrink/zipball/d9b51729f3c6692c2da3e3fe6c5cd7c9d1d3fa8f", - "reference": "d9b51729f3c6692c2da3e3fe6c5cd7c9d1d3fa8f", + "url": "https://api.github.com/repos/tedious/JShrink/zipball/21254058dc3ce6aba6bef458cff4bfa25cf8b198", + "reference": "21254058dc3ce6aba6bef458cff4bfa25cf8b198", "shasum": "" }, "require": { @@ -2560,7 +2337,7 @@ "javascript", "minifier" ], - "time": "2019-06-15T23:11:19+00:00" + "time": "2018-09-16T00:02:51+00:00" }, { "name": "true/punycode", @@ -3192,33 +2969,37 @@ }, { "name": "zendframework/zend-eventmanager", - "version": "2.6.4", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "d238c443220dce4b6396579c8ab2200ec25f9108" + "reference": "a5e2583a211f73604691586b8406ff7296a946dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/d238c443220dce4b6396579c8ab2200ec25f9108", - "reference": "d238c443220dce4b6396579c8ab2200ec25f9108", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-stdlib": "^2.7" + "php": "^5.6 || ^7.0" }, "require-dev": { - "athletic/athletic": "dev-master", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" }, "type": "library", "extra": { "branch-alias": { - "dev-release-2.6": "2.6-dev", - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" } }, "autoload": { @@ -3230,12 +3011,15 @@ "license": [ "BSD-3-Clause" ], + "description": "Trigger and listen to events within a PHP application", "homepage": "https://github.com/zendframework/zend-eventmanager", "keywords": [ + "event", "eventmanager", + "events", "zf2" ], - "time": "2017-12-12T17:48:56+00:00" + "time": "2018-04-25T15:33:34+00:00" }, { "name": "zendframework/zend-feed", @@ -4442,16 +4226,16 @@ }, { "name": "zendframework/zend-soap", - "version": "2.8.0", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-soap.git", - "reference": "8762d79efa220d82529c43ce08d70554146be645" + "reference": "af03c32f0db2b899b3df8cfe29aeb2b49857d284" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-soap/zipball/8762d79efa220d82529c43ce08d70554146be645", - "reference": "8762d79efa220d82529c43ce08d70554146be645", + "url": "https://api.github.com/repos/zendframework/zend-soap/zipball/af03c32f0db2b899b3df8cfe29aeb2b49857d284", + "reference": "af03c32f0db2b899b3df8cfe29aeb2b49857d284", "shasum": "" }, "require": { @@ -4491,49 +4275,35 @@ "soap", "zf2" ], - "time": "2019-04-30T16:45:35+00:00" + "time": "2018-01-29T17:51:26+00:00" }, { "name": "zendframework/zend-stdlib", - "version": "2.7.7", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f" + "reference": "66536006722aff9e62d1b331025089b7ec71c065" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/0e44eb46788f65e09e077eb7f44d2659143bcc1f", - "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/66536006722aff9e62d1b331025089b7ec71c065", + "reference": "66536006722aff9e62d1b331025089b7ec71c065", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-hydrator": "~1.1" + "php": "^5.6 || ^7.0" }, "require-dev": { - "athletic/athletic": "~0.1", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-config": "~2.5", - "zendframework/zend-eventmanager": "~2.5", - "zendframework/zend-filter": "~2.5", - "zendframework/zend-inputfilter": "~2.5", - "zendframework/zend-serializer": "~2.5", - "zendframework/zend-servicemanager": "~2.5" - }, - "suggest": { - "zendframework/zend-eventmanager": "To support aggregate hydrator usage", - "zendframework/zend-filter": "To support naming strategy hydrator usage", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-release-2.7": "2.7-dev", - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" } }, "autoload": { @@ -4545,12 +4315,13 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-stdlib", + "description": "SPL extensions, array utilities, error handlers, and more", "keywords": [ + "ZendFramework", "stdlib", - "zf2" + "zf" ], - "time": "2016-04-12T21:17:31+00:00" + "time": "2018-08-28T21:34:05+00:00" }, { "name": "zendframework/zend-text", @@ -5457,16 +5228,16 @@ }, { "name": "consolidation/output-formatters", - "version": "3.5.0", + "version": "3.4.1", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "99ec998ffb697e0eada5aacf81feebfb13023605" + "reference": "0881112642ad9059071f13f397f571035b527cb9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/99ec998ffb697e0eada5aacf81feebfb13023605", - "reference": "99ec998ffb697e0eada5aacf81feebfb13023605", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/0881112642ad9059071f13f397f571035b527cb9", + "reference": "0881112642ad9059071f13f397f571035b527cb9", "shasum": "" }, "require": { @@ -5554,7 +5325,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2019-05-30T23:16:01+00:00" + "time": "2019-03-14T03:45:44+00:00" }, { "name": "consolidation/robo", @@ -5843,16 +5614,16 @@ }, { "name": "doctrine/collections", - "version": "v1.6.2", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be" + "reference": "d2ae4ef05e25197343b6a39bae1d3c427a2f6956" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/c5e0bc17b1620e97c968ac409acbff28b8b850be", - "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be", + "url": "https://api.github.com/repos/doctrine/collections/zipball/d2ae4ef05e25197343b6a39bae1d3c427a2f6956", + "reference": "d2ae4ef05e25197343b6a39bae1d3c427a2f6956", "shasum": "" }, "require": { @@ -5909,7 +5680,7 @@ "iterators", "php" ], - "time": "2019-06-09T13:48:14+00:00" + "time": "2019-03-25T19:03:48+00:00" }, { "name": "doctrine/instantiator", @@ -5969,24 +5740,21 @@ }, { "name": "doctrine/lexer", - "version": "1.0.2", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", + "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", "shasum": "" }, "require": { "php": ">=5.3.2" }, - "require-dev": { - "phpunit/phpunit": "^4.5" - }, "type": "library", "extra": { "branch-alias": { @@ -5994,8 +5762,8 @@ } }, "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "psr-0": { + "Doctrine\\Common\\Lexer\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -6016,16 +5784,13 @@ "email": "schmittjoh@gmail.com" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "http://www.doctrine-project.org", "keywords": [ - "annotations", - "docblock", "lexer", - "parser", - "php" + "parser" ], - "time": "2019-06-08T11:03:04+00:00" + "time": "2014-09-09T13:34:57+00:00" }, { "name": "epfremme/swagger-php", @@ -6075,16 +5840,16 @@ }, { "name": "facebook/webdriver", - "version": "1.7.1", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/facebook/php-webdriver.git", - "reference": "e43de70f3c7166169d0f14a374505392734160e5" + "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/e43de70f3c7166169d0f14a374505392734160e5", - "reference": "e43de70f3c7166169d0f14a374505392734160e5", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/bd8c740097eb9f2fc3735250fc1912bc811a954e", + "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e", "shasum": "" }, "require": { @@ -6131,7 +5896,7 @@ "selenium", "webdriver" ], - "time": "2019-06-13T08:02:18+00:00" + "time": "2018-05-16T17:37:13+00:00" }, { "name": "flow/jsonpath", @@ -6176,16 +5941,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.13.3", + "version": "v2.14.3", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "38d6f2e9be2aa80bf3c7365612af7f9eb9078719" + "reference": "a9132a872dab61e37161c6db2fb8a6f46141d17e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/38d6f2e9be2aa80bf3c7365612af7f9eb9078719", - "reference": "38d6f2e9be2aa80bf3c7365612af7f9eb9078719", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/a9132a872dab61e37161c6db2fb8a6f46141d17e", + "reference": "a9132a872dab61e37161c6db2fb8a6f46141d17e", "shasum": "" }, "require": { @@ -6194,7 +5959,7 @@ "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || >=7.0 <7.3", + "php": "^5.6 || ^7.0", "php-cs-fixer/diff": "^1.3", "symfony/console": "^3.4.17 || ^4.1.6", "symfony/event-dispatcher": "^3.0 || ^4.0", @@ -6206,9 +5971,6 @@ "symfony/process": "^3.0 || ^4.0", "symfony/stopwatch": "^3.0 || ^4.0" }, - "conflict": { - "hhvm": "*" - }, "require-dev": { "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", "justinrainbow/json-schema": "^5.0", @@ -6216,10 +5978,10 @@ "mikey179/vfsstream": "^1.6", "php-coveralls/php-coveralls": "^2.1", "php-cs-fixer/accessible-object": "^1.0", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1", "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1", - "phpunitgoodpractices/traits": "^1.5.1", + "phpunitgoodpractices/traits": "^1.8", "symfony/phpunit-bridge": "^4.0" }, "suggest": { @@ -6263,7 +6025,7 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2019-01-04T18:24:28+00:00" + "time": "2019-05-04T21:34:42+00:00" }, { "name": "fzaninotto/faker", @@ -6410,6 +6172,189 @@ "description": "Expands internal property references in a yaml file.", "time": "2017-12-16T16:06:03+00:00" }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "9f83dded91781a01c63574e387eaa769be769115" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2018-12-04T20:46:45+00:00" + }, { "name": "jms/metadata", "version": "1.7.0", @@ -6502,16 +6447,16 @@ }, { "name": "jms/serializer", - "version": "1.14.0", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/serializer.git", - "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca" + "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", - "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/00863e1d55b411cc33ad3e1de09a4c8d3aae793c", + "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c", "shasum": "" }, "require": { @@ -6551,7 +6496,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.14-dev" + "dev-1.x": "1.13-dev" } }, "autoload": { @@ -6582,7 +6527,7 @@ "serialization", "xml" ], - "time": "2019-04-17T08:12:16+00:00" + "time": "2018-07-25T13:58:54+00:00" }, { "name": "league/container", @@ -6718,16 +6663,16 @@ }, { "name": "magento/magento-coding-standard", - "version": "1.0.2", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/magento/magento-coding-standard.git", - "reference": "f7de26fb6add389d1b42286f67ee87424588a868" + "reference": "489029a285c637825294e272d31c3f4ac00a454e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/f7de26fb6add389d1b42286f67ee87424588a868", - "reference": "f7de26fb6add389d1b42286f67ee87424588a868", + "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/489029a285c637825294e272d31c3f4ac00a454e", + "reference": "489029a285c637825294e272d31c3f4ac00a454e", "shasum": "" }, "require": { @@ -6744,20 +6689,20 @@ "AFL-3.0" ], "description": "A set of Magento specific PHP CodeSniffer rules.", - "time": "2019-04-05T19:05:17+00:00" + "time": "2019-04-01T17:03:33+00:00" }, { "name": "magento/magento2-functional-testing-framework", - "version": "2.4.1", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/magento/magento2-functional-testing-framework.git", - "reference": "9b5de03fe069d4a36c911112c30b824ff4e80c3a" + "reference": "ef534dbcb3aeea68f9254dfd018165c546ad2edb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/9b5de03fe069d4a36c911112c30b824ff4e80c3a", - "reference": "9b5de03fe069d4a36c911112c30b824ff4e80c3a", + "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/ef534dbcb3aeea68f9254dfd018165c546ad2edb", + "reference": "ef534dbcb3aeea68f9254dfd018165c546ad2edb", "shasum": "" }, "require": { @@ -6817,20 +6762,20 @@ "magento", "testing" ], - "time": "2019-06-10T17:57:40+00:00" + "time": "2019-04-29T20:56:26+00:00" }, { - "name": "mikey179/vfsstream", - "version": "v1.6.6", + "name": "mikey179/vfsStream", + "version": "v1.6.5", "source": { "type": "git", "url": "https://github.com/bovigo/vfsStream.git", - "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d" + "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/095238a0711c974ae5b4ebf4c4534a23f3f6c99d", - "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", "shasum": "" }, "require": { @@ -6863,7 +6808,7 @@ ], "description": "Virtual file system to mock the real file system in unit tests.", "homepage": "http://vfs.bovigo.org/", - "time": "2019-04-08T13:54:32+00:00" + "time": "2017-08-01T08:02:14+00:00" }, { "name": "moontoast/math", @@ -6962,16 +6907,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.9.1", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", - "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { @@ -7006,7 +6951,7 @@ "object", "object graph" ], - "time": "2019-04-07T13:18:21+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "pdepend/pdepend", @@ -7305,16 +7250,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.1", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", "shasum": "" }, "require": { @@ -7352,7 +7297,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-04-30T17:48:53+00:00" + "time": "2017-11-30T07:14:17+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -7519,16 +7464,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.8.1", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { @@ -7549,8 +7494,8 @@ } }, "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" + "psr-0": { + "Prophecy\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -7578,7 +7523,7 @@ "spy", "stub" ], - "time": "2019-06-13T12:50:23+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", @@ -7973,6 +7918,46 @@ "abandoned": true, "time": "2018-08-09T05:50:03+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -8674,16 +8659,16 @@ }, { "name": "symfony/browser-kit", - "version": "v4.3.1", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "e07d50e84b8cf489590f22244f4f609579b4a2c4" + "reference": "61d85c5af2fc058014c7c89504c3944e73a086f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e07d50e84b8cf489590f22244f4f609579b4a2c4", - "reference": "e07d50e84b8cf489590f22244f4f609579b4a2c4", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/61d85c5af2fc058014c7c89504c3944e73a086f0", + "reference": "61d85c5af2fc058014c7c89504c3944e73a086f0", "shasum": "" }, "require": { @@ -8692,8 +8677,6 @@ }, "require-dev": { "symfony/css-selector": "~3.4|~4.0", - "symfony/http-client": "^4.3", - "symfony/mime": "^4.3", "symfony/process": "~3.4|~4.0" }, "suggest": { @@ -8702,7 +8685,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -8729,20 +8712,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2019-05-30T16:10:05+00:00" + "time": "2019-02-23T15:17:42+00:00" }, { "name": "symfony/config", - "version": "v4.3.1", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "6379ee07398643e09e6ed1e87d9c62dfcad7f4eb" + "reference": "7f70d79c7a24a94f8e98abb988049403a53d7b31" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/6379ee07398643e09e6ed1e87d9c62dfcad7f4eb", - "reference": "6379ee07398643e09e6ed1e87d9c62dfcad7f4eb", + "url": "https://api.github.com/repos/symfony/config/zipball/7f70d79c7a24a94f8e98abb988049403a53d7b31", + "reference": "7f70d79c7a24a94f8e98abb988049403a53d7b31", "shasum": "" }, "require": { @@ -8757,7 +8740,6 @@ "symfony/dependency-injection": "~3.4|~4.0", "symfony/event-dispatcher": "~3.4|~4.0", "symfony/finder": "~3.4|~4.0", - "symfony/messenger": "~4.1", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -8766,7 +8748,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -8793,61 +8775,48 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-05-30T16:10:05+00:00" + "time": "2019-02-23T15:17:42+00:00" }, { - "name": "symfony/dependency-injection", - "version": "v4.3.1", + "name": "symfony/contracts", + "version": "v1.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "fea7f73e278ee0337349a5a68b867fc656bb33f3" + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/fea7f73e278ee0337349a5a68b867fc656bb33f3", - "reference": "fea7f73e278ee0337349a5a68b867fc656bb33f3", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", "shasum": "" }, "require": { - "php": "^7.1.3", - "psr/container": "^1.0", - "symfony/service-contracts": "^1.1.2" - }, - "conflict": { - "symfony/config": "<4.3", - "symfony/finder": "<3.4", - "symfony/proxy-manager-bridge": "<3.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "psr/container-implementation": "1.0", - "symfony/service-implementation": "1.0" + "php": "^7.1.3" }, "require-dev": { - "symfony/config": "^4.3", - "symfony/expression-language": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "psr/cache": "^1.0", + "psr/container": "^1.0" }, "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "1.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" + "Symfony\\Contracts\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "**/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -8856,56 +8825,76 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony DependencyInjection Component", + "description": "A set of abstractions extracted out of the Symfony components", "homepage": "https://symfony.com", - "time": "2019-05-30T16:10:05+00:00" + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" }, { - "name": "symfony/dom-crawler", - "version": "v4.3.1", + "name": "symfony/dependency-injection", + "version": "v4.2.4", "source": { "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "06ee58fbc9a8130f1d35b5280e15235a0515d457" + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "cdadb3765df7c89ac93628743913b92bb91f1704" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/06ee58fbc9a8130f1d35b5280e15235a0515d457", - "reference": "06ee58fbc9a8130f1d35b5280e15235a0515d457", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/cdadb3765df7c89ac93628743913b92bb91f1704", + "reference": "cdadb3765df7c89ac93628743913b92bb91f1704", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0" + "psr/container": "^1.0", + "symfony/contracts": "^1.0" }, "conflict": { - "masterminds/html5": "<2.6" + "symfony/config": "<4.2", + "symfony/finder": "<3.4", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-contracts-implementation": "1.0" }, "require-dev": { - "masterminds/html5": "^2.6", - "symfony/css-selector": "~3.4|~4.0" + "symfony/config": "~4.2", + "symfony/expression-language": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { - "symfony/css-selector": "" + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" + "Symfony\\Component\\DependencyInjection\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -8925,42 +8914,44 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony DomCrawler Component", + "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-05-31T18:55:30+00:00" + "time": "2019-02-23T15:17:42+00:00" }, { - "name": "symfony/http-foundation", - "version": "v4.3.1", + "name": "symfony/dom-crawler", + "version": "v4.2.4", "source": { "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "b7e4945dd9b277cd24e93566e4da0a87956392a9" + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "53c97769814c80a84a8403efcf3ae7ae966d53bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b7e4945dd9b277cd24e93566e4da0a87956392a9", - "reference": "b7e4945dd9b277cd24e93566e4da0a87956392a9", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/53c97769814c80a84a8403efcf3ae7ae966d53bb", + "reference": "53c97769814c80a84a8403efcf3ae7ae966d53bb", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/mime": "^4.3", - "symfony/polyfill-mbstring": "~1.1" + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "predis/predis": "~1.0", - "symfony/expression-language": "~3.4|~4.0" + "symfony/css-selector": "~3.4|~4.0" + }, + "suggest": { + "symfony/css-selector": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" + "Symfony\\Component\\DomCrawler\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -8980,42 +8971,41 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony HttpFoundation Component", + "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2019-06-06T10:05:02+00:00" + "time": "2019-02-23T15:17:42+00:00" }, { - "name": "symfony/mime", - "version": "v4.3.1", + "name": "symfony/http-foundation", + "version": "v4.2.4", "source": { "type": "git", - "url": "https://github.com/symfony/mime.git", - "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b" + "url": "https://github.com/symfony/http-foundation.git", + "reference": "850a667d6254ccf6c61d853407b16f21c4579c77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ec2c5565de60e03f33d4296a655e3273f0ad1f8b", - "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/850a667d6254ccf6c61d853407b16f21c4579c77", + "reference": "850a667d6254ccf6c61d853407b16f21c4579c77", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" + "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "egulias/email-validator": "^2.0", - "symfony/dependency-injection": "~3.4|^4.1" + "predis/predis": "~1.0", + "symfony/expression-language": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Mime\\": "" + "Symfony\\Component\\HttpFoundation\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -9035,26 +9025,22 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "A library to manipulate MIME messages", + "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "keywords": [ - "mime", - "mime-type" - ], - "time": "2019-06-04T09:22:54+00:00" + "time": "2019-02-26T08:03:39+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.3.1", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "914e0edcb7cd0c9f494bc023b1d47534f4542332" + "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/914e0edcb7cd0c9f494bc023b1d47534f4542332", - "reference": "914e0edcb7cd0c9f494bc023b1d47534f4542332", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/3896e5a7d06fd15fa4947694c8dcdd371ff147d1", + "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1", "shasum": "" }, "require": { @@ -9063,7 +9049,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -9095,69 +9081,7 @@ "configuration", "options" ], - "time": "2019-05-10T05:38:46+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.11.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c766e95bec706cdd89903b1eda8afab7d7a6b7af", - "reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.9" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "time": "2019-03-04T13:44:35+00:00" + "time": "2019-02-23T15:17:42+00:00" }, { "name": "symfony/polyfill-php70", @@ -9273,86 +9197,28 @@ ], "time": "2019-02-06T07:57:58+00:00" }, - { - "name": "symfony/service-contracts", - "version": "v1.1.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0", - "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "suggest": { - "psr/container": "", - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-05-28T07:50:59+00:00" - }, { "name": "symfony/stopwatch", - "version": "v4.3.1", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b" + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6b100e9309e8979cf1978ac1778eb155c1f7d93b", - "reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/service-contracts": "^1.0" + "symfony/contracts": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -9379,20 +9245,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-05-27T08:16:38+00:00" + "time": "2019-01-16T20:31:39+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.28", + "version": "v3.4.23", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" + "reference": "57f1ce82c997f5a8701b89ef970e36bb657fd09c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", - "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "url": "https://api.github.com/repos/symfony/yaml/zipball/57f1ce82c997f5a8701b89ef970e36bb657fd09c", + "reference": "57f1ce82c997f5a8701b89ef970e36bb657fd09c", "shasum": "" }, "require": { @@ -9438,7 +9304,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-03-25T07:48:46+00:00" + "time": "2019-02-23T15:06:07+00:00" }, { "name": "theseer/fdomdocument", @@ -9482,16 +9348,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.1.3", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", "shasum": "" }, "require": { @@ -9518,7 +9384,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-06-13T22:48:21+00:00" + "time": "2017-04-07T12:08:54+00:00" }, { "name": "vlucas/phpdotenv", @@ -9626,12 +9492,13 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { + "magento/composer": 20, "phpmd/phpmd": 0 }, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "ext-bcmath": "*", "ext-ctype": "*", "ext-curl": "*", From 392b34fc8ef5379772ffd3c4fedd25b81fa3cb17 Mon Sep 17 00:00:00 2001 From: Harald Deiser <h.deiser@techdivision.com> Date: Mon, 27 May 2019 10:18:17 +0200 Subject: [PATCH 078/230] MC-16192: Added php7.3 composer updates for submodules --- app/code/Magento/AdminNotification/composer.json | 2 +- app/code/Magento/AdvancedPricingImportExport/composer.json | 2 +- app/code/Magento/AdvancedSearch/composer.json | 2 +- app/code/Magento/Amqp/composer.json | 2 +- app/code/Magento/Analytics/composer.json | 2 +- app/code/Magento/AsynchronousOperations/composer.json | 2 +- app/code/Magento/Authorization/composer.json | 2 +- app/code/Magento/Authorizenet/composer.json | 2 +- app/code/Magento/AuthorizenetAcceptjs/composer.json | 2 +- app/code/Magento/Backend/composer.json | 2 +- app/code/Magento/Backup/composer.json | 2 +- app/code/Magento/Braintree/composer.json | 2 +- app/code/Magento/Bundle/composer.json | 2 +- app/code/Magento/BundleGraphQl/composer.json | 2 +- app/code/Magento/BundleImportExport/composer.json | 2 +- app/code/Magento/CacheInvalidate/composer.json | 2 +- app/code/Magento/Captcha/composer.json | 2 +- app/code/Magento/Catalog/composer.json | 2 +- app/code/Magento/CatalogAnalytics/composer.json | 2 +- app/code/Magento/CatalogGraphQl/composer.json | 2 +- app/code/Magento/CatalogImportExport/composer.json | 2 +- app/code/Magento/CatalogInventory/composer.json | 2 +- app/code/Magento/CatalogInventoryGraphQl/composer.json | 2 +- app/code/Magento/CatalogRule/composer.json | 2 +- app/code/Magento/CatalogRuleConfigurable/composer.json | 2 +- app/code/Magento/CatalogSearch/composer.json | 2 +- app/code/Magento/CatalogUrlRewrite/composer.json | 2 +- app/code/Magento/CatalogUrlRewriteGraphQl/composer.json | 2 +- app/code/Magento/CatalogWidget/composer.json | 2 +- app/code/Magento/Checkout/composer.json | 2 +- app/code/Magento/CheckoutAgreements/composer.json | 2 +- app/code/Magento/CheckoutAgreementsGraphQl/composer.json | 2 +- app/code/Magento/Cms/composer.json | 2 +- app/code/Magento/CmsGraphQl/composer.json | 2 +- app/code/Magento/CmsUrlRewrite/composer.json | 2 +- app/code/Magento/CmsUrlRewriteGraphQl/composer.json | 2 +- app/code/Magento/Config/composer.json | 2 +- app/code/Magento/ConfigurableImportExport/composer.json | 2 +- app/code/Magento/ConfigurableProduct/composer.json | 2 +- app/code/Magento/ConfigurableProductGraphQl/composer.json | 2 +- app/code/Magento/ConfigurableProductSales/composer.json | 2 +- app/code/Magento/Contact/composer.json | 2 +- app/code/Magento/Cookie/composer.json | 2 +- app/code/Magento/Cron/composer.json | 2 +- app/code/Magento/CurrencySymbol/composer.json | 2 +- app/code/Magento/Customer/composer.json | 2 +- app/code/Magento/CustomerAnalytics/composer.json | 2 +- app/code/Magento/CustomerGraphQl/composer.json | 3 ++- app/code/Magento/CustomerImportExport/composer.json | 2 +- app/code/Magento/Deploy/composer.json | 2 +- app/code/Magento/Developer/composer.json | 2 +- app/code/Magento/Dhl/composer.json | 2 +- app/code/Magento/Directory/composer.json | 2 +- app/code/Magento/DirectoryGraphQl/composer.json | 2 +- app/code/Magento/Downloadable/composer.json | 2 +- app/code/Magento/DownloadableGraphQl/composer.json | 2 +- app/code/Magento/DownloadableImportExport/composer.json | 2 +- app/code/Magento/Eav/composer.json | 2 +- app/code/Magento/EavGraphQl/composer.json | 2 +- app/code/Magento/Elasticsearch/composer.json | 2 +- app/code/Magento/Elasticsearch6/composer.json | 2 +- app/code/Magento/Email/composer.json | 2 +- app/code/Magento/EncryptionKey/composer.json | 2 +- app/code/Magento/Fedex/composer.json | 2 +- app/code/Magento/GiftMessage/composer.json | 2 +- app/code/Magento/GoogleAdwords/composer.json | 2 +- app/code/Magento/GoogleAnalytics/composer.json | 2 +- app/code/Magento/GoogleOptimizer/composer.json | 2 +- app/code/Magento/GraphQl/composer.json | 3 ++- app/code/Magento/GraphQlCache/composer.json | 2 +- app/code/Magento/GroupedCatalogInventory/composer.json | 2 +- app/code/Magento/GroupedImportExport/composer.json | 2 +- app/code/Magento/GroupedProduct/composer.json | 2 +- app/code/Magento/GroupedProductGraphQl/composer.json | 2 +- app/code/Magento/ImportExport/composer.json | 2 +- app/code/Magento/Indexer/composer.json | 2 +- app/code/Magento/InstantPurchase/composer.json | 2 +- app/code/Magento/Integration/composer.json | 2 +- app/code/Magento/LayeredNavigation/composer.json | 2 +- app/code/Magento/Marketplace/composer.json | 2 +- app/code/Magento/MediaStorage/composer.json | 2 +- app/code/Magento/MessageQueue/composer.json | 2 +- app/code/Magento/Msrp/composer.json | 2 +- app/code/Magento/MsrpConfigurableProduct/composer.json | 2 +- app/code/Magento/MsrpGroupedProduct/composer.json | 2 +- app/code/Magento/Multishipping/composer.json | 2 +- app/code/Magento/MysqlMq/composer.json | 2 +- app/code/Magento/NewRelicReporting/composer.json | 2 +- app/code/Magento/Newsletter/composer.json | 2 +- app/code/Magento/OfflinePayments/composer.json | 2 +- app/code/Magento/OfflineShipping/composer.json | 2 +- app/code/Magento/PageCache/composer.json | 2 +- app/code/Magento/Payment/composer.json | 2 +- app/code/Magento/Paypal/composer.json | 2 +- app/code/Magento/PaypalCaptcha/composer.json | 2 +- app/code/Magento/Persistent/composer.json | 2 +- app/code/Magento/ProductAlert/composer.json | 2 +- app/code/Magento/ProductVideo/composer.json | 2 +- app/code/Magento/Quote/composer.json | 2 +- app/code/Magento/QuoteAnalytics/composer.json | 2 +- app/code/Magento/QuoteGraphQl/composer.json | 2 +- app/code/Magento/RelatedProductGraphQl/composer.json | 2 +- app/code/Magento/ReleaseNotification/composer.json | 2 +- app/code/Magento/Reports/composer.json | 2 +- app/code/Magento/RequireJs/composer.json | 2 +- app/code/Magento/Review/composer.json | 2 +- app/code/Magento/ReviewAnalytics/composer.json | 2 +- app/code/Magento/Robots/composer.json | 2 +- app/code/Magento/Rss/composer.json | 2 +- app/code/Magento/Rule/composer.json | 2 +- app/code/Magento/Sales/composer.json | 2 +- app/code/Magento/SalesAnalytics/composer.json | 2 +- app/code/Magento/SalesGraphQl/composer.json | 2 +- app/code/Magento/SalesInventory/composer.json | 2 +- app/code/Magento/SalesRule/composer.json | 2 +- app/code/Magento/SalesSequence/composer.json | 2 +- app/code/Magento/SampleData/composer.json | 2 +- app/code/Magento/Search/composer.json | 2 +- app/code/Magento/Security/composer.json | 2 +- app/code/Magento/SendFriend/composer.json | 2 +- app/code/Magento/SendFriendGraphQl/composer.json | 2 +- app/code/Magento/Shipping/composer.json | 2 +- app/code/Magento/Signifyd/composer.json | 2 +- app/code/Magento/Sitemap/composer.json | 2 +- app/code/Magento/Store/composer.json | 2 +- app/code/Magento/StoreGraphQl/composer.json | 2 +- app/code/Magento/Swagger/composer.json | 2 +- app/code/Magento/SwaggerWebapi/composer.json | 2 +- app/code/Magento/SwaggerWebapiAsync/composer.json | 2 +- app/code/Magento/Swatches/composer.json | 2 +- app/code/Magento/SwatchesGraphQl/composer.json | 2 +- app/code/Magento/SwatchesLayeredNavigation/composer.json | 2 +- app/code/Magento/Tax/composer.json | 2 +- app/code/Magento/TaxGraphQl/composer.json | 2 +- app/code/Magento/TaxImportExport/composer.json | 2 +- app/code/Magento/Theme/composer.json | 2 +- app/code/Magento/ThemeGraphQl/composer.json | 2 +- app/code/Magento/Tinymce3/composer.json | 2 +- app/code/Magento/Translation/composer.json | 2 +- app/code/Magento/Ui/composer.json | 2 +- app/code/Magento/Ups/composer.json | 2 +- app/code/Magento/UrlRewrite/composer.json | 2 +- app/code/Magento/UrlRewriteGraphQl/composer.json | 2 +- app/code/Magento/User/composer.json | 2 +- app/code/Magento/Usps/composer.json | 2 +- app/code/Magento/Variable/composer.json | 2 +- app/code/Magento/Vault/composer.json | 2 +- app/code/Magento/VaultGraphQl/composer.json | 2 +- app/code/Magento/Version/composer.json | 2 +- app/code/Magento/Webapi/composer.json | 2 +- app/code/Magento/WebapiAsync/composer.json | 2 +- app/code/Magento/WebapiSecurity/composer.json | 2 +- app/code/Magento/Weee/composer.json | 2 +- app/code/Magento/WeeeGraphQl/composer.json | 2 +- app/code/Magento/Widget/composer.json | 2 +- app/code/Magento/Wishlist/composer.json | 2 +- app/code/Magento/WishlistAnalytics/composer.json | 2 +- app/code/Magento/WishlistGraphQl/composer.json | 2 +- app/design/adminhtml/Magento/backend/composer.json | 2 +- app/design/frontend/Magento/blank/composer.json | 2 +- app/design/frontend/Magento/luma/composer.json | 2 +- dev/tests/functional/composer.json | 2 +- lib/internal/Magento/Framework/Amqp/composer.json | 2 +- lib/internal/Magento/Framework/Bulk/composer.json | 2 +- lib/internal/Magento/Framework/MessageQueue/composer.json | 2 +- lib/internal/Magento/Framework/composer.json | 2 +- 166 files changed, 168 insertions(+), 166 deletions(-) diff --git a/app/code/Magento/AdminNotification/composer.json b/app/code/Magento/AdminNotification/composer.json index fe0727474fa2..ea1e3ca10f2d 100644 --- a/app/code/Magento/AdminNotification/composer.json +++ b/app/code/Magento/AdminNotification/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "lib-libxml": "*", "magento/framework": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/AdvancedPricingImportExport/composer.json b/app/code/Magento/AdvancedPricingImportExport/composer.json index 12e1d9938f4b..767c1a9cd416 100644 --- a/app/code/Magento/AdvancedPricingImportExport/composer.json +++ b/app/code/Magento/AdvancedPricingImportExport/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-catalog-import-export": "*", diff --git a/app/code/Magento/AdvancedSearch/composer.json b/app/code/Magento/AdvancedSearch/composer.json index c6a5af07e60a..30b4a141087f 100644 --- a/app/code/Magento/AdvancedSearch/composer.json +++ b/app/code/Magento/AdvancedSearch/composer.json @@ -13,7 +13,7 @@ "magento/module-customer": "*", "magento/module-search": "*", "magento/module-store": "*", - "php": "~7.1.3||~7.2.0" + "php": "~7.1.3||~7.2.0||~7.3.0" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/Amqp/composer.json b/app/code/Magento/Amqp/composer.json index b50e951b46f8..e7509d880114 100644 --- a/app/code/Magento/Amqp/composer.json +++ b/app/code/Magento/Amqp/composer.json @@ -8,7 +8,7 @@ "magento/framework": "*", "magento/framework-amqp": "*", "magento/framework-message-queue": "*", - "php": "~7.1.3||~7.2.0" + "php": "~7.1.3||~7.2.0||~7.3.0" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/Analytics/composer.json b/app/code/Magento/Analytics/composer.json index 88127f3c62a9..2ae27608dbb1 100644 --- a/app/code/Magento/Analytics/composer.json +++ b/app/code/Magento/Analytics/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-analytics", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-backend": "*", "magento/module-config": "*", "magento/module-integration": "*", diff --git a/app/code/Magento/AsynchronousOperations/composer.json b/app/code/Magento/AsynchronousOperations/composer.json index 18927b5f4ecc..4ac67ac6aa64 100644 --- a/app/code/Magento/AsynchronousOperations/composer.json +++ b/app/code/Magento/AsynchronousOperations/composer.json @@ -10,7 +10,7 @@ "magento/module-authorization": "*", "magento/module-backend": "*", "magento/module-ui": "*", - "php": "~7.1.3||~7.2.0" + "php": "~7.1.3||~7.2.0||~7.3.0" }, "suggest": { "magento/module-admin-notification": "*", diff --git a/app/code/Magento/Authorization/composer.json b/app/code/Magento/Authorization/composer.json index 5f5e7c62ef83..5dec6280a3f6 100644 --- a/app/code/Magento/Authorization/composer.json +++ b/app/code/Magento/Authorization/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*" }, diff --git a/app/code/Magento/Authorizenet/composer.json b/app/code/Magento/Authorizenet/composer.json index 4e646004d9a6..9dcbc7ec7dfb 100644 --- a/app/code/Magento/Authorizenet/composer.json +++ b/app/code/Magento/Authorizenet/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/AuthorizenetAcceptjs/composer.json b/app/code/Magento/AuthorizenetAcceptjs/composer.json index be2cd6d4e70f..a54387ca6de2 100644 --- a/app/code/Magento/AuthorizenetAcceptjs/composer.json +++ b/app/code/Magento/AuthorizenetAcceptjs/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-payment": "*", "magento/module-sales": "*", diff --git a/app/code/Magento/Backend/composer.json b/app/code/Magento/Backend/composer.json index e54bd136b349..5a7884a9607f 100644 --- a/app/code/Magento/Backend/composer.json +++ b/app/code/Magento/Backend/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backup": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/Backup/composer.json b/app/code/Magento/Backup/composer.json index 81225430b0fc..4ceeff1d9303 100644 --- a/app/code/Magento/Backup/composer.json +++ b/app/code/Magento/Backup/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-cron": "*", diff --git a/app/code/Magento/Braintree/composer.json b/app/code/Magento/Braintree/composer.json index 2f956076f384..5b5eeaf2b3dd 100644 --- a/app/code/Magento/Braintree/composer.json +++ b/app/code/Magento/Braintree/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "braintree/braintree_php": "3.35.0", "magento/framework": "*", "magento/magento-composer-installer": "*", diff --git a/app/code/Magento/Bundle/composer.json b/app/code/Magento/Bundle/composer.json index 84c9a97698b7..f5d2832bf6c7 100644 --- a/app/code/Magento/Bundle/composer.json +++ b/app/code/Magento/Bundle/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/BundleGraphQl/composer.json b/app/code/Magento/BundleGraphQl/composer.json index aea55cb5c644..db85c2149ec1 100644 --- a/app/code/Magento/BundleGraphQl/composer.json +++ b/app/code/Magento/BundleGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-catalog": "*", "magento/module-bundle": "*", "magento/module-catalog-graph-ql": "*", diff --git a/app/code/Magento/BundleImportExport/composer.json b/app/code/Magento/BundleImportExport/composer.json index 42d9dc558d31..f7c8ce15a53d 100644 --- a/app/code/Magento/BundleImportExport/composer.json +++ b/app/code/Magento/BundleImportExport/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-bundle": "*", "magento/module-store": "*", diff --git a/app/code/Magento/CacheInvalidate/composer.json b/app/code/Magento/CacheInvalidate/composer.json index 01ac4d30d844..18e3f52ffcb8 100644 --- a/app/code/Magento/CacheInvalidate/composer.json +++ b/app/code/Magento/CacheInvalidate/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-page-cache": "*" }, diff --git a/app/code/Magento/Captcha/composer.json b/app/code/Magento/Captcha/composer.json index 62f586ba82ae..294961118e93 100644 --- a/app/code/Magento/Captcha/composer.json +++ b/app/code/Magento/Captcha/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-checkout": "*", diff --git a/app/code/Magento/Catalog/composer.json b/app/code/Magento/Catalog/composer.json index 5c3ee3da8ca8..8023634fa074 100644 --- a/app/code/Magento/Catalog/composer.json +++ b/app/code/Magento/Catalog/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-authorization": "*", "magento/module-asynchronous-operations": "*", diff --git a/app/code/Magento/CatalogAnalytics/composer.json b/app/code/Magento/CatalogAnalytics/composer.json index 805be8a17765..c6f5c3543708 100644 --- a/app/code/Magento/CatalogAnalytics/composer.json +++ b/app/code/Magento/CatalogAnalytics/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-catalog-analytics", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-analytics": "*" diff --git a/app/code/Magento/CatalogGraphQl/composer.json b/app/code/Magento/CatalogGraphQl/composer.json index 950b496263ff..13fcbe9a7d35 100644 --- a/app/code/Magento/CatalogGraphQl/composer.json +++ b/app/code/Magento/CatalogGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-eav": "*", "magento/module-catalog": "*", "magento/module-catalog-inventory": "*", diff --git a/app/code/Magento/CatalogImportExport/composer.json b/app/code/Magento/CatalogImportExport/composer.json index 56307a01e1cb..6af2bbaf45e3 100644 --- a/app/code/Magento/CatalogImportExport/composer.json +++ b/app/code/Magento/CatalogImportExport/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "ext-ctype": "*", "magento/framework": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/CatalogInventory/composer.json b/app/code/Magento/CatalogInventory/composer.json index eb6239ea87ef..db8594a37a12 100644 --- a/app/code/Magento/CatalogInventory/composer.json +++ b/app/code/Magento/CatalogInventory/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-search": "*", diff --git a/app/code/Magento/CatalogInventoryGraphQl/composer.json b/app/code/Magento/CatalogInventoryGraphQl/composer.json index 5e85c3ae12f9..644e3e2b6c34 100644 --- a/app/code/Magento/CatalogInventoryGraphQl/composer.json +++ b/app/code/Magento/CatalogInventoryGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-store": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/CatalogRule/composer.json b/app/code/Magento/CatalogRule/composer.json index 5b09765d9ae5..1b171c8d3658 100644 --- a/app/code/Magento/CatalogRule/composer.json +++ b/app/code/Magento/CatalogRule/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/CatalogRuleConfigurable/composer.json b/app/code/Magento/CatalogRuleConfigurable/composer.json index 657e6efb4e44..2e5468cb1110 100644 --- a/app/code/Magento/CatalogRuleConfigurable/composer.json +++ b/app/code/Magento/CatalogRuleConfigurable/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/magento-composer-installer": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/CatalogSearch/composer.json b/app/code/Magento/CatalogSearch/composer.json index 7bcb91e94541..5bc04e0420c3 100644 --- a/app/code/Magento/CatalogSearch/composer.json +++ b/app/code/Magento/CatalogSearch/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/CatalogUrlRewrite/composer.json b/app/code/Magento/CatalogUrlRewrite/composer.json index b4ceff96b50b..0245449384c4 100644 --- a/app/code/Magento/CatalogUrlRewrite/composer.json +++ b/app/code/Magento/CatalogUrlRewrite/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json b/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json index ab91f745c5d0..8ae48163250f 100644 --- a/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json +++ b/app/code/Magento/CatalogUrlRewriteGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "suggest": { diff --git a/app/code/Magento/CatalogWidget/composer.json b/app/code/Magento/CatalogWidget/composer.json index 3998e58c99ba..6722d0df9375 100644 --- a/app/code/Magento/CatalogWidget/composer.json +++ b/app/code/Magento/CatalogWidget/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/Checkout/composer.json b/app/code/Magento/Checkout/composer.json index 540565345bd9..09a63bb2c726 100644 --- a/app/code/Magento/Checkout/composer.json +++ b/app/code/Magento/Checkout/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-catalog-inventory": "*", diff --git a/app/code/Magento/CheckoutAgreements/composer.json b/app/code/Magento/CheckoutAgreements/composer.json index 7408bf5cab3f..168a39da0c91 100644 --- a/app/code/Magento/CheckoutAgreements/composer.json +++ b/app/code/Magento/CheckoutAgreements/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-checkout": "*", diff --git a/app/code/Magento/CheckoutAgreementsGraphQl/composer.json b/app/code/Magento/CheckoutAgreementsGraphQl/composer.json index 5972d48b35ea..bde317d36f3f 100644 --- a/app/code/Magento/CheckoutAgreementsGraphQl/composer.json +++ b/app/code/Magento/CheckoutAgreementsGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-store": "*", "magento/module-checkout-agreements": "*" diff --git a/app/code/Magento/Cms/composer.json b/app/code/Magento/Cms/composer.json index f051271c0505..91036d31fdc2 100644 --- a/app/code/Magento/Cms/composer.json +++ b/app/code/Magento/Cms/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/CmsGraphQl/composer.json b/app/code/Magento/CmsGraphQl/composer.json index e0e8481d59b7..6d73c615f20b 100644 --- a/app/code/Magento/CmsGraphQl/composer.json +++ b/app/code/Magento/CmsGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-cms": "*", "magento/module-store": "*", diff --git a/app/code/Magento/CmsUrlRewrite/composer.json b/app/code/Magento/CmsUrlRewrite/composer.json index d4d2942a786f..d4dfc8979f71 100644 --- a/app/code/Magento/CmsUrlRewrite/composer.json +++ b/app/code/Magento/CmsUrlRewrite/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-cms": "*", "magento/module-store": "*", diff --git a/app/code/Magento/CmsUrlRewriteGraphQl/composer.json b/app/code/Magento/CmsUrlRewriteGraphQl/composer.json index c57e4cdc92a8..35e4977aeb81 100644 --- a/app/code/Magento/CmsUrlRewriteGraphQl/composer.json +++ b/app/code/Magento/CmsUrlRewriteGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-url-rewrite-graph-ql": "*", "magento/module-store": "*", diff --git a/app/code/Magento/Config/composer.json b/app/code/Magento/Config/composer.json index 57c067d2cae2..a5826c252a1b 100644 --- a/app/code/Magento/Config/composer.json +++ b/app/code/Magento/Config/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-cron": "*", diff --git a/app/code/Magento/ConfigurableImportExport/composer.json b/app/code/Magento/ConfigurableImportExport/composer.json index 419a08e14b0a..9340b6b9876c 100644 --- a/app/code/Magento/ConfigurableImportExport/composer.json +++ b/app/code/Magento/ConfigurableImportExport/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-catalog-import-export": "*", diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json index 76096fd6bdf6..07ce281896d6 100644 --- a/app/code/Magento/ConfigurableProduct/composer.json +++ b/app/code/Magento/ConfigurableProduct/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/ConfigurableProductGraphQl/composer.json b/app/code/Magento/ConfigurableProductGraphQl/composer.json index a22df27734b7..e584abc4bfa7 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/composer.json +++ b/app/code/Magento/ConfigurableProductGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-catalog": "*", "magento/module-configurable-product": "*", "magento/module-catalog-graph-ql": "*", diff --git a/app/code/Magento/ConfigurableProductSales/composer.json b/app/code/Magento/ConfigurableProductSales/composer.json index 2a106b3abc75..a8085014c683 100644 --- a/app/code/Magento/ConfigurableProductSales/composer.json +++ b/app/code/Magento/ConfigurableProductSales/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-sales": "*", diff --git a/app/code/Magento/Contact/composer.json b/app/code/Magento/Contact/composer.json index b45132d0a360..0e0bf31f4eb1 100644 --- a/app/code/Magento/Contact/composer.json +++ b/app/code/Magento/Contact/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-cms": "*", "magento/module-config": "*", diff --git a/app/code/Magento/Cookie/composer.json b/app/code/Magento/Cookie/composer.json index 58f28ad47212..9309c179aa40 100644 --- a/app/code/Magento/Cookie/composer.json +++ b/app/code/Magento/Cookie/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-store": "*" }, diff --git a/app/code/Magento/Cron/composer.json b/app/code/Magento/Cron/composer.json index 5595bf1cb55f..a2d9e1a469a2 100644 --- a/app/code/Magento/Cron/composer.json +++ b/app/code/Magento/Cron/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-store": "*" }, diff --git a/app/code/Magento/CurrencySymbol/composer.json b/app/code/Magento/CurrencySymbol/composer.json index 009cb6248891..749338c44c29 100644 --- a/app/code/Magento/CurrencySymbol/composer.json +++ b/app/code/Magento/CurrencySymbol/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-config": "*", diff --git a/app/code/Magento/Customer/composer.json b/app/code/Magento/Customer/composer.json index b9a7aca73fe3..3e98818a67b7 100644 --- a/app/code/Magento/Customer/composer.json +++ b/app/code/Magento/Customer/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-authorization": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/CustomerAnalytics/composer.json b/app/code/Magento/CustomerAnalytics/composer.json index 3840c534b196..8feeeb74a432 100644 --- a/app/code/Magento/CustomerAnalytics/composer.json +++ b/app/code/Magento/CustomerAnalytics/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-customer-analytics", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-customer": "*", "magento/module-analytics": "*" diff --git a/app/code/Magento/CustomerGraphQl/composer.json b/app/code/Magento/CustomerGraphQl/composer.json index 39721fe79f69..911624da8fe5 100644 --- a/app/code/Magento/CustomerGraphQl/composer.json +++ b/app/code/Magento/CustomerGraphQl/composer.json @@ -3,7 +3,8 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", + "magento/module-customer": "*", "magento/module-authorization": "*", "magento/module-customer": "*", "magento/module-eav": "*", diff --git a/app/code/Magento/CustomerImportExport/composer.json b/app/code/Magento/CustomerImportExport/composer.json index b0d4ebed7ee2..cb22cc2bc283 100644 --- a/app/code/Magento/CustomerImportExport/composer.json +++ b/app/code/Magento/CustomerImportExport/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-customer": "*", diff --git a/app/code/Magento/Deploy/composer.json b/app/code/Magento/Deploy/composer.json index bd1a14a13140..5949b10535a2 100644 --- a/app/code/Magento/Deploy/composer.json +++ b/app/code/Magento/Deploy/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-config": "*", "magento/module-require-js": "*", diff --git a/app/code/Magento/Developer/composer.json b/app/code/Magento/Developer/composer.json index 31617a8d943c..b4094bf0b483 100644 --- a/app/code/Magento/Developer/composer.json +++ b/app/code/Magento/Developer/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-config": "*", "magento/module-store": "*" diff --git a/app/code/Magento/Dhl/composer.json b/app/code/Magento/Dhl/composer.json index a4c491e7a6cd..341bcc0f5647 100644 --- a/app/code/Magento/Dhl/composer.json +++ b/app/code/Magento/Dhl/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "lib-libxml": "*", "magento/framework": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/Directory/composer.json b/app/code/Magento/Directory/composer.json index c1de1b7bac86..8878c84fdad3 100644 --- a/app/code/Magento/Directory/composer.json +++ b/app/code/Magento/Directory/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "lib-libxml": "*", "magento/framework": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/DirectoryGraphQl/composer.json b/app/code/Magento/DirectoryGraphQl/composer.json index d3c783e6c7bf..28cdd7293ef2 100644 --- a/app/code/Magento/DirectoryGraphQl/composer.json +++ b/app/code/Magento/DirectoryGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-directory": "*", "magento/module-store": "*", "magento/module-graph-ql": "*", diff --git a/app/code/Magento/Downloadable/composer.json b/app/code/Magento/Downloadable/composer.json index 88658b8644ca..ac7960f24340 100644 --- a/app/code/Magento/Downloadable/composer.json +++ b/app/code/Magento/Downloadable/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/DownloadableGraphQl/composer.json b/app/code/Magento/DownloadableGraphQl/composer.json index 1c18b75a6579..a1251f4d54ab 100644 --- a/app/code/Magento/DownloadableGraphQl/composer.json +++ b/app/code/Magento/DownloadableGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-catalog": "*", "magento/module-downloadable": "*", "magento/module-graph-ql": "*", diff --git a/app/code/Magento/DownloadableImportExport/composer.json b/app/code/Magento/DownloadableImportExport/composer.json index 860303b0c86a..50f039688149 100644 --- a/app/code/Magento/DownloadableImportExport/composer.json +++ b/app/code/Magento/DownloadableImportExport/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-catalog-import-export": "*", diff --git a/app/code/Magento/Eav/composer.json b/app/code/Magento/Eav/composer.json index 80692bf37bc2..5661748714e8 100644 --- a/app/code/Magento/Eav/composer.json +++ b/app/code/Magento/Eav/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/EavGraphQl/composer.json b/app/code/Magento/EavGraphQl/composer.json index a2c2d025a3d9..be9cdaaeb7d6 100644 --- a/app/code/Magento/EavGraphQl/composer.json +++ b/app/code/Magento/EavGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-eav": "*" }, diff --git a/app/code/Magento/Elasticsearch/composer.json b/app/code/Magento/Elasticsearch/composer.json index c6ac38c1e400..05d3ce94f02f 100644 --- a/app/code/Magento/Elasticsearch/composer.json +++ b/app/code/Magento/Elasticsearch/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-elasticsearch", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-advanced-search": "*", "magento/module-catalog": "*", "magento/module-catalog-search": "*", diff --git a/app/code/Magento/Elasticsearch6/composer.json b/app/code/Magento/Elasticsearch6/composer.json index 26b6c8c678ad..9107f5e90041 100644 --- a/app/code/Magento/Elasticsearch6/composer.json +++ b/app/code/Magento/Elasticsearch6/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-elasticsearch-6", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-advanced-search": "*", "magento/module-catalog-search": "*", diff --git a/app/code/Magento/Email/composer.json b/app/code/Magento/Email/composer.json index e887adef1fbc..548d9a422c13 100644 --- a/app/code/Magento/Email/composer.json +++ b/app/code/Magento/Email/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-cms": "*", diff --git a/app/code/Magento/EncryptionKey/composer.json b/app/code/Magento/EncryptionKey/composer.json index 4a140c4b1315..b15415148720 100644 --- a/app/code/Magento/EncryptionKey/composer.json +++ b/app/code/Magento/EncryptionKey/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-config": "*" diff --git a/app/code/Magento/Fedex/composer.json b/app/code/Magento/Fedex/composer.json index 9bc0c8b217a5..20a2d31f3f02 100644 --- a/app/code/Magento/Fedex/composer.json +++ b/app/code/Magento/Fedex/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "lib-libxml": "*", "magento/framework": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/GiftMessage/composer.json b/app/code/Magento/GiftMessage/composer.json index 6efc7c6ca231..1aaad2483771 100644 --- a/app/code/Magento/GiftMessage/composer.json +++ b/app/code/Magento/GiftMessage/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/GoogleAdwords/composer.json b/app/code/Magento/GoogleAdwords/composer.json index 8aa142865214..2d5437c53d84 100644 --- a/app/code/Magento/GoogleAdwords/composer.json +++ b/app/code/Magento/GoogleAdwords/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-sales": "*", "magento/module-store": "*" diff --git a/app/code/Magento/GoogleAnalytics/composer.json b/app/code/Magento/GoogleAnalytics/composer.json index 9c86005706e8..8ab8ba5cce8e 100644 --- a/app/code/Magento/GoogleAnalytics/composer.json +++ b/app/code/Magento/GoogleAnalytics/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-cookie": "*", "magento/module-sales": "*", diff --git a/app/code/Magento/GoogleOptimizer/composer.json b/app/code/Magento/GoogleOptimizer/composer.json index 51036562857f..7cd776dcfbf4 100644 --- a/app/code/Magento/GoogleOptimizer/composer.json +++ b/app/code/Magento/GoogleOptimizer/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/GraphQl/composer.json b/app/code/Magento/GraphQl/composer.json index 51e93f01a6e5..8ea033b49996 100644 --- a/app/code/Magento/GraphQl/composer.json +++ b/app/code/Magento/GraphQl/composer.json @@ -3,7 +3,8 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", + "magento/module-authorization": "*", "magento/module-eav": "*", "magento/framework": "*" }, diff --git a/app/code/Magento/GraphQlCache/composer.json b/app/code/Magento/GraphQlCache/composer.json index 436ae95da40f..7b9f4b1d6dc6 100644 --- a/app/code/Magento/GraphQlCache/composer.json +++ b/app/code/Magento/GraphQlCache/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-page-cache": "*", "magento/module-graph-ql": "*" diff --git a/app/code/Magento/GroupedCatalogInventory/composer.json b/app/code/Magento/GroupedCatalogInventory/composer.json index c9946bc3f36a..09b584de0493 100644 --- a/app/code/Magento/GroupedCatalogInventory/composer.json +++ b/app/code/Magento/GroupedCatalogInventory/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-catalog-inventory": "*", diff --git a/app/code/Magento/GroupedImportExport/composer.json b/app/code/Magento/GroupedImportExport/composer.json index b7674e215702..0b9a81f61bb9 100644 --- a/app/code/Magento/GroupedImportExport/composer.json +++ b/app/code/Magento/GroupedImportExport/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-catalog-import-export": "*", diff --git a/app/code/Magento/GroupedProduct/composer.json b/app/code/Magento/GroupedProduct/composer.json index 19509ae3ce08..68063c05ddf7 100644 --- a/app/code/Magento/GroupedProduct/composer.json +++ b/app/code/Magento/GroupedProduct/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/GroupedProductGraphQl/composer.json b/app/code/Magento/GroupedProductGraphQl/composer.json index bf6745370b4b..cd22c6066eb4 100644 --- a/app/code/Magento/GroupedProductGraphQl/composer.json +++ b/app/code/Magento/GroupedProductGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-grouped-product": "*", "magento/module-catalog-graph-ql": "*", "magento/framework": "*" diff --git a/app/code/Magento/ImportExport/composer.json b/app/code/Magento/ImportExport/composer.json index 6363722eba7c..13bbac9f961d 100644 --- a/app/code/Magento/ImportExport/composer.json +++ b/app/code/Magento/ImportExport/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "ext-ctype": "*", "magento/framework": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/Indexer/composer.json b/app/code/Magento/Indexer/composer.json index 6aefa433495a..c5ee541d3e13 100644 --- a/app/code/Magento/Indexer/composer.json +++ b/app/code/Magento/Indexer/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*" }, diff --git a/app/code/Magento/InstantPurchase/composer.json b/app/code/Magento/InstantPurchase/composer.json index 2b39920fefc6..542266d6af5d 100644 --- a/app/code/Magento/InstantPurchase/composer.json +++ b/app/code/Magento/InstantPurchase/composer.json @@ -7,7 +7,7 @@ "AFL-3.0" ], "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-store": "*", "magento/module-catalog": "*", "magento/module-customer": "*", diff --git a/app/code/Magento/Integration/composer.json b/app/code/Magento/Integration/composer.json index 6a63854775ac..5ecd792a5e7b 100644 --- a/app/code/Magento/Integration/composer.json +++ b/app/code/Magento/Integration/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-authorization": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/LayeredNavigation/composer.json b/app/code/Magento/LayeredNavigation/composer.json index 6d322fc3ab50..67712fac2a23 100644 --- a/app/code/Magento/LayeredNavigation/composer.json +++ b/app/code/Magento/LayeredNavigation/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-config": "*" diff --git a/app/code/Magento/Marketplace/composer.json b/app/code/Magento/Marketplace/composer.json index b52d507f825f..71b7a8156cf6 100644 --- a/app/code/Magento/Marketplace/composer.json +++ b/app/code/Magento/Marketplace/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*" }, diff --git a/app/code/Magento/MediaStorage/composer.json b/app/code/Magento/MediaStorage/composer.json index 7d27c88b3dcb..95c48f3fdc58 100644 --- a/app/code/Magento/MediaStorage/composer.json +++ b/app/code/Magento/MediaStorage/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-config": "*", diff --git a/app/code/Magento/MessageQueue/composer.json b/app/code/Magento/MessageQueue/composer.json index 9d3c77fa0184..92744126900a 100644 --- a/app/code/Magento/MessageQueue/composer.json +++ b/app/code/Magento/MessageQueue/composer.json @@ -7,7 +7,7 @@ "require": { "magento/framework": "*", "magento/magento-composer-installer": "*", - "php": "~7.1.3||~7.2.0" + "php": "~7.1.3||~7.2.0||~7.3.0" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/Msrp/composer.json b/app/code/Magento/Msrp/composer.json index a2e6da6de538..81bb423c00a6 100644 --- a/app/code/Magento/Msrp/composer.json +++ b/app/code/Magento/Msrp/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-downloadable": "*", diff --git a/app/code/Magento/MsrpConfigurableProduct/composer.json b/app/code/Magento/MsrpConfigurableProduct/composer.json index 00c3cf6b0307..e2ef230f3caf 100644 --- a/app/code/Magento/MsrpConfigurableProduct/composer.json +++ b/app/code/Magento/MsrpConfigurableProduct/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-msrp": "*", diff --git a/app/code/Magento/MsrpGroupedProduct/composer.json b/app/code/Magento/MsrpGroupedProduct/composer.json index a626f199ad6c..76e2db169355 100644 --- a/app/code/Magento/MsrpGroupedProduct/composer.json +++ b/app/code/Magento/MsrpGroupedProduct/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-msrp": "*", diff --git a/app/code/Magento/Multishipping/composer.json b/app/code/Magento/Multishipping/composer.json index 0d7982518d2c..61f4aafe567d 100644 --- a/app/code/Magento/Multishipping/composer.json +++ b/app/code/Magento/Multishipping/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-checkout": "*", "magento/module-customer": "*", diff --git a/app/code/Magento/MysqlMq/composer.json b/app/code/Magento/MysqlMq/composer.json index d9bcf307a5bf..413195c6f6d7 100644 --- a/app/code/Magento/MysqlMq/composer.json +++ b/app/code/Magento/MysqlMq/composer.json @@ -8,7 +8,7 @@ "magento/framework": "*", "magento/magento-composer-installer": "*", "magento/module-store": "*", - "php": "~7.1.3||~7.2.0" + "php": "~7.1.3||~7.2.0||~7.3.0" }, "type": "magento2-module", "license": [ diff --git a/app/code/Magento/NewRelicReporting/composer.json b/app/code/Magento/NewRelicReporting/composer.json index 25e7193ce0e2..f5301ba2b6a3 100644 --- a/app/code/Magento/NewRelicReporting/composer.json +++ b/app/code/Magento/NewRelicReporting/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/magento-composer-installer": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/Newsletter/composer.json b/app/code/Magento/Newsletter/composer.json index dc1334af295c..e6f22c4ab339 100644 --- a/app/code/Magento/Newsletter/composer.json +++ b/app/code/Magento/Newsletter/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-cms": "*", diff --git a/app/code/Magento/OfflinePayments/composer.json b/app/code/Magento/OfflinePayments/composer.json index aa2e45b01e9f..4de112ac7215 100644 --- a/app/code/Magento/OfflinePayments/composer.json +++ b/app/code/Magento/OfflinePayments/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-checkout": "*", "magento/module-payment": "*" diff --git a/app/code/Magento/OfflineShipping/composer.json b/app/code/Magento/OfflineShipping/composer.json index a3e1dad5de85..a2d9f0e8f8d5 100644 --- a/app/code/Magento/OfflineShipping/composer.json +++ b/app/code/Magento/OfflineShipping/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/PageCache/composer.json b/app/code/Magento/PageCache/composer.json index 56385fcc528d..ce030d9b7dfa 100644 --- a/app/code/Magento/PageCache/composer.json +++ b/app/code/Magento/PageCache/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-config": "*", diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index 293d36e09395..fa1658a5d00b 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-checkout": "*", "magento/module-config": "*", diff --git a/app/code/Magento/Paypal/composer.json b/app/code/Magento/Paypal/composer.json index b62985e8b8b7..8d577cfb6b86 100644 --- a/app/code/Magento/Paypal/composer.json +++ b/app/code/Magento/Paypal/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "lib-libxml": "*", "magento/framework": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/PaypalCaptcha/composer.json b/app/code/Magento/PaypalCaptcha/composer.json index e71ef8c0ec7d..a99d1975e44e 100644 --- a/app/code/Magento/PaypalCaptcha/composer.json +++ b/app/code/Magento/PaypalCaptcha/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-captcha": "*", "magento/module-checkout": "*", diff --git a/app/code/Magento/Persistent/composer.json b/app/code/Magento/Persistent/composer.json index 4a304c549b76..d405daefa0f1 100644 --- a/app/code/Magento/Persistent/composer.json +++ b/app/code/Magento/Persistent/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-checkout": "*", "magento/module-cron": "*", diff --git a/app/code/Magento/ProductAlert/composer.json b/app/code/Magento/ProductAlert/composer.json index e8488187f839..25fe8edbede7 100644 --- a/app/code/Magento/ProductAlert/composer.json +++ b/app/code/Magento/ProductAlert/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/ProductVideo/composer.json b/app/code/Magento/ProductVideo/composer.json index 24497f891db4..6dad9cf1aa85 100644 --- a/app/code/Magento/ProductVideo/composer.json +++ b/app/code/Magento/ProductVideo/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/magento-composer-installer": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/Quote/composer.json b/app/code/Magento/Quote/composer.json index 0281c75507f5..82274fe8a31d 100644 --- a/app/code/Magento/Quote/composer.json +++ b/app/code/Magento/Quote/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-authorization": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/QuoteAnalytics/composer.json b/app/code/Magento/QuoteAnalytics/composer.json index 706bed674b4a..b930a844be1e 100644 --- a/app/code/Magento/QuoteAnalytics/composer.json +++ b/app/code/Magento/QuoteAnalytics/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-quote-analytics", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-quote": "*", "magento/module-analytics": "*" diff --git a/app/code/Magento/QuoteGraphQl/composer.json b/app/code/Magento/QuoteGraphQl/composer.json index 0eeeb77e9ec6..b56f86364ec6 100644 --- a/app/code/Magento/QuoteGraphQl/composer.json +++ b/app/code/Magento/QuoteGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-quote": "*", "magento/module-checkout": "*", diff --git a/app/code/Magento/RelatedProductGraphQl/composer.json b/app/code/Magento/RelatedProductGraphQl/composer.json index 0d314d433f17..bb270b4a9e67 100644 --- a/app/code/Magento/RelatedProductGraphQl/composer.json +++ b/app/code/Magento/RelatedProductGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-catalog": "*", "magento/module-catalog-graph-ql": "*", "magento/framework": "*" diff --git a/app/code/Magento/ReleaseNotification/composer.json b/app/code/Magento/ReleaseNotification/composer.json index 97b312b74ff7..67c84b33b226 100644 --- a/app/code/Magento/ReleaseNotification/composer.json +++ b/app/code/Magento/ReleaseNotification/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-release-notification", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-user": "*", "magento/module-backend": "*", "magento/module-ui": "*", diff --git a/app/code/Magento/Reports/composer.json b/app/code/Magento/Reports/composer.json index f2ead8fedff7..f816163dce48 100644 --- a/app/code/Magento/Reports/composer.json +++ b/app/code/Magento/Reports/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/RequireJs/composer.json b/app/code/Magento/RequireJs/composer.json index e48082a69319..ebabe43a0efb 100644 --- a/app/code/Magento/RequireJs/composer.json +++ b/app/code/Magento/RequireJs/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "type": "magento2-module", diff --git a/app/code/Magento/Review/composer.json b/app/code/Magento/Review/composer.json index 17e0d9bebcf5..de5dfb2f9f9f 100644 --- a/app/code/Magento/Review/composer.json +++ b/app/code/Magento/Review/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/ReviewAnalytics/composer.json b/app/code/Magento/ReviewAnalytics/composer.json index a82d4328ca15..a492c3e8a00c 100644 --- a/app/code/Magento/ReviewAnalytics/composer.json +++ b/app/code/Magento/ReviewAnalytics/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-review-analytics", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-review": "*", "magento/module-analytics": "*" diff --git a/app/code/Magento/Robots/composer.json b/app/code/Magento/Robots/composer.json index 6f812857873b..11bc0596771a 100644 --- a/app/code/Magento/Robots/composer.json +++ b/app/code/Magento/Robots/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-store": "*" }, diff --git a/app/code/Magento/Rss/composer.json b/app/code/Magento/Rss/composer.json index 5b6c34688c31..24f0297a21f6 100644 --- a/app/code/Magento/Rss/composer.json +++ b/app/code/Magento/Rss/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-customer": "*", diff --git a/app/code/Magento/Rule/composer.json b/app/code/Magento/Rule/composer.json index 15f72b8ec24a..21e595b6e3f0 100644 --- a/app/code/Magento/Rule/composer.json +++ b/app/code/Magento/Rule/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "lib-libxml": "*", "magento/framework": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/Sales/composer.json b/app/code/Magento/Sales/composer.json index 4286fbb506a5..8d4ef50a2ebc 100644 --- a/app/code/Magento/Sales/composer.json +++ b/app/code/Magento/Sales/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-authorization": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/SalesAnalytics/composer.json b/app/code/Magento/SalesAnalytics/composer.json index b77dcd7e71c6..13168d8164de 100644 --- a/app/code/Magento/SalesAnalytics/composer.json +++ b/app/code/Magento/SalesAnalytics/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-sales-analytics", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-sales": "*", "magento/module-analytics": "*" diff --git a/app/code/Magento/SalesGraphQl/composer.json b/app/code/Magento/SalesGraphQl/composer.json index feb6e07f1592..6ca4f2dcbda9 100644 --- a/app/code/Magento/SalesGraphQl/composer.json +++ b/app/code/Magento/SalesGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-sales": "*", "magento/module-graph-ql": "*" diff --git a/app/code/Magento/SalesInventory/composer.json b/app/code/Magento/SalesInventory/composer.json index d8a48bed9169..2df98ee961f5 100644 --- a/app/code/Magento/SalesInventory/composer.json +++ b/app/code/Magento/SalesInventory/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-catalog-inventory": "*", diff --git a/app/code/Magento/SalesRule/composer.json b/app/code/Magento/SalesRule/composer.json index a2e7dc8835ae..e284dbdc4ba5 100644 --- a/app/code/Magento/SalesRule/composer.json +++ b/app/code/Magento/SalesRule/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/SalesSequence/composer.json b/app/code/Magento/SalesSequence/composer.json index 3865d9569c52..5d9260ed2f68 100644 --- a/app/code/Magento/SalesSequence/composer.json +++ b/app/code/Magento/SalesSequence/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "type": "magento2-module", diff --git a/app/code/Magento/SampleData/composer.json b/app/code/Magento/SampleData/composer.json index 17bb4d03dd55..510e65cdfcc0 100644 --- a/app/code/Magento/SampleData/composer.json +++ b/app/code/Magento/SampleData/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "suggest": { diff --git a/app/code/Magento/Search/composer.json b/app/code/Magento/Search/composer.json index 067d1bf2f7df..52a152cc9da3 100644 --- a/app/code/Magento/Search/composer.json +++ b/app/code/Magento/Search/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog-search": "*", diff --git a/app/code/Magento/Security/composer.json b/app/code/Magento/Security/composer.json index 405b5b518097..83be788af373 100644 --- a/app/code/Magento/Security/composer.json +++ b/app/code/Magento/Security/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-store": "*", diff --git a/app/code/Magento/SendFriend/composer.json b/app/code/Magento/SendFriend/composer.json index 932093004cf7..f06f1b4a9e3e 100644 --- a/app/code/Magento/SendFriend/composer.json +++ b/app/code/Magento/SendFriend/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-customer": "*", diff --git a/app/code/Magento/SendFriendGraphQl/composer.json b/app/code/Magento/SendFriendGraphQl/composer.json index 091c68487912..e458abd5cd5f 100644 --- a/app/code/Magento/SendFriendGraphQl/composer.json +++ b/app/code/Magento/SendFriendGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-send-friend": "*", diff --git a/app/code/Magento/Shipping/composer.json b/app/code/Magento/Shipping/composer.json index b29a2fd537e9..1e3ea3701a7f 100644 --- a/app/code/Magento/Shipping/composer.json +++ b/app/code/Magento/Shipping/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "ext-gd": "*", "magento/framework": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/Signifyd/composer.json b/app/code/Magento/Signifyd/composer.json index 992a74d0dc3e..c0214e9a2813 100644 --- a/app/code/Magento/Signifyd/composer.json +++ b/app/code/Magento/Signifyd/composer.json @@ -14,7 +14,7 @@ "magento/module-payment": "*", "magento/module-sales": "*", "magento/module-store": "*", - "php": "~7.1.3||~7.2.0" + "php": "~7.1.3||~7.2.0||~7.3.0" }, "suggest": { "magento/module-config": "*" diff --git a/app/code/Magento/Sitemap/composer.json b/app/code/Magento/Sitemap/composer.json index f537832bdc3d..a23da13e7b6d 100644 --- a/app/code/Magento/Sitemap/composer.json +++ b/app/code/Magento/Sitemap/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/Store/composer.json b/app/code/Magento/Store/composer.json index 6f05d65e732f..bb7c33be7056 100644 --- a/app/code/Magento/Store/composer.json +++ b/app/code/Magento/Store/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog": "*", "magento/module-config": "*", diff --git a/app/code/Magento/StoreGraphQl/composer.json b/app/code/Magento/StoreGraphQl/composer.json index aa36a4891343..4a370fae354c 100644 --- a/app/code/Magento/StoreGraphQl/composer.json +++ b/app/code/Magento/StoreGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-store": "*", "magento/module-graph-ql": "*" diff --git a/app/code/Magento/Swagger/composer.json b/app/code/Magento/Swagger/composer.json index 6a45076d3f32..57c05857224a 100644 --- a/app/code/Magento/Swagger/composer.json +++ b/app/code/Magento/Swagger/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "type": "magento2-module", diff --git a/app/code/Magento/SwaggerWebapi/composer.json b/app/code/Magento/SwaggerWebapi/composer.json index 5cfd6da7ca41..be2fa2db5d1b 100644 --- a/app/code/Magento/SwaggerWebapi/composer.json +++ b/app/code/Magento/SwaggerWebapi/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-swagger": "*" }, diff --git a/app/code/Magento/SwaggerWebapiAsync/composer.json b/app/code/Magento/SwaggerWebapiAsync/composer.json index 3735bcd0ee45..602a54ecf0cb 100644 --- a/app/code/Magento/SwaggerWebapiAsync/composer.json +++ b/app/code/Magento/SwaggerWebapiAsync/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-swagger": "*" }, diff --git a/app/code/Magento/Swatches/composer.json b/app/code/Magento/Swatches/composer.json index 09d3e05008af..072b80443ba8 100644 --- a/app/code/Magento/Swatches/composer.json +++ b/app/code/Magento/Swatches/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/SwatchesGraphQl/composer.json b/app/code/Magento/SwatchesGraphQl/composer.json index 01ef35b1ccb6..3589795a30d3 100644 --- a/app/code/Magento/SwatchesGraphQl/composer.json +++ b/app/code/Magento/SwatchesGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-swatches": "*", "magento/module-catalog": "*" diff --git a/app/code/Magento/SwatchesLayeredNavigation/composer.json b/app/code/Magento/SwatchesLayeredNavigation/composer.json index e11c3d9c4d42..4151924a6ce7 100644 --- a/app/code/Magento/SwatchesLayeredNavigation/composer.json +++ b/app/code/Magento/SwatchesLayeredNavigation/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/magento-composer-installer": "*" }, diff --git a/app/code/Magento/Tax/composer.json b/app/code/Magento/Tax/composer.json index a09ebbd53750..3dc823cb0497 100644 --- a/app/code/Magento/Tax/composer.json +++ b/app/code/Magento/Tax/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/TaxGraphQl/composer.json b/app/code/Magento/TaxGraphQl/composer.json index 33f87dd35d40..4928b1585d65 100644 --- a/app/code/Magento/TaxGraphQl/composer.json +++ b/app/code/Magento/TaxGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "suggest": { diff --git a/app/code/Magento/TaxImportExport/composer.json b/app/code/Magento/TaxImportExport/composer.json index f234cc9bc249..44b876cee6dc 100644 --- a/app/code/Magento/TaxImportExport/composer.json +++ b/app/code/Magento/TaxImportExport/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-directory": "*", diff --git a/app/code/Magento/Theme/composer.json b/app/code/Magento/Theme/composer.json index 0c2b092b8d7d..37802ee6c68f 100644 --- a/app/code/Magento/Theme/composer.json +++ b/app/code/Magento/Theme/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-cms": "*", diff --git a/app/code/Magento/ThemeGraphQl/composer.json b/app/code/Magento/ThemeGraphQl/composer.json index e3aac55aea37..d318ae06f0e6 100644 --- a/app/code/Magento/ThemeGraphQl/composer.json +++ b/app/code/Magento/ThemeGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "suggest": { diff --git a/app/code/Magento/Tinymce3/composer.json b/app/code/Magento/Tinymce3/composer.json index 9ea4c7b2f18a..7b12851626cf 100644 --- a/app/code/Magento/Tinymce3/composer.json +++ b/app/code/Magento/Tinymce3/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-tinymce-3", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-ui": "*", diff --git a/app/code/Magento/Translation/composer.json b/app/code/Magento/Translation/composer.json index ac2ddfc4a663..c01791c88f99 100644 --- a/app/code/Magento/Translation/composer.json +++ b/app/code/Magento/Translation/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-developer": "*", diff --git a/app/code/Magento/Ui/composer.json b/app/code/Magento/Ui/composer.json index d0d93abc6b1e..9ec0810bf2d6 100644 --- a/app/code/Magento/Ui/composer.json +++ b/app/code/Magento/Ui/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-authorization": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/Ups/composer.json b/app/code/Magento/Ups/composer.json index 902ee4311867..fad62c1f02a5 100644 --- a/app/code/Magento/Ups/composer.json +++ b/app/code/Magento/Ups/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog-inventory": "*", diff --git a/app/code/Magento/UrlRewrite/composer.json b/app/code/Magento/UrlRewrite/composer.json index b12d0820ae3b..90f11accfe50 100644 --- a/app/code/Magento/UrlRewrite/composer.json +++ b/app/code/Magento/UrlRewrite/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/UrlRewriteGraphQl/composer.json b/app/code/Magento/UrlRewriteGraphQl/composer.json index 1c99276269aa..3d54f04aa189 100644 --- a/app/code/Magento/UrlRewriteGraphQl/composer.json +++ b/app/code/Magento/UrlRewriteGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-url-rewrite": "*", "magento/module-store": "*" diff --git a/app/code/Magento/User/composer.json b/app/code/Magento/User/composer.json index 7195582f0961..4390889f66fe 100644 --- a/app/code/Magento/User/composer.json +++ b/app/code/Magento/User/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-authorization": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/Usps/composer.json b/app/code/Magento/Usps/composer.json index f0ee0cd5cda9..a3ee4ed777b7 100644 --- a/app/code/Magento/Usps/composer.json +++ b/app/code/Magento/Usps/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "lib-libxml": "*", "magento/framework": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/Variable/composer.json b/app/code/Magento/Variable/composer.json index bacbf15729d2..54a5ab663c80 100644 --- a/app/code/Magento/Variable/composer.json +++ b/app/code/Magento/Variable/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-store": "*", diff --git a/app/code/Magento/Vault/composer.json b/app/code/Magento/Vault/composer.json index f888a9869228..7dc2e0be7864 100644 --- a/app/code/Magento/Vault/composer.json +++ b/app/code/Magento/Vault/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-checkout": "*", "magento/module-customer": "*", diff --git a/app/code/Magento/VaultGraphQl/composer.json b/app/code/Magento/VaultGraphQl/composer.json index 2f9fe6dc0417..3595eeee2565 100644 --- a/app/code/Magento/VaultGraphQl/composer.json +++ b/app/code/Magento/VaultGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-vault": "*", "magento/module-graph-ql": "*" diff --git a/app/code/Magento/Version/composer.json b/app/code/Magento/Version/composer.json index 81da36715ae8..8d67a0ac087e 100644 --- a/app/code/Magento/Version/composer.json +++ b/app/code/Magento/Version/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "type": "magento2-module", diff --git a/app/code/Magento/Webapi/composer.json b/app/code/Magento/Webapi/composer.json index c6cbdd8b3283..58ee9f2207b7 100644 --- a/app/code/Magento/Webapi/composer.json +++ b/app/code/Magento/Webapi/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-authorization": "*", "magento/module-backend": "*", diff --git a/app/code/Magento/WebapiAsync/composer.json b/app/code/Magento/WebapiAsync/composer.json index 815e4574abf5..d076897d61e2 100644 --- a/app/code/Magento/WebapiAsync/composer.json +++ b/app/code/Magento/WebapiAsync/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-webapi": "*", "magento/module-asynchronous-operations": "*" diff --git a/app/code/Magento/WebapiSecurity/composer.json b/app/code/Magento/WebapiSecurity/composer.json index bdb1487cac02..fffb6d967e03 100644 --- a/app/code/Magento/WebapiSecurity/composer.json +++ b/app/code/Magento/WebapiSecurity/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-webapi": "*" }, diff --git a/app/code/Magento/Weee/composer.json b/app/code/Magento/Weee/composer.json index 3f832ce51ee8..cf3b8e6e62dd 100644 --- a/app/code/Magento/Weee/composer.json +++ b/app/code/Magento/Weee/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/WeeeGraphQl/composer.json b/app/code/Magento/WeeeGraphQl/composer.json index eb7835cf0d88..0bf303f789a7 100644 --- a/app/code/Magento/WeeeGraphQl/composer.json +++ b/app/code/Magento/WeeeGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "suggest": { diff --git a/app/code/Magento/Widget/composer.json b/app/code/Magento/Widget/composer.json index f0b0121ac60c..3e2a4b588b7e 100644 --- a/app/code/Magento/Widget/composer.json +++ b/app/code/Magento/Widget/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/Wishlist/composer.json b/app/code/Magento/Wishlist/composer.json index c9c74c8859e4..dc43315c6839 100644 --- a/app/code/Magento/Wishlist/composer.json +++ b/app/code/Magento/Wishlist/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-backend": "*", "magento/module-catalog": "*", diff --git a/app/code/Magento/WishlistAnalytics/composer.json b/app/code/Magento/WishlistAnalytics/composer.json index 747f2a4baaaa..fbd0b9e2d5c2 100644 --- a/app/code/Magento/WishlistAnalytics/composer.json +++ b/app/code/Magento/WishlistAnalytics/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-wishlist-analytics", "description": "N/A", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-wishlist": "*", "magento/module-analytics": "*" diff --git a/app/code/Magento/WishlistGraphQl/composer.json b/app/code/Magento/WishlistGraphQl/composer.json index 630ee97acc2e..11dd9944d693 100644 --- a/app/code/Magento/WishlistGraphQl/composer.json +++ b/app/code/Magento/WishlistGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-catalog-graph-ql": "*", "magento/module-wishlist": "*", diff --git a/app/design/adminhtml/Magento/backend/composer.json b/app/design/adminhtml/Magento/backend/composer.json index d03a4c1950c5..a7553f8b6fb0 100644 --- a/app/design/adminhtml/Magento/backend/composer.json +++ b/app/design/adminhtml/Magento/backend/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "type": "magento2-theme", diff --git a/app/design/frontend/Magento/blank/composer.json b/app/design/frontend/Magento/blank/composer.json index b9f0b5e66ab5..1857d9d597d0 100644 --- a/app/design/frontend/Magento/blank/composer.json +++ b/app/design/frontend/Magento/blank/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "type": "magento2-theme", diff --git a/app/design/frontend/Magento/luma/composer.json b/app/design/frontend/Magento/luma/composer.json index 6b632b06c66d..586d255cf4ec 100644 --- a/app/design/frontend/Magento/luma/composer.json +++ b/app/design/frontend/Magento/luma/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/theme-frontend-blank": "*" }, diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index e49824d17df8..1bbff4401114 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -3,7 +3,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/mtf": "1.0.0-rc61", "allure-framework/allure-phpunit": "~1.2.0", "doctrine/annotations": "1.4.*", diff --git a/lib/internal/Magento/Framework/Amqp/composer.json b/lib/internal/Magento/Framework/Amqp/composer.json index b3d1b3e9d8ee..796356142058 100644 --- a/lib/internal/Magento/Framework/Amqp/composer.json +++ b/lib/internal/Magento/Framework/Amqp/composer.json @@ -11,7 +11,7 @@ ], "require": { "magento/framework": "*", - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "php-amqplib/php-amqplib": "~2.7.0" }, "autoload": { diff --git a/lib/internal/Magento/Framework/Bulk/composer.json b/lib/internal/Magento/Framework/Bulk/composer.json index db21ec920777..2253e30829ec 100644 --- a/lib/internal/Magento/Framework/Bulk/composer.json +++ b/lib/internal/Magento/Framework/Bulk/composer.json @@ -11,7 +11,7 @@ ], "require": { "magento/framework": "*", - "php": "~7.1.3||~7.2.0" + "php": "~7.1.3||~7.2.0||~7.3.0" }, "autoload": { "psr-4": { diff --git a/lib/internal/Magento/Framework/MessageQueue/composer.json b/lib/internal/Magento/Framework/MessageQueue/composer.json index 6848e5dcaca3..56644e428e5c 100644 --- a/lib/internal/Magento/Framework/MessageQueue/composer.json +++ b/lib/internal/Magento/Framework/MessageQueue/composer.json @@ -11,7 +11,7 @@ ], "require": { "magento/framework": "*", - "php": "~7.1.3||~7.2.0" + "php": "~7.1.3||~7.2.0||~7.3.0" }, "autoload": { "psr-4": { diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index b153cb513af2..06b57f432a25 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -10,7 +10,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "ext-curl": "*", "ext-dom": "*", "ext-gd": "*", From cab77dd2ac99d2103866406dd74075f01c46a107 Mon Sep 17 00:00:00 2001 From: Harald Deiser <h.deiser@techdivision.com> Date: Tue, 28 May 2019 16:17:49 +0200 Subject: [PATCH 079/230] MC-16959: fixed first unit tests --- .../Unit/Controller/BackupActionItemsTest.php | 2 + .../Test/Unit/Controller/DataOptionTest.php | 2 + .../Test/Unit/Controller/EnvironmentTest.php | 65 +++++++++---------- .../Test/Unit/Controller/InstallTest.php | 2 + .../Test/Unit/Controller/MaintenanceTest.php | 2 + .../Test/Unit/Controller/StartUpdaterTest.php | 3 +- 6 files changed, 40 insertions(+), 36 deletions(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php index 572533784dd1..f6004d808ec6 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/BackupActionItemsTest.php @@ -76,6 +76,8 @@ public function setUp() $mvcEvent->expects($this->any())->method('setResponse')->with($response)->willReturn($mvcEvent); $mvcEvent->expects($this->any())->method('setTarget')->with($this->controller)->willReturn($mvcEvent); $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent->expects($this->any())->method('getName')->willReturn('dispatch'); + $contentArray = '{"options":{"code":false,"media":false,"db":true}}'; $request->expects($this->any())->method('getContent')->willReturn($contentArray); diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php index 87fc368e9a1a..264bde3a9440 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php @@ -58,6 +58,8 @@ public function setUp() ->with($this->controller) ->willReturn($this->mvcEvent); $this->mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $this->mvcEvent->expects($this->any())->method('getName')->willReturn('dispatch'); + } public function testIndexAction() diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php index 871d1400c877..105bcbce325d 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php @@ -9,6 +9,7 @@ use Magento\Setup\Controller\ReadinessCheckInstaller; use Magento\Setup\Controller\ReadinessCheckUpdater; use Magento\Setup\Controller\ResponseTypeInterface; +use PHPUnit\Framework\MockObject\MockObject; use Zend\View\Model\JsonModel; /** @@ -61,11 +62,8 @@ public function testFilePermissionsInstaller() $response = $this->createMock(\Zend\Http\PhpEnvironment\Response::class); $routeMatch = $this->createMock(\Zend\Mvc\Router\RouteMatch::class); - $mvcEvent = $this->createMock(\Zend\Mvc\MvcEvent::class); - $mvcEvent->expects($this->once())->method('setRequest')->with($request)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent); - $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent = $this->getMvcEventMock($request, $response, $routeMatch); + $this->permissions->expects($this->once())->method('getMissingWritablePathsForInstallation'); $this->environment->setEvent($mvcEvent); $this->environment->dispatch($request, $response); @@ -78,11 +76,8 @@ public function testPhpVersionActionInstaller() $response = $this->createMock(\Zend\Http\PhpEnvironment\Response::class); $routeMatch = $this->createMock(\Zend\Mvc\Router\RouteMatch::class); - $mvcEvent = $this->createMock(\Zend\Mvc\MvcEvent::class); - $mvcEvent->expects($this->once())->method('setRequest')->with($request)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent); - $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent = $this->getMvcEventMock($request, $response, $routeMatch); + $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckInstaller::INSTALLER); $this->phpReadinessCheck->expects($this->once())->method('checkPhpVersion'); $this->environment->setEvent($mvcEvent); @@ -96,11 +91,8 @@ public function testPhpVersionActionUpdater() $response = $this->createMock(\Zend\Http\PhpEnvironment\Response::class); $routeMatch = $this->createMock(\Zend\Mvc\Router\RouteMatch::class); - $mvcEvent = $this->createMock(\Zend\Mvc\MvcEvent::class); - $mvcEvent->expects($this->once())->method('setRequest')->with($request)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent); - $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent = $this->getMvcEventMock($request, $response, $routeMatch); + $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckUpdater::UPDATER); $this->phpReadinessCheck->expects($this->never())->method('checkPhpVersion'); $read = @@ -120,11 +112,8 @@ public function testPhpSettingsActionInstaller() $response = $this->createMock(\Zend\Http\PhpEnvironment\Response::class); $routeMatch = $this->createMock(\Zend\Mvc\Router\RouteMatch::class); - $mvcEvent = $this->createMock(\Zend\Mvc\MvcEvent::class); - $mvcEvent->expects($this->once())->method('setRequest')->with($request)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent); - $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent = $this->getMvcEventMock($request, $response, $routeMatch); + $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckInstaller::INSTALLER); $this->phpReadinessCheck->expects($this->once())->method('checkPhpSettings'); $this->environment->setEvent($mvcEvent); @@ -138,11 +127,8 @@ public function testPhpSettingsActionUpdater() $response = $this->createMock(\Zend\Http\PhpEnvironment\Response::class); $routeMatch = $this->createMock(\Zend\Mvc\Router\RouteMatch::class); - $mvcEvent = $this->createMock(\Zend\Mvc\MvcEvent::class); - $mvcEvent->expects($this->once())->method('setRequest')->with($request)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent); - $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent = $this->getMvcEventMock($request, $response, $routeMatch); + $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckUpdater::UPDATER); $this->phpReadinessCheck->expects($this->never())->method('checkPhpSettings'); $read = @@ -162,11 +148,8 @@ public function testPhpExtensionsActionInstaller() $response = $this->createMock(\Zend\Http\PhpEnvironment\Response::class); $routeMatch = $this->createMock(\Zend\Mvc\Router\RouteMatch::class); - $mvcEvent = $this->createMock(\Zend\Mvc\MvcEvent::class); - $mvcEvent->expects($this->once())->method('setRequest')->with($request)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent); - $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent = $this->getMvcEventMock($request, $response, $routeMatch); + $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckInstaller::INSTALLER); $this->phpReadinessCheck->expects($this->once())->method('checkPhpExtensions'); $this->environment->setEvent($mvcEvent); @@ -180,11 +163,8 @@ public function testPhpExtensionsActionUpdater() $response = $this->createMock(\Zend\Http\PhpEnvironment\Response::class); $routeMatch = $this->createMock(\Zend\Mvc\Router\RouteMatch::class); - $mvcEvent = $this->createMock(\Zend\Mvc\MvcEvent::class); - $mvcEvent->expects($this->once())->method('setRequest')->with($request)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); - $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent); - $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent = $this->getMvcEventMock($request, $response, $routeMatch); + $request->expects($this->once())->method('getQuery')->willReturn(ReadinessCheckUpdater::UPDATER); $this->phpReadinessCheck->expects($this->never())->method('checkPhpExtensions'); $read = @@ -313,4 +293,19 @@ public function testIndexAction() $model = $this->environment->indexAction(); $this->assertInstanceOf(\Zend\View\Model\JsonModel::class, $model); } + + protected function getMvcEventMock( + MockObject $request, + MockObject $response, + MockObject $routeMatch + ) { + $mvcEvent = $this->createMock(\Zend\Mvc\MvcEvent::class); + $mvcEvent->expects($this->once())->method('setRequest')->with($request)->willReturn($mvcEvent); + $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); + $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent); + $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent->expects($this->any())->method('getName')->willReturn('dispatch'); + + return $mvcEvent; +} } diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php index adc929c286c4..c87b7fa10d9a 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php @@ -213,6 +213,8 @@ public function testDispatch() $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); $mvcEvent->expects($this->once())->method('setTarget')->with($this->controller)->willReturn($mvcEvent); $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent->expects($this->any())->method('getName')->willReturn('dispatch'); + $contentArray = '{"config": { "address": { "base_url": "http://123.45.678.12"}}}'; $request->expects($this->any())->method('getContent')->willReturn($contentArray); diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/MaintenanceTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/MaintenanceTest.php index 995fd4217c71..f4c27ee89078 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/MaintenanceTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/MaintenanceTest.php @@ -38,6 +38,8 @@ public function setUp() $mvcEvent->expects($this->any())->method('setResponse')->with($response)->willReturn($mvcEvent); $mvcEvent->expects($this->any())->method('setTarget')->with($this->controller)->willReturn($mvcEvent); $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $mvcEvent->expects($this->any())->method('getName')->willReturn('dispatch'); + $contentArray = '{"disable":false}'; $request->expects($this->any())->method('getContent')->willReturn($contentArray); diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/StartUpdaterTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/StartUpdaterTest.php index 60748a4b80ba..7833cf113578 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/StartUpdaterTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/StartUpdaterTest.php @@ -71,8 +71,9 @@ public function setUp() ->with($this->controller) ->willReturn($this->mvcEvent); $this->mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); + $this->mvcEvent->expects($this->any())->method('getName')->willReturn('dispatch'); } - + public function testIndexAction() { $viewModel = $this->controller->indexAction(); From 82a6c4e145deb68c052dba7015aeaa4b7fc434cd Mon Sep 17 00:00:00 2001 From: Harald Deiser <h.deiser@techdivision.com> Date: Tue, 28 May 2019 16:21:56 +0200 Subject: [PATCH 080/230] MC-16192: Fixed unit test error factory create on null --- .../Model/ResourceModel/Product/Collection.php | 14 ++++++++++++-- .../Model/ResourceModel/Product/CollectionTest.php | 7 ++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php index d81f6c6f362d..2145f924edee 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php @@ -117,7 +117,12 @@ public function __construct( \Magento\Reports\Model\Event\TypeFactory $eventTypeFactory, \Magento\Catalog\Model\Product\Type $productType, \Magento\Quote\Model\ResourceModel\Quote\Collection $quoteResource, - \Magento\Framework\DB\Adapter\AdapterInterface $connection = null + \Magento\Framework\DB\Adapter\AdapterInterface $connection = null, + \Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory $productLimitationFactory = null, + \Magento\Framework\EntityManager\MetadataPool $metadataPool = null, + \Magento\Catalog\Model\Indexer\Category\Product\TableMaintainer $tableMaintainer = null, + \Magento\Catalog\Model\Indexer\Product\Price\PriceTableResolver $priceTableResolver = null, + \Magento\Framework\Indexer\DimensionFactory $dimensionFactory = null ) { $this->setProductEntityId($product->getEntityIdField()); $this->setProductEntityTableName($product->getEntityTable()); @@ -142,7 +147,12 @@ public function __construct( $customerSession, $dateTime, $groupManagement, - $connection + $connection, + $productLimitationFactory, + $metadataPool, + $tableMaintainer, + $priceTableResolver, + $dimensionFactory ); $this->_eventTypeFactory = $eventTypeFactory; $this->_productType = $productType; diff --git a/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php b/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php index c8a16c247682..6e98f7f04238 100644 --- a/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php +++ b/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php @@ -138,6 +138,10 @@ protected function setUp() $this->resourceMock->expects($this->atLeastOnce())->method('getConnection')->willReturn($this->connectionMock); $this->connectionMock->expects($this->atLeastOnce())->method('select')->willReturn($this->selectMock); + $productLimitationFactoryMock = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory::class) + ->disableOriginalConstructor() + ->getMock(); + $this->collection = new ProductCollection( $entityFactoryMock, $loggerMock, @@ -162,7 +166,8 @@ protected function setUp() $this->eventTypeFactoryMock, $productTypeMock, $quoteResourceMock, - $this->connectionMock + $this->connectionMock, + $productLimitationFactoryMock ); } From 66e551366d7ceb20b11997c30fc46b7993f237df Mon Sep 17 00:00:00 2001 From: Lars Roettig <l.roettig@techdivision.com> Date: Tue, 18 Jun 2019 11:13:02 +0200 Subject: [PATCH 081/230] MC-16957: Allowed to use from php71 up to php73 - composer version fix --- composer.json | 4 +- composer.lock | 708 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 423 insertions(+), 289 deletions(-) diff --git a/composer.json b/composer.json index 1d6c794f947b..f44ddb806789 100644 --- a/composer.json +++ b/composer.json @@ -60,7 +60,7 @@ "zendframework/zend-crypt": "^2.6.0", "zendframework/zend-db": "^2.8.2", "zendframework/zend-di": "^2.6.1", - "zendframework/zend-eventmanager": "^3.0.0", + "zendframework/zend-eventmanager": "^2.6.3", "zendframework/zend-feed": "^2.9.0", "zendframework/zend-form": "^2.10.0", "zendframework/zend-http": "^2.6.0", @@ -75,7 +75,7 @@ "zendframework/zend-servicemanager": "^2.7.8", "zendframework/zend-session": "^2.7.3", "zendframework/zend-soap": "^2.7.0", - "zendframework/zend-stdlib": "^3.2.1", + "zendframework/zend-stdlib": "^2.7.7", "zendframework/zend-text": "^2.6.0", "zendframework/zend-uri": "^2.5.1", "zendframework/zend-validator": "^2.6.0", diff --git a/composer.lock b/composer.lock index bc72c69760d7..e954453ccd0f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0d1d76199a3ce384dc07177d2710a6c5", + "content-hash": "796cf9650cd9b07f87bb2e40d4aee406", "packages": [ { "name": "braintree/braintree_php", @@ -55,16 +55,16 @@ }, { "name": "colinmollenhour/cache-backend-file", - "version": "v1.4.4", + "version": "v1.4.5", "source": { "type": "git", "url": "https://github.com/colinmollenhour/Cm_Cache_Backend_File.git", - "reference": "184171cc79933a828c3f9b1a1054724cea22a216" + "reference": "03c7d4c0f43b2de1b559a3527d18ff697d306544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_File/zipball/184171cc79933a828c3f9b1a1054724cea22a216", - "reference": "184171cc79933a828c3f9b1a1054724cea22a216", + "url": "https://api.github.com/repos/colinmollenhour/Cm_Cache_Backend_File/zipball/03c7d4c0f43b2de1b559a3527d18ff697d306544", + "reference": "03c7d4c0f43b2de1b559a3527d18ff697d306544", "shasum": "" }, "type": "magento-module", @@ -84,7 +84,7 @@ ], "description": "The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the number of cached items increases. This backend makes many changes resulting in a huge performance boost, especially for tag cleaning.", "homepage": "https://github.com/colinmollenhour/Cm_Cache_Backend_File", - "time": "2018-04-05T15:28:43+00:00" + "time": "2019-04-18T21:54:31+00:00" }, { "name": "colinmollenhour/cache-backend-redis", @@ -257,16 +257,16 @@ }, { "name": "composer/composer", - "version": "1.8.4", + "version": "1.8.6", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "bc364c2480c17941e2135cfc568fa41794392534" + "reference": "19b5f66a0e233eb944f134df34091fe1c5dfcc11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/bc364c2480c17941e2135cfc568fa41794392534", - "reference": "bc364c2480c17941e2135cfc568fa41794392534", + "url": "https://api.github.com/repos/composer/composer/zipball/19b5f66a0e233eb944f134df34091fe1c5dfcc11", + "reference": "19b5f66a0e233eb944f134df34091fe1c5dfcc11", "shasum": "" }, "require": { @@ -333,7 +333,7 @@ "dependency", "package" ], - "time": "2019-02-11T09:52:10+00:00" + "time": "2019-06-11T13:03:06+00:00" }, { "name": "composer/semver", @@ -459,16 +459,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "d17708133b6c276d6e42ef887a877866b909d892" + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892", - "reference": "d17708133b6c276d6e42ef887a877866b909d892", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", "shasum": "" }, "require": { @@ -499,7 +499,7 @@ "Xdebug", "performance" ], - "time": "2019-01-28T20:25:53+00:00" + "time": "2019-05-27T17:52:04+00:00" }, { "name": "container-interop/container-interop", @@ -534,16 +534,16 @@ }, { "name": "elasticsearch/elasticsearch", - "version": "v6.1.0", + "version": "v6.7.1", "source": { "type": "git", "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "b237a37b2cdf23a5a17fd3576cdea771394ad00d" + "reference": "7be453dd36d1b141b779f2cb956715f8e04ac2f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/b237a37b2cdf23a5a17fd3576cdea771394ad00d", - "reference": "b237a37b2cdf23a5a17fd3576cdea771394ad00d", + "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/7be453dd36d1b141b779f2cb956715f8e04ac2f4", + "reference": "7be453dd36d1b141b779f2cb956715f8e04ac2f4", "shasum": "" }, "require": { @@ -553,12 +553,12 @@ "psr/log": "~1.0" }, "require-dev": { - "cpliakas/git-wrapper": "~1.0", + "cpliakas/git-wrapper": "^1.7 || ^2.1", "doctrine/inflector": "^1.1", - "mockery/mockery": "0.9.4", - "phpstan/phpstan-shim": "0.8.3", - "phpunit/phpunit": "6.3.0", - "squizlabs/php_codesniffer": "3.0.2", + "mockery/mockery": "^1.2", + "phpstan/phpstan-shim": "^0.9 || ^0.11", + "phpunit/phpunit": "^5.7 || ^6.5", + "squizlabs/php_codesniffer": "^3.4", "symfony/finder": "^2.8", "symfony/yaml": "^2.8" }, @@ -579,6 +579,9 @@ "authors": [ { "name": "Zachary Tong" + }, + { + "name": "Enrico Zimuel" } ], "description": "PHP Client for Elasticsearch", @@ -587,7 +590,7 @@ "elasticsearch", "search" ], - "time": "2019-01-08T18:53:46+00:00" + "time": "2019-05-20T14:15:55+00:00" }, { "name": "guzzlehttp/ringphp", @@ -1108,16 +1111,16 @@ }, { "name": "paragonie/sodium_compat", - "version": "v1.9.1", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "87125d5b265f98c4d1b8d83a1f0726607c229421" + "reference": "228a9fc64cf4ba84c7967c1076d94209db03e0ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/87125d5b265f98c4d1b8d83a1f0726607c229421", - "reference": "87125d5b265f98c4d1b8d83a1f0726607c229421", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/228a9fc64cf4ba84c7967c1076d94209db03e0ee", + "reference": "228a9fc64cf4ba84c7967c1076d94209db03e0ee", "shasum": "" }, "require": { @@ -1186,7 +1189,7 @@ "secret-key cryptography", "side-channel resistant" ], - "time": "2019-03-20T17:19:05+00:00" + "time": "2019-05-13T16:04:50+00:00" }, { "name": "pelago/emogrifier", @@ -1384,16 +1387,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.15", + "version": "2.0.18", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "11cf67cf78dc4acb18dc9149a57be4aee5036ce0" + "reference": "60519001db8d791215a822efd366d24cafee9e63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/11cf67cf78dc4acb18dc9149a57be4aee5036ce0", - "reference": "11cf67cf78dc4acb18dc9149a57be4aee5036ce0", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/60519001db8d791215a822efd366d24cafee9e63", + "reference": "60519001db8d791215a822efd366d24cafee9e63", "shasum": "" }, "require": { @@ -1472,7 +1475,7 @@ "x.509", "x509" ], - "time": "2019-03-10T16:53:45+00:00" + "time": "2019-06-13T06:15:54+00:00" }, { "name": "psr/container", @@ -1843,7 +1846,7 @@ }, { "name": "symfony/console", - "version": "v4.1.11", + "version": "v4.1.12", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -1914,16 +1917,16 @@ }, { "name": "symfony/css-selector", - "version": "v4.2.4", + "version": "v4.3.1", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "48eddf66950fa57996e1be4a55916d65c10c604a" + "reference": "105c98bb0c5d8635bea056135304bd8edcc42b4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/48eddf66950fa57996e1be4a55916d65c10c604a", - "reference": "48eddf66950fa57996e1be4a55916d65c10c604a", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/105c98bb0c5d8635bea056135304bd8edcc42b4d", + "reference": "105c98bb0c5d8635bea056135304bd8edcc42b4d", "shasum": "" }, "require": { @@ -1932,7 +1935,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -1963,11 +1966,11 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-01-16T20:31:39+00:00" + "time": "2019-01-16T21:53:39+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.1.11", + "version": "v4.1.12", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -2030,16 +2033,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.2.4", + "version": "v4.3.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601" + "reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e16b9e471703b2c60b95f14d31c1239f68f11601", - "reference": "e16b9e471703b2c60b95f14d31c1239f68f11601", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/bf2af40d738dec5e433faea7b00daa4431d0a4cf", + "reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf", "shasum": "" }, "require": { @@ -2049,7 +2052,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2076,20 +2079,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-02-07T11:40:08+00:00" + "time": "2019-06-03T20:27:40+00:00" }, { "name": "symfony/finder", - "version": "v4.2.4", + "version": "v4.3.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a" + "reference": "b3d4f4c0e4eadfdd8b296af9ca637cfbf51d8176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/267b7002c1b70ea80db0833c3afe05f0fbde580a", - "reference": "267b7002c1b70ea80db0833c3afe05f0fbde580a", + "url": "https://api.github.com/repos/symfony/finder/zipball/b3d4f4c0e4eadfdd8b296af9ca637cfbf51d8176", + "reference": "b3d4f4c0e4eadfdd8b296af9ca637cfbf51d8176", "shasum": "" }, "require": { @@ -2098,7 +2101,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -2125,7 +2128,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-02-23T15:42:05+00:00" + "time": "2019-05-26T20:47:49+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2246,7 +2249,7 @@ }, { "name": "symfony/process", - "version": "v4.1.11", + "version": "v4.1.12", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -2969,37 +2972,33 @@ }, { "name": "zendframework/zend-eventmanager", - "version": "3.2.1", + "version": "2.6.4", "source": { "type": "git", "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "a5e2583a211f73604691586b8406ff7296a946dd" + "reference": "d238c443220dce4b6396579c8ab2200ec25f9108" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", - "reference": "a5e2583a211f73604691586b8406ff7296a946dd", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/d238c443220dce4b6396579c8ab2200ec25f9108", + "reference": "d238c443220dce4b6396579c8ab2200ec25f9108", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.5 || ^7.0", + "zendframework/zend-stdlib": "^2.7" }, "require-dev": { - "athletic/athletic": "^0.1", - "container-interop/container-interop": "^1.1.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", - "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0" - }, - "suggest": { - "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + "athletic/athletic": "dev-master", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev", - "dev-develop": "3.3-dev" + "dev-release-2.6": "2.6-dev", + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" } }, "autoload": { @@ -3011,15 +3010,12 @@ "license": [ "BSD-3-Clause" ], - "description": "Trigger and listen to events within a PHP application", "homepage": "https://github.com/zendframework/zend-eventmanager", "keywords": [ - "event", "eventmanager", - "events", "zf2" ], - "time": "2018-04-25T15:33:34+00:00" + "time": "2017-12-12T17:48:56+00:00" }, { "name": "zendframework/zend-feed", @@ -4226,16 +4222,16 @@ }, { "name": "zendframework/zend-soap", - "version": "2.7.0", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-soap.git", - "reference": "af03c32f0db2b899b3df8cfe29aeb2b49857d284" + "reference": "8762d79efa220d82529c43ce08d70554146be645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-soap/zipball/af03c32f0db2b899b3df8cfe29aeb2b49857d284", - "reference": "af03c32f0db2b899b3df8cfe29aeb2b49857d284", + "url": "https://api.github.com/repos/zendframework/zend-soap/zipball/8762d79efa220d82529c43ce08d70554146be645", + "reference": "8762d79efa220d82529c43ce08d70554146be645", "shasum": "" }, "require": { @@ -4275,35 +4271,49 @@ "soap", "zf2" ], - "time": "2018-01-29T17:51:26+00:00" + "time": "2019-04-30T16:45:35+00:00" }, { "name": "zendframework/zend-stdlib", - "version": "3.2.1", + "version": "2.7.7", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "66536006722aff9e62d1b331025089b7ec71c065" + "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/66536006722aff9e62d1b331025089b7ec71c065", - "reference": "66536006722aff9e62d1b331025089b7ec71c065", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/0e44eb46788f65e09e077eb7f44d2659143bcc1f", + "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.5 || ^7.0", + "zendframework/zend-hydrator": "~1.1" }, "require-dev": { - "phpbench/phpbench": "^0.13", - "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", - "zendframework/zend-coding-standard": "~1.0.0" + "athletic/athletic": "~0.1", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "~4.0", + "zendframework/zend-config": "~2.5", + "zendframework/zend-eventmanager": "~2.5", + "zendframework/zend-filter": "~2.5", + "zendframework/zend-inputfilter": "~2.5", + "zendframework/zend-serializer": "~2.5", + "zendframework/zend-servicemanager": "~2.5" + }, + "suggest": { + "zendframework/zend-eventmanager": "To support aggregate hydrator usage", + "zendframework/zend-filter": "To support naming strategy hydrator usage", + "zendframework/zend-serializer": "Zend\\Serializer component", + "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev", - "dev-develop": "3.3.x-dev" + "dev-release-2.7": "2.7-dev", + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" } }, "autoload": { @@ -4315,13 +4325,12 @@ "license": [ "BSD-3-Clause" ], - "description": "SPL extensions, array utilities, error handlers, and more", + "homepage": "https://github.com/zendframework/zend-stdlib", "keywords": [ - "ZendFramework", "stdlib", - "zf" + "zf2" ], - "time": "2018-08-28T21:34:05+00:00" + "time": "2016-04-12T21:17:31+00:00" }, { "name": "zendframework/zend-text", @@ -5228,16 +5237,16 @@ }, { "name": "consolidation/output-formatters", - "version": "3.4.1", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/consolidation/output-formatters.git", - "reference": "0881112642ad9059071f13f397f571035b527cb9" + "reference": "99ec998ffb697e0eada5aacf81feebfb13023605" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/0881112642ad9059071f13f397f571035b527cb9", - "reference": "0881112642ad9059071f13f397f571035b527cb9", + "url": "https://api.github.com/repos/consolidation/output-formatters/zipball/99ec998ffb697e0eada5aacf81feebfb13023605", + "reference": "99ec998ffb697e0eada5aacf81feebfb13023605", "shasum": "" }, "require": { @@ -5325,7 +5334,7 @@ } ], "description": "Format text by applying transformations provided by plug-in formatters.", - "time": "2019-03-14T03:45:44+00:00" + "time": "2019-05-30T23:16:01+00:00" }, { "name": "consolidation/robo", @@ -5614,16 +5623,16 @@ }, { "name": "doctrine/collections", - "version": "v1.6.1", + "version": "v1.6.2", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "d2ae4ef05e25197343b6a39bae1d3c427a2f6956" + "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/d2ae4ef05e25197343b6a39bae1d3c427a2f6956", - "reference": "d2ae4ef05e25197343b6a39bae1d3c427a2f6956", + "url": "https://api.github.com/repos/doctrine/collections/zipball/c5e0bc17b1620e97c968ac409acbff28b8b850be", + "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be", "shasum": "" }, "require": { @@ -5680,7 +5689,7 @@ "iterators", "php" ], - "time": "2019-03-25T19:03:48+00:00" + "time": "2019-06-09T13:48:14+00:00" }, { "name": "doctrine/instantiator", @@ -5740,21 +5749,24 @@ }, { "name": "doctrine/lexer", - "version": "v1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, "type": "library", "extra": { "branch-alias": { @@ -5762,8 +5774,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -5784,13 +5796,16 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ + "annotations", + "docblock", "lexer", - "parser" + "parser", + "php" ], - "time": "2014-09-09T13:34:57+00:00" + "time": "2019-06-08T11:03:04+00:00" }, { "name": "epfremme/swagger-php", @@ -5840,16 +5855,16 @@ }, { "name": "facebook/webdriver", - "version": "1.6.0", + "version": "1.7.1", "source": { "type": "git", "url": "https://github.com/facebook/php-webdriver.git", - "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e" + "reference": "e43de70f3c7166169d0f14a374505392734160e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/bd8c740097eb9f2fc3735250fc1912bc811a954e", - "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/e43de70f3c7166169d0f14a374505392734160e5", + "reference": "e43de70f3c7166169d0f14a374505392734160e5", "shasum": "" }, "require": { @@ -5896,7 +5911,7 @@ "selenium", "webdriver" ], - "time": "2018-05-16T17:37:13+00:00" + "time": "2019-06-13T08:02:18+00:00" }, { "name": "flow/jsonpath", @@ -5941,16 +5956,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.14.3", + "version": "v2.14.4", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "a9132a872dab61e37161c6db2fb8a6f46141d17e" + "reference": "69ccf81f3c968be18d646918db94ab88ddf3594f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/a9132a872dab61e37161c6db2fb8a6f46141d17e", - "reference": "a9132a872dab61e37161c6db2fb8a6f46141d17e", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/69ccf81f3c968be18d646918db94ab88ddf3594f", + "reference": "69ccf81f3c968be18d646918db94ab88ddf3594f", "shasum": "" }, "require": { @@ -5982,7 +5997,7 @@ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1", "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1", "phpunitgoodpractices/traits": "^1.8", - "symfony/phpunit-bridge": "^4.0" + "symfony/phpunit-bridge": "^4.3" }, "suggest": { "ext-mbstring": "For handling non-UTF8 characters in cache signature.", @@ -6025,7 +6040,7 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2019-05-04T21:34:42+00:00" + "time": "2019-06-01T10:29:34+00:00" }, { "name": "fzaninotto/faker", @@ -6447,16 +6462,16 @@ }, { "name": "jms/serializer", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/serializer.git", - "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c" + "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/00863e1d55b411cc33ad3e1de09a4c8d3aae793c", - "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", + "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", "shasum": "" }, "require": { @@ -6496,7 +6511,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.13-dev" + "dev-1.x": "1.14-dev" } }, "autoload": { @@ -6527,7 +6542,7 @@ "serialization", "xml" ], - "time": "2018-07-25T13:58:54+00:00" + "time": "2019-04-17T08:12:16+00:00" }, { "name": "league/container", @@ -6663,16 +6678,16 @@ }, { "name": "magento/magento-coding-standard", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/magento/magento-coding-standard.git", - "reference": "489029a285c637825294e272d31c3f4ac00a454e" + "reference": "f7de26fb6add389d1b42286f67ee87424588a868" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/489029a285c637825294e272d31c3f4ac00a454e", - "reference": "489029a285c637825294e272d31c3f4ac00a454e", + "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/f7de26fb6add389d1b42286f67ee87424588a868", + "reference": "f7de26fb6add389d1b42286f67ee87424588a868", "shasum": "" }, "require": { @@ -6689,20 +6704,20 @@ "AFL-3.0" ], "description": "A set of Magento specific PHP CodeSniffer rules.", - "time": "2019-04-01T17:03:33+00:00" + "time": "2019-04-05T19:05:17+00:00" }, { "name": "magento/magento2-functional-testing-framework", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/magento/magento2-functional-testing-framework.git", - "reference": "ef534dbcb3aeea68f9254dfd018165c546ad2edb" + "reference": "9b5de03fe069d4a36c911112c30b824ff4e80c3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/ef534dbcb3aeea68f9254dfd018165c546ad2edb", - "reference": "ef534dbcb3aeea68f9254dfd018165c546ad2edb", + "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/9b5de03fe069d4a36c911112c30b824ff4e80c3a", + "reference": "9b5de03fe069d4a36c911112c30b824ff4e80c3a", "shasum": "" }, "require": { @@ -6762,20 +6777,20 @@ "magento", "testing" ], - "time": "2019-04-29T20:56:26+00:00" + "time": "2019-06-10T17:57:40+00:00" }, { - "name": "mikey179/vfsStream", - "version": "v1.6.5", + "name": "mikey179/vfsstream", + "version": "v1.6.6", "source": { "type": "git", "url": "https://github.com/bovigo/vfsStream.git", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145" + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", - "reference": "d5fec95f541d4d71c4823bb5e30cf9b9e5b96145", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/095238a0711c974ae5b4ebf4c4534a23f3f6c99d", + "reference": "095238a0711c974ae5b4ebf4c4534a23f3f6c99d", "shasum": "" }, "require": { @@ -6808,7 +6823,7 @@ ], "description": "Virtual file system to mock the real file system in unit tests.", "homepage": "http://vfs.bovigo.org/", - "time": "2017-08-01T08:02:14+00:00" + "time": "2019-04-08T13:54:32+00:00" }, { "name": "moontoast/math", @@ -6907,16 +6922,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.8.1", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" + "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", - "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", + "reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", "shasum": "" }, "require": { @@ -6951,7 +6966,7 @@ "object", "object graph" ], - "time": "2018-06-11T23:09:50+00:00" + "time": "2019-04-07T13:18:21+00:00" }, { "name": "pdepend/pdepend", @@ -7250,16 +7265,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "version": "4.3.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", "shasum": "" }, "require": { @@ -7297,7 +7312,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" + "time": "2019-04-30T17:48:53+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -7464,16 +7479,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.8.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", "shasum": "" }, "require": { @@ -7494,8 +7509,8 @@ } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -7523,7 +7538,7 @@ "spy", "stub" ], - "time": "2018-08-05T17:53:17+00:00" + "time": "2019-06-13T12:50:23+00:00" }, { "name": "phpunit/php-code-coverage", @@ -8659,16 +8674,16 @@ }, { "name": "symfony/browser-kit", - "version": "v4.2.4", + "version": "v4.3.1", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "61d85c5af2fc058014c7c89504c3944e73a086f0" + "reference": "e07d50e84b8cf489590f22244f4f609579b4a2c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/61d85c5af2fc058014c7c89504c3944e73a086f0", - "reference": "61d85c5af2fc058014c7c89504c3944e73a086f0", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e07d50e84b8cf489590f22244f4f609579b4a2c4", + "reference": "e07d50e84b8cf489590f22244f4f609579b4a2c4", "shasum": "" }, "require": { @@ -8677,6 +8692,8 @@ }, "require-dev": { "symfony/css-selector": "~3.4|~4.0", + "symfony/http-client": "^4.3", + "symfony/mime": "^4.3", "symfony/process": "~3.4|~4.0" }, "suggest": { @@ -8685,7 +8702,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -8712,20 +8729,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2019-02-23T15:17:42+00:00" + "time": "2019-05-30T16:10:05+00:00" }, { "name": "symfony/config", - "version": "v4.2.4", + "version": "v4.3.1", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "7f70d79c7a24a94f8e98abb988049403a53d7b31" + "reference": "6379ee07398643e09e6ed1e87d9c62dfcad7f4eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/7f70d79c7a24a94f8e98abb988049403a53d7b31", - "reference": "7f70d79c7a24a94f8e98abb988049403a53d7b31", + "url": "https://api.github.com/repos/symfony/config/zipball/6379ee07398643e09e6ed1e87d9c62dfcad7f4eb", + "reference": "6379ee07398643e09e6ed1e87d9c62dfcad7f4eb", "shasum": "" }, "require": { @@ -8740,6 +8757,7 @@ "symfony/dependency-injection": "~3.4|~4.0", "symfony/event-dispatcher": "~3.4|~4.0", "symfony/finder": "~3.4|~4.0", + "symfony/messenger": "~4.1", "symfony/yaml": "~3.4|~4.0" }, "suggest": { @@ -8748,7 +8766,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -8775,48 +8793,61 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-02-23T15:17:42+00:00" + "time": "2019-05-30T16:10:05+00:00" }, { - "name": "symfony/contracts", - "version": "v1.0.2", + "name": "symfony/dependency-injection", + "version": "v4.3.1", "source": { "type": "git", - "url": "https://github.com/symfony/contracts.git", - "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "fea7f73e278ee0337349a5a68b867fc656bb33f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", - "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/fea7f73e278ee0337349a5a68b867fc656bb33f3", + "reference": "fea7f73e278ee0337349a5a68b867fc656bb33f3", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "psr/container": "^1.0", + "symfony/service-contracts": "^1.1.2" + }, + "conflict": { + "symfony/config": "<4.3", + "symfony/finder": "<3.4", + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0" }, "require-dev": { - "psr/cache": "^1.0", - "psr/container": "^1.0" + "symfony/config": "^4.3", + "symfony/expression-language": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { - "psr/cache": "When using the Cache contracts", - "psr/container": "When using the Service contracts", - "symfony/cache-contracts-implementation": "", - "symfony/service-contracts-implementation": "", - "symfony/translation-contracts-implementation": "" + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "4.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Contracts\\": "" + "Symfony\\Component\\DependencyInjection\\": "" }, "exclude-from-classmap": [ - "**/Tests/" + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -8825,76 +8856,56 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "A set of abstractions extracted out of the Symfony components", + "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2018-12-05T08:06:11+00:00" + "time": "2019-05-30T16:10:05+00:00" }, { - "name": "symfony/dependency-injection", - "version": "v4.2.4", + "name": "symfony/dom-crawler", + "version": "v4.3.1", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "cdadb3765df7c89ac93628743913b92bb91f1704" + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "06ee58fbc9a8130f1d35b5280e15235a0515d457" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/cdadb3765df7c89ac93628743913b92bb91f1704", - "reference": "cdadb3765df7c89ac93628743913b92bb91f1704", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/06ee58fbc9a8130f1d35b5280e15235a0515d457", + "reference": "06ee58fbc9a8130f1d35b5280e15235a0515d457", "shasum": "" }, "require": { "php": "^7.1.3", - "psr/container": "^1.0", - "symfony/contracts": "^1.0" + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/config": "<4.2", - "symfony/finder": "<3.4", - "symfony/proxy-manager-bridge": "<3.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "psr/container-implementation": "1.0", - "symfony/service-contracts-implementation": "1.0" + "masterminds/html5": "<2.6" }, "require-dev": { - "symfony/config": "~4.2", - "symfony/expression-language": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" + "masterminds/html5": "^2.6", + "symfony/css-selector": "~3.4|~4.0" }, "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "symfony/css-selector": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" + "Symfony\\Component\\DomCrawler\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -8914,44 +8925,42 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony DependencyInjection Component", + "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2019-02-23T15:17:42+00:00" + "time": "2019-05-31T18:55:30+00:00" }, { - "name": "symfony/dom-crawler", - "version": "v4.2.4", + "name": "symfony/http-foundation", + "version": "v4.3.1", "source": { "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "53c97769814c80a84a8403efcf3ae7ae966d53bb" + "url": "https://github.com/symfony/http-foundation.git", + "reference": "b7e4945dd9b277cd24e93566e4da0a87956392a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/53c97769814c80a84a8403efcf3ae7ae966d53bb", - "reference": "53c97769814c80a84a8403efcf3ae7ae966d53bb", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b7e4945dd9b277cd24e93566e4da0a87956392a9", + "reference": "b7e4945dd9b277cd24e93566e4da0a87956392a9", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0" + "symfony/mime": "^4.3", + "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "symfony/css-selector": "~3.4|~4.0" - }, - "suggest": { - "symfony/css-selector": "" + "predis/predis": "~1.0", + "symfony/expression-language": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" + "Symfony\\Component\\HttpFoundation\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -8971,41 +8980,42 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony DomCrawler Component", + "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-02-23T15:17:42+00:00" + "time": "2019-06-06T10:05:02+00:00" }, { - "name": "symfony/http-foundation", - "version": "v4.2.4", + "name": "symfony/mime", + "version": "v4.3.1", "source": { "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "850a667d6254ccf6c61d853407b16f21c4579c77" + "url": "https://github.com/symfony/mime.git", + "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/850a667d6254ccf6c61d853407b16f21c4579c77", - "reference": "850a667d6254ccf6c61d853407b16f21c4579c77", + "url": "https://api.github.com/repos/symfony/mime/zipball/ec2c5565de60e03f33d4296a655e3273f0ad1f8b", + "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.1" + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0" }, "require-dev": { - "predis/predis": "~1.0", - "symfony/expression-language": "~3.4|~4.0" + "egulias/email-validator": "^2.0", + "symfony/dependency-injection": "~3.4|^4.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" + "Symfony\\Component\\Mime\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -9025,22 +9035,26 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony HttpFoundation Component", + "description": "A library to manipulate MIME messages", "homepage": "https://symfony.com", - "time": "2019-02-26T08:03:39+00:00" + "keywords": [ + "mime", + "mime-type" + ], + "time": "2019-06-04T09:22:54+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.2.4", + "version": "v4.3.1", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1" + "reference": "914e0edcb7cd0c9f494bc023b1d47534f4542332" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/3896e5a7d06fd15fa4947694c8dcdd371ff147d1", - "reference": "3896e5a7d06fd15fa4947694c8dcdd371ff147d1", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/914e0edcb7cd0c9f494bc023b1d47534f4542332", + "reference": "914e0edcb7cd0c9f494bc023b1d47534f4542332", "shasum": "" }, "require": { @@ -9049,7 +9063,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9081,7 +9095,69 @@ "configuration", "options" ], - "time": "2019-02-23T15:17:42+00:00" + "time": "2019-05-10T05:38:46+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.11.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c766e95bec706cdd89903b1eda8afab7d7a6b7af", + "reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.9" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2019-03-04T13:44:35+00:00" }, { "name": "symfony/polyfill-php70", @@ -9197,28 +9273,86 @@ ], "time": "2019-02-06T07:57:58+00:00" }, + { + "name": "symfony/service-contracts", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0", + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "suggest": { + "psr/container": "", + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-05-28T07:50:59+00:00" + }, { "name": "symfony/stopwatch", - "version": "v4.2.4", + "version": "v4.3.1", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67" + "reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b1a5f646d56a3290230dbc8edf2a0d62cda23f67", - "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6b100e9309e8979cf1978ac1778eb155c1f7d93b", + "reference": "6b100e9309e8979cf1978ac1778eb155c1f7d93b", "shasum": "" }, "require": { "php": "^7.1.3", - "symfony/contracts": "^1.0" + "symfony/service-contracts": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9245,20 +9379,20 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-01-16T20:31:39+00:00" + "time": "2019-05-27T08:16:38+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.23", + "version": "v3.4.28", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "57f1ce82c997f5a8701b89ef970e36bb657fd09c" + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/57f1ce82c997f5a8701b89ef970e36bb657fd09c", - "reference": "57f1ce82c997f5a8701b89ef970e36bb657fd09c", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", "shasum": "" }, "require": { @@ -9304,7 +9438,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-02-23T15:06:07+00:00" + "time": "2019-03-25T07:48:46+00:00" }, { "name": "theseer/fdomdocument", @@ -9348,16 +9482,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.1.0", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", "shasum": "" }, "require": { @@ -9384,7 +9518,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2019-06-13T22:48:21+00:00" }, { "name": "vlucas/phpdotenv", From 245d5816236e45996399f75fec5e1a84bc440960 Mon Sep 17 00:00:00 2001 From: Lars Roettig <l.roettig@techdivision.com> Date: Wed, 19 Jun 2019 17:34:15 +0200 Subject: [PATCH 082/230] MC-16959: Fix for strpos --- .../Analytics/Model/Connector/Http/ResponseResolver.php | 2 +- app/code/Magento/Backend/App/Area/FrontNameResolver.php | 2 +- app/code/Magento/Braintree/Model/LocaleResolver.php | 2 +- .../Catalog/Model/Category/Attribute/Backend/Image.php | 2 +- app/code/Magento/Catalog/Model/Category/FileInfo.php | 2 +- app/code/Magento/Catalog/Model/CategoryManagement.php | 2 +- .../Product/Form/Modifier/AbstractModifier.php | 2 +- app/code/Magento/Checkout/Controller/Cart.php | 4 ++-- app/code/Magento/Cms/Model/Block.php | 2 +- app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php | 8 ++++---- .../Magento/Customer/Model/Checkout/ConfigProvider.php | 2 +- app/code/Magento/Deploy/Service/Bundle.php | 2 +- app/code/Magento/Eav/Model/Entity/Increment/Alphanum.php | 4 ++-- .../Magento/Eav/Model/Entity/Increment/NumericValue.php | 2 +- .../Model/Adapter/Index/IndexNameResolver.php | 2 +- .../PageCache/Model/System/Config/Backend/Varnish.php | 2 +- .../Observer/CheckExpirePersistentQuoteObserver.php | 4 ++-- app/code/Magento/ProductAlert/Controller/Add/Price.php | 4 ++-- app/code/Magento/Sales/Model/Download.php | 2 +- app/code/Magento/Sitemap/Model/Sitemap.php | 6 +++--- app/code/Magento/Store/App/Response/Redirect.php | 2 +- app/code/Magento/Store/Model/BaseUrlChecker.php | 2 +- app/code/Magento/Store/Model/Config/Placeholder.php | 4 ++-- app/code/Magento/Theme/Helper/Storage.php | 6 +++--- .../Magento/Theme/Model/Design/Backend/Exceptions.php | 2 +- app/code/Magento/Theme/Model/Theme/Registration.php | 2 +- app/code/Magento/Theme/Model/Wysiwyg/Storage.php | 2 +- app/code/Magento/Translation/Model/Inline/Parser.php | 2 +- app/code/Magento/Translation/Model/Json/PreProcessor.php | 2 +- .../Variable/Ui/Component/VariablesDataProvider.php | 2 +- app/code/Magento/Webapi/Model/Rest/Config.php | 2 +- app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php | 2 +- .../Rest/AsynchronousSchemaRequestProcessor.php | 2 +- 33 files changed, 45 insertions(+), 45 deletions(-) diff --git a/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php b/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php index 57b61c1b5562..b3f8f9d4c97d 100644 --- a/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php +++ b/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php @@ -41,7 +41,7 @@ public function getResult(\Zend_Http_Response $response) $converterMediaType = $this->converter->getContentMediaType(); /** Content-Type header may not only contain media-type declaration */ - if ($response->getBody() && is_int(strripos($response->getHeader('Content-Type'), $converterMediaType))) { + if ($response->getBody() && is_int(strripos($response->getHeader('Content-Type'), (string) $converterMediaType))) { $responseBody = $this->converter->fromBody($response->getBody()); } else { $responseBody = []; diff --git a/app/code/Magento/Backend/App/Area/FrontNameResolver.php b/app/code/Magento/Backend/App/Area/FrontNameResolver.php index ed82c5a9c6e1..0738804b5f76 100644 --- a/app/code/Magento/Backend/App/Area/FrontNameResolver.php +++ b/app/code/Magento/Backend/App/Area/FrontNameResolver.php @@ -105,7 +105,7 @@ public function isHostBackend() $backendUrl = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE); } $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; - return stripos($this->getHostWithPort($backendUrl), $host) !== false; + return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false; } /** diff --git a/app/code/Magento/Braintree/Model/LocaleResolver.php b/app/code/Magento/Braintree/Model/LocaleResolver.php index cebd90dffc70..5dcd2e8a343e 100644 --- a/app/code/Magento/Braintree/Model/LocaleResolver.php +++ b/app/code/Magento/Braintree/Model/LocaleResolver.php @@ -72,7 +72,7 @@ public function getLocale() $locale = $this->resolver->getLocale(); $allowedLocales = $this->config->getValue('supported_locales'); - return strpos($allowedLocales, $locale) !== false ? $locale : 'en_US'; + return strpos($allowedLocales, (string) $locale) !== false ? $locale : 'en_US'; } /** diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php index cd450e26cd83..5e3755452173 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php @@ -153,7 +153,7 @@ private function fileResidesOutsideCategoryDir($value) $fileUrl = ltrim($value[0]['url'], '/'); $baseMediaDir = $this->_filesystem->getUri(DirectoryList::MEDIA); - $usingPathRelativeToBase = strpos($fileUrl, $baseMediaDir) === 0; + $usingPathRelativeToBase = strpos($fileUrl, (string) $baseMediaDir) === 0; return $usingPathRelativeToBase; } diff --git a/app/code/Magento/Catalog/Model/Category/FileInfo.php b/app/code/Magento/Catalog/Model/Category/FileInfo.php index cd3592ef40a0..d77f472c6be9 100644 --- a/app/code/Magento/Catalog/Model/Category/FileInfo.php +++ b/app/code/Magento/Catalog/Model/Category/FileInfo.php @@ -180,7 +180,7 @@ public function isBeginsWithMediaDirectoryPath($fileName) $filePath = ltrim($fileName, '/'); $mediaDirectoryRelativeSubpath = $this->getMediaDirectoryPathRelativeToBaseDirectoryPath($filePath); - $isFileNameBeginsWithMediaDirectoryPath = strpos($filePath, $mediaDirectoryRelativeSubpath) === 0; + $isFileNameBeginsWithMediaDirectoryPath = strpos($filePath, (string) $mediaDirectoryRelativeSubpath) === 0; return $isFileNameBeginsWithMediaDirectoryPath; } diff --git a/app/code/Magento/Catalog/Model/CategoryManagement.php b/app/code/Magento/Catalog/Model/CategoryManagement.php index fadb4c0c8474..c259bcea6040 100644 --- a/app/code/Magento/Catalog/Model/CategoryManagement.php +++ b/app/code/Magento/Catalog/Model/CategoryManagement.php @@ -113,7 +113,7 @@ public function move($categoryId, $parentId, $afterId = null) $afterId = ($afterId === null || $afterId > $lastId) ? $lastId : $afterId; } - if (strpos($parentCategory->getPath(), $model->getPath()) === 0) { + if (strpos($parentCategory->getPath(), (string) $model->getPath()) === 0) { throw new \Magento\Framework\Exception\LocalizedException( __('Operation do not allow to move a parent category to any of children category') ); diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php index 249a00a98bff..6280c9b11826 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php @@ -132,7 +132,7 @@ private function _getNextAttributeSortOrder(array $meta, $attributeCodes, $defau */ protected function startsWith($haystack, $needle) { - return $needle === '' || strrpos($haystack, $needle, -strlen($haystack)) !== false; + return $needle === '' || strrpos($haystack, (string) $needle, -strlen($haystack)) !== false; } /** diff --git a/app/code/Magento/Checkout/Controller/Cart.php b/app/code/Magento/Checkout/Controller/Cart.php index d7b09c17ee03..0c65fa9a51f4 100644 --- a/app/code/Magento/Checkout/Controller/Cart.php +++ b/app/code/Magento/Checkout/Controller/Cart.php @@ -98,8 +98,8 @@ protected function _isInternalUrl($url) */ /** @var $store \Magento\Store\Model\Store */ $store = $this->_storeManager->getStore(); - $unsecure = strpos($url, $store->getBaseUrl()) === 0; - $secure = strpos($url, $store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK, true)) === 0; + $unsecure = strpos($url, (string) $store->getBaseUrl()) === 0; + $secure = strpos($url, (string) $store->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK, true)) === 0; return $unsecure || $secure; } diff --git a/app/code/Magento/Cms/Model/Block.php b/app/code/Magento/Cms/Model/Block.php index 0261ef46a494..9da444c72e80 100644 --- a/app/code/Magento/Cms/Model/Block.php +++ b/app/code/Magento/Cms/Model/Block.php @@ -63,7 +63,7 @@ public function beforeSave() } $needle = 'block_id="' . $this->getId() . '"'; - if (false == strstr($this->getContent(), $needle)) { + if (false == strstr($this->getContent(), (string) $needle)) { return parent::beforeSave(); } throw new \Magento\Framework\Exception\LocalizedException( diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index dfbbce99b651..70f0bde49fc4 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -523,7 +523,7 @@ public function getThumbnailPath($filePath, $checkFile = false) { $mediaRootDir = $this->_cmsWysiwygImages->getStorageRoot(); - if (strpos($filePath, $mediaRootDir) === 0) { + if (strpos($filePath, (string) $mediaRootDir) === 0) { $thumbPath = $this->getThumbnailRoot() . substr($filePath, strlen($mediaRootDir)); if (!$checkFile || $this->_directory->isExist($this->_directory->getRelativePath($thumbPath))) { @@ -545,7 +545,7 @@ public function getThumbnailUrl($filePath, $checkFile = false) { $mediaRootDir = $this->_cmsWysiwygImages->getStorageRoot(); - if (strpos($filePath, $mediaRootDir) === 0) { + if (strpos($filePath, (string) $mediaRootDir) === 0) { $thumbSuffix = self::THUMBS_DIRECTORY_NAME . substr($filePath, strlen($mediaRootDir)); if (!$checkFile || $this->_directory->isExist( $this->_directory->getRelativePath($mediaRootDir . '/' . $thumbSuffix) @@ -623,7 +623,7 @@ public function getThumbsPath($filePath = false) $mediaRootDir = $this->_cmsWysiwygImages->getStorageRoot(); $thumbnailDir = $this->getThumbnailRoot(); - if ($filePath && strpos($filePath, $mediaRootDir) === 0) { + if ($filePath && strpos($filePath, (string) $mediaRootDir) === 0) { $thumbnailDir .= dirname(substr($filePath, strlen($mediaRootDir))); } @@ -723,7 +723,7 @@ protected function _validatePath($path) __('We can\'t delete root directory %1 right now.', $path) ); } - if (strpos($path, $root) !== 0) { + if (strpos($path, (string) $root) !== 0) { throw new \Magento\Framework\Exception\LocalizedException( __('Directory %1 is not under storage root path.', $path) ); diff --git a/app/code/Magento/Customer/Model/Checkout/ConfigProvider.php b/app/code/Magento/Customer/Model/Checkout/ConfigProvider.php index 36eabe3571ce..e212dea27369 100644 --- a/app/code/Magento/Customer/Model/Checkout/ConfigProvider.php +++ b/app/code/Magento/Customer/Model/Checkout/ConfigProvider.php @@ -101,7 +101,7 @@ protected function isRedirectRequired() { $baseUrl = $this->storeManager->getStore()->getBaseUrl(); - if (strpos($this->getLoginUrl(), $baseUrl) !== false) { + if (strpos($this->getLoginUrl(), (string) $baseUrl) !== false) { return false; } diff --git a/app/code/Magento/Deploy/Service/Bundle.php b/app/code/Magento/Deploy/Service/Bundle.php index 95c1d7d22a09..351413fd05f3 100644 --- a/app/code/Magento/Deploy/Service/Bundle.php +++ b/app/code/Magento/Deploy/Service/Bundle.php @@ -201,7 +201,7 @@ private function isExcluded($filePath, $area, $theme) $excludedDirs = $this->bundleConfig->getExcludedDirectories($area, $theme); foreach ($excludedDirs as $directoryId) { $directoryPath = $this->prepareExcludePath($directoryId); - if (strpos($filePath, $directoryPath) === 0) { + if (strpos($filePath, (string) $directoryPath) === 0) { return true; } } diff --git a/app/code/Magento/Eav/Model/Entity/Increment/Alphanum.php b/app/code/Magento/Eav/Model/Entity/Increment/Alphanum.php index 4e44cef825d7..f0b1d621e5ac 100644 --- a/app/code/Magento/Eav/Model/Entity/Increment/Alphanum.php +++ b/app/code/Magento/Eav/Model/Entity/Increment/Alphanum.php @@ -38,7 +38,7 @@ public function getNextId() { $lastId = $this->getLastId(); - if (strpos($lastId, $this->getPrefix()) === 0) { + if (strpos($lastId, (string) $this->getPrefix()) === 0) { $lastId = substr($lastId, strlen($this->getPrefix())); } @@ -51,7 +51,7 @@ public function getNextId() $lid = strlen($lastId) - 1; for ($i = $lid; $i >= 0; $i--) { - $p = strpos($chars, $lastId[$i]); + $p = strpos($chars, (string) $lastId[$i]); if (false === $p) { throw new \Magento\Framework\Exception\LocalizedException( __('Invalid character encountered in increment ID: %1', $lastId) diff --git a/app/code/Magento/Eav/Model/Entity/Increment/NumericValue.php b/app/code/Magento/Eav/Model/Entity/Increment/NumericValue.php index b86b1e33c585..1bd3b29204f8 100644 --- a/app/code/Magento/Eav/Model/Entity/Increment/NumericValue.php +++ b/app/code/Magento/Eav/Model/Entity/Increment/NumericValue.php @@ -28,7 +28,7 @@ public function getNextId() { $last = $this->getLastId(); - if (strpos($last, $this->getPrefix()) === 0) { + if (strpos($last, (string) $this->getPrefix()) === 0) { $last = (int)substr($last, strlen($this->getPrefix())); } else { $last = (int)$last; diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/Index/IndexNameResolver.php b/app/code/Magento/Elasticsearch/Model/Adapter/Index/IndexNameResolver.php index 742af4247524..f69f7001d5bc 100644 --- a/app/code/Magento/Elasticsearch/Model/Adapter/Index/IndexNameResolver.php +++ b/app/code/Magento/Elasticsearch/Model/Adapter/Index/IndexNameResolver.php @@ -150,7 +150,7 @@ public function getIndexFromAlias($storeId, $mappedIndexerId) $alias = $this->client->getAlias($namespace); $indices = array_keys($alias); foreach ($indices as $index) { - if (strpos($index, $indexPattern) === 0) { + if (strpos($index, (string) $indexPattern) === 0) { $storeIndex = $index; break; } diff --git a/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php b/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php index d98601c78260..7fb27cdee7f1 100644 --- a/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php +++ b/app/code/Magento/PageCache/Model/System/Config/Backend/Varnish.php @@ -58,7 +58,7 @@ protected function _afterLoad() $currentValue = $this->getValue(); if (!$currentValue) { foreach ($data as $field => $value) { - if (strstr($this->getPath(), $field)) { + if (strstr($this->getPath(), (string) $field)) { $this->setValue($value); $this->save(); break; diff --git a/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php b/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php index 79fdf44c3c55..8c56aafa04be 100644 --- a/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php +++ b/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php @@ -137,8 +137,8 @@ private function isRequestFromCheckoutPage(\Magento\Framework\App\RequestInterfa /** @var bool $isCheckoutPage */ $isCheckoutPage = ( - false !== strpos($requestUri, $this->checkoutPagePath) || - false !== strpos($refererUri, $this->checkoutPagePath) + false !== strpos($requestUri, (string) $this->checkoutPagePath) || + false !== strpos($refererUri, (string) $this->checkoutPagePath) ); return $isCheckoutPage; diff --git a/app/code/Magento/ProductAlert/Controller/Add/Price.php b/app/code/Magento/ProductAlert/Controller/Add/Price.php index b7519f0bc7a5..973db8c3bf5d 100644 --- a/app/code/Magento/ProductAlert/Controller/Add/Price.php +++ b/app/code/Magento/ProductAlert/Controller/Add/Price.php @@ -61,8 +61,8 @@ protected function isInternal($url) return false; } $currentStore = $this->storeManager->getStore(); - return strpos($url, $currentStore->getBaseUrl()) === 0 - || strpos($url, $currentStore->getBaseUrl(UrlInterface::URL_TYPE_LINK, true)) === 0; + return strpos($url, (string) $currentStore->getBaseUrl()) === 0 + || strpos($url, (string) $currentStore->getBaseUrl(UrlInterface::URL_TYPE_LINK, true)) === 0; } /** diff --git a/app/code/Magento/Sales/Model/Download.php b/app/code/Magento/Sales/Model/Download.php index a76b72bfa41d..e4a0a0ba93e7 100644 --- a/app/code/Magento/Sales/Model/Download.php +++ b/app/code/Magento/Sales/Model/Download.php @@ -98,7 +98,7 @@ protected function _isCanProcessed($relativePath) { $filePath = $this->_rootDir->getAbsolutePath($relativePath); $pathWithFixedSeparator = str_replace('\\', '/', $this->_rootDir->getDriver()->getRealPath($filePath)); - return (strpos($pathWithFixedSeparator, $relativePath) !== false + return (strpos($pathWithFixedSeparator, (string) $relativePath) !== false && $this->_rootDir->isFile($relativePath) && $this->_rootDir->isReadable($relativePath)) || $this->_processDatabaseFile($filePath, $relativePath); } diff --git a/app/code/Magento/Sitemap/Model/Sitemap.php b/app/code/Magento/Sitemap/Model/Sitemap.php index d0beac8697f8..aa3068a440ec 100644 --- a/app/code/Magento/Sitemap/Model/Sitemap.php +++ b/app/code/Magento/Sitemap/Model/Sitemap.php @@ -746,7 +746,7 @@ protected function _getStoreBaseDomain() $documentRoot = trim(str_replace('\\', '/', $this->_getDocumentRoot()), '/'); $baseDir = trim(str_replace('\\', '/', $this->_getBaseDir()), '/'); - if (strpos($baseDir, $documentRoot) === 0) { + if (strpos($baseDir, (string) $documentRoot) === 0) { //case when basedir is in document root $installationFolder = trim(str_replace($documentRoot, '', $baseDir), '/'); $storeDomain = rtrim($url . '/' . $installationFolder, '/'); @@ -802,7 +802,7 @@ protected function _addSitemapToRobotsTxt($sitemapFileName) $content = $this->_directory->readFile($filename); } - if (strpos($content, $robotsSitemapLine) === false) { + if (strpos($content, (string) $robotsSitemapLine) === false) { if (!empty($content)) { $content .= $this->_findNewLinesDelimiter($content); } @@ -821,7 +821,7 @@ protected function _addSitemapToRobotsTxt($sitemapFileName) private function _findNewLinesDelimiter($text) { foreach ($this->_crlf as $delimiter) { - if (strpos($text, $delimiter) !== false) { + if (strpos($text, (string) $delimiter) !== false) { return $delimiter; } } diff --git a/app/code/Magento/Store/App/Response/Redirect.php b/app/code/Magento/Store/App/Response/Redirect.php index 3ad6a86db690..b4af3c3c1bbf 100644 --- a/app/code/Magento/Store/App/Response/Redirect.php +++ b/app/code/Magento/Store/App/Response/Redirect.php @@ -200,7 +200,7 @@ protected function _isUrlInternal($url) $directLinkType = \Magento\Framework\UrlInterface::URL_TYPE_DIRECT_LINK; $unsecureBaseUrl = $this->_storeManager->getStore()->getBaseUrl($directLinkType, false); $secureBaseUrl = $this->_storeManager->getStore()->getBaseUrl($directLinkType, true); - return (strpos($url, $unsecureBaseUrl) === 0) || (strpos($url, $secureBaseUrl) === 0); + return (strpos($url, (string) $unsecureBaseUrl) === 0) || (strpos($url, (string) $secureBaseUrl) === 0); } return false; } diff --git a/app/code/Magento/Store/Model/BaseUrlChecker.php b/app/code/Magento/Store/Model/BaseUrlChecker.php index dbdcd9ff17bf..08014907bfa0 100644 --- a/app/code/Magento/Store/Model/BaseUrlChecker.php +++ b/app/code/Magento/Store/Model/BaseUrlChecker.php @@ -40,7 +40,7 @@ public function execute($uri, $request) $requestUri = $request->getRequestUri() ? $request->getRequestUri() : '/'; $isValidSchema = !isset($uri['scheme']) || $uri['scheme'] === $request->getScheme(); $isValidHost = !isset($uri['host']) || $uri['host'] === $request->getHttpHost(); - $isValidPath = !isset($uri['path']) || strpos($requestUri, $uri['path']) !== false; + $isValidPath = !isset($uri['path']) || strpos($requestUri, (string) $uri['path']) !== false; return $isValidSchema && $isValidHost && $isValidPath; } diff --git a/app/code/Magento/Store/Model/Config/Placeholder.php b/app/code/Magento/Store/Model/Config/Placeholder.php index 4e4139d47bd9..ca5d869d347a 100644 --- a/app/code/Magento/Store/Model/Config/Placeholder.php +++ b/app/code/Magento/Store/Model/Config/Placeholder.php @@ -90,7 +90,7 @@ protected function _processPlaceholders($value, $data) if ($url) { $value = str_replace('{{' . $placeholder . '}}', $url, $value); - } elseif (strpos($value, $this->urlPlaceholder) !== false) { + } elseif (strpos($value, (string) $this->urlPlaceholder) !== false) { $distroBaseUrl = $this->request->getDistroBaseUrl(); $value = str_replace($this->urlPlaceholder, $distroBaseUrl, $value); @@ -115,7 +115,7 @@ protected function _getPlaceholder($value) $placeholder = $matches[1]; if ($placeholder == 'unsecure_base_url' || $placeholder == 'secure_base_url' || strpos( $value, - $this->urlPlaceholder + (string) $this->urlPlaceholder ) !== false ) { return $placeholder; diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index ca26b6f1186b..d246c2a0aafc 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -129,7 +129,7 @@ public function convertPathToId($path) public function convertIdToPath($value) { $path = $this->urlDecoder->decode($value); - if (!strstr($path, $this->getStorageRoot())) { + if (!strstr($path, (string) $this->getStorageRoot())) { $path = $this->getStorageRoot() . $path; } return $path; @@ -229,7 +229,7 @@ public function getCurrentPath() if ($path && $path !== self::NODE_ROOT) { $path = $this->convertIdToPath($path); - if ($this->mediaDirectoryWrite->isDirectory($path) && 0 === strpos($path, $currentPath)) { + if ($this->mediaDirectoryWrite->isDirectory($path) && 0 === strpos($path, (string) $currentPath)) { $currentPath = $this->mediaDirectoryWrite->getRelativePath($path); } } @@ -259,7 +259,7 @@ public function getThumbnailDirectory($path) public function getThumbnailPath($imageName) { $imagePath = $this->getCurrentPath() . '/' . $imageName; - if (!$this->mediaDirectoryWrite->isExist($imagePath) || 0 !== strpos($imagePath, $this->getStorageRoot())) { + if (!$this->mediaDirectoryWrite->isExist($imagePath) || 0 !== strpos($imagePath, (string) $this->getStorageRoot())) { throw new \InvalidArgumentException('The image not found.'); } return $this->getThumbnailDirectory($imagePath) . '/' . pathinfo($imageName, PATHINFO_BASENAME); diff --git a/app/code/Magento/Theme/Model/Design/Backend/Exceptions.php b/app/code/Magento/Theme/Model/Design/Backend/Exceptions.php index 42a00aaf421a..b2b4ef506bf4 100644 --- a/app/code/Magento/Theme/Model/Design/Backend/Exceptions.php +++ b/app/code/Magento/Theme/Model/Design/Backend/Exceptions.php @@ -133,7 +133,7 @@ protected function _isRegexp($search) // Limit delimiters to reduce possibility, that we miss string with regexp. // Starts with a delimiter - if (strpos($possibleDelimiters, $search[0]) !== false) { + if (strpos($possibleDelimiters, (string) $search[0]) !== false) { return true; } diff --git a/app/code/Magento/Theme/Model/Theme/Registration.php b/app/code/Magento/Theme/Model/Theme/Registration.php index 5cd44680effc..0cef321640ed 100644 --- a/app/code/Magento/Theme/Model/Theme/Registration.php +++ b/app/code/Magento/Theme/Model/Theme/Registration.php @@ -129,7 +129,7 @@ protected function _savePreviewImage(ThemeInterface $theme) return $this; } $imagePath = $themeDirectory . '/' . $theme->getPreviewImage(); - if (0 === strpos($imagePath, $themeDirectory)) { + if (0 === strpos($imagePath, (string) $themeDirectory)) { $theme->getThemeImage()->createPreviewImage($imagePath); } return $this; diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index 0519460c0242..de38bfcb1d63 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -217,7 +217,7 @@ public function deleteFile($file) $filePath = $this->mediaWriteDirectory->getRelativePath($path . '/' . $file); $thumbnailPath = $this->_helper->getThumbnailDirectory($filePath) . '/' . $file; - if (0 === strpos($filePath, $path) && 0 === strpos($filePath, $this->_helper->getStorageRoot())) { + if (0 === strpos($filePath, (string) $path) && 0 === strpos($filePath, (string) $this->_helper->getStorageRoot())) { $this->mediaWriteDirectory->delete($filePath); $this->mediaWriteDirectory->delete($thumbnailPath); } diff --git a/app/code/Magento/Translation/Model/Inline/Parser.php b/app/code/Magento/Translation/Model/Inline/Parser.php index c3f34770d889..52124aee869a 100644 --- a/app/code/Magento/Translation/Model/Inline/Parser.php +++ b/app/code/Magento/Translation/Model/Inline/Parser.php @@ -647,7 +647,7 @@ private function _findEndOfTag($body, $tagName, $from) $length = $tagLength + 1; $end = $from + 1; while (substr_count($body, $openTag, $from, $length) !== substr_count($body, $closeTag, $from, $length)) { - $end = strpos($body, $closeTag, $end + $tagLength + 1); + $end = strpos($body, (string) $closeTag, $end + $tagLength + 1); if ($end === false) { return false; } diff --git a/app/code/Magento/Translation/Model/Json/PreProcessor.php b/app/code/Magento/Translation/Model/Json/PreProcessor.php index c178a324cb40..f19d6a8fc80c 100644 --- a/app/code/Magento/Translation/Model/Json/PreProcessor.php +++ b/app/code/Magento/Translation/Model/Json/PreProcessor.php @@ -114,6 +114,6 @@ public function process(Chain $chain) */ protected function isDictionaryPath($path) { - return (strpos($path, $this->config->getDictionaryFileName()) !== false); + return (strpos($path, (string) $this->config->getDictionaryFileName()) !== false); } } diff --git a/app/code/Magento/Variable/Ui/Component/VariablesDataProvider.php b/app/code/Magento/Variable/Ui/Component/VariablesDataProvider.php index f4fef0750bdc..12f36f080e48 100644 --- a/app/code/Magento/Variable/Ui/Component/VariablesDataProvider.php +++ b/app/code/Magento/Variable/Ui/Component/VariablesDataProvider.php @@ -121,7 +121,7 @@ public function getData() $value = str_replace('%', '', $filter->getValue()); $filterField = $filter->getField(); $items = array_values(array_filter($items, function ($item) use ($value, $filterField) { - return strpos(strtolower($item[$filterField]), strtolower($value)) !== false; + return strpos(strtolower($item[$filterField]), (string) strtolower($value)) !== false; })); } } diff --git a/app/code/Magento/Webapi/Model/Rest/Config.php b/app/code/Magento/Webapi/Model/Rest/Config.php index aa5dfdd7a7fd..d572b9c21cfc 100644 --- a/app/code/Magento/Webapi/Model/Rest/Config.php +++ b/app/code/Magento/Webapi/Model/Rest/Config.php @@ -128,7 +128,7 @@ public function getRestRoutes(\Magento\Framework\Webapi\Rest\Request $request) ksort($servicesRoutes, SORT_STRING); foreach ($servicesRoutes as $url => $httpMethods) { // skip if baseurl is not null and does not match - if (!$serviceBaseUrl || strpos(trim($url, '/'), trim($serviceBaseUrl, '/')) !== 0) { + if (!$serviceBaseUrl || strpos(trim($url, '/'), (string) trim($serviceBaseUrl, '/')) !== 0) { // base url does not match, just skip this service continue; } diff --git a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php index 847def6e8922..d612a4a8d275 100644 --- a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php +++ b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php @@ -334,7 +334,7 @@ private function generateMethodParameters($httpMethodData, $operationId) $description = isset($parameterInfo['documentation']) ? $parameterInfo['documentation'] : null; /** Get location of parameter */ - if (strpos($httpMethodData['uri'], '{' . $parameterName . '}') !== false) { + if (strpos($httpMethodData['uri'], (string) ('{' . $parameterName . '}')) !== false) { $parameters[] = $this->generateMethodPathParameter($parameterName, $parameterInfo, $description); } elseif (strtoupper($httpMethodData['httpOperation']) === 'GET') { $parameters = $this->generateMethodQueryParameters( diff --git a/app/code/Magento/WebapiAsync/Controller/Rest/AsynchronousSchemaRequestProcessor.php b/app/code/Magento/WebapiAsync/Controller/Rest/AsynchronousSchemaRequestProcessor.php index a3e54dd2fdfc..f85c58ee0613 100644 --- a/app/code/Magento/WebapiAsync/Controller/Rest/AsynchronousSchemaRequestProcessor.php +++ b/app/code/Magento/WebapiAsync/Controller/Rest/AsynchronousSchemaRequestProcessor.php @@ -74,7 +74,7 @@ public function process(\Magento\Framework\Webapi\Rest\Request $request) */ public function canProcess(\Magento\Framework\Webapi\Rest\Request $request) { - if (strpos(ltrim($request->getPathInfo(), '/'), $this->processorPath) === 0) { + if (strpos(ltrim($request->getPathInfo(), '/'), (string) $this->processorPath) === 0) { return true; } return false; From c823ce9c50fde4407316f6906cae6b8a4072ea61 Mon Sep 17 00:00:00 2001 From: Lars Roettig <l.roettig@techdivision.com> Date: Fri, 21 Jun 2019 10:09:38 +0200 Subject: [PATCH 083/230] MC-16952: Change Composer.lock to install correct versions --- composer.json | 4 +- composer.lock | 243 +++++++++++++++++++++++++------------------------- 2 files changed, 124 insertions(+), 123 deletions(-) diff --git a/composer.json b/composer.json index f44ddb806789..1d6c794f947b 100644 --- a/composer.json +++ b/composer.json @@ -60,7 +60,7 @@ "zendframework/zend-crypt": "^2.6.0", "zendframework/zend-db": "^2.8.2", "zendframework/zend-di": "^2.6.1", - "zendframework/zend-eventmanager": "^2.6.3", + "zendframework/zend-eventmanager": "^3.0.0", "zendframework/zend-feed": "^2.9.0", "zendframework/zend-form": "^2.10.0", "zendframework/zend-http": "^2.6.0", @@ -75,7 +75,7 @@ "zendframework/zend-servicemanager": "^2.7.8", "zendframework/zend-session": "^2.7.3", "zendframework/zend-soap": "^2.7.0", - "zendframework/zend-stdlib": "^2.7.7", + "zendframework/zend-stdlib": "^3.2.1", "zendframework/zend-text": "^2.6.0", "zendframework/zend-uri": "^2.5.1", "zendframework/zend-validator": "^2.6.0", diff --git a/composer.lock b/composer.lock index e954453ccd0f..857591dcf101 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "796cf9650cd9b07f87bb2e40d4aee406", + "content-hash": "0d1d76199a3ce384dc07177d2710a6c5", "packages": [ { "name": "braintree/braintree_php", @@ -1387,16 +1387,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.18", + "version": "2.0.19", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "60519001db8d791215a822efd366d24cafee9e63" + "reference": "d2085db7b7394baa071a69c8f9159723c250f2ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/60519001db8d791215a822efd366d24cafee9e63", - "reference": "60519001db8d791215a822efd366d24cafee9e63", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d2085db7b7394baa071a69c8f9159723c250f2ba", + "reference": "d2085db7b7394baa071a69c8f9159723c250f2ba", "shasum": "" }, "require": { @@ -1475,7 +1475,7 @@ "x.509", "x509" ], - "time": "2019-06-13T06:15:54+00:00" + "time": "2019-06-20T03:34:11+00:00" }, { "name": "psr/container", @@ -2298,16 +2298,16 @@ }, { "name": "tedivm/jshrink", - "version": "v1.3.1", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/tedious/JShrink.git", - "reference": "21254058dc3ce6aba6bef458cff4bfa25cf8b198" + "reference": "d9b51729f3c6692c2da3e3fe6c5cd7c9d1d3fa8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tedious/JShrink/zipball/21254058dc3ce6aba6bef458cff4bfa25cf8b198", - "reference": "21254058dc3ce6aba6bef458cff4bfa25cf8b198", + "url": "https://api.github.com/repos/tedious/JShrink/zipball/d9b51729f3c6692c2da3e3fe6c5cd7c9d1d3fa8f", + "reference": "d9b51729f3c6692c2da3e3fe6c5cd7c9d1d3fa8f", "shasum": "" }, "require": { @@ -2340,7 +2340,7 @@ "javascript", "minifier" ], - "time": "2018-09-16T00:02:51+00:00" + "time": "2019-06-15T23:11:19+00:00" }, { "name": "true/punycode", @@ -2488,22 +2488,22 @@ }, { "name": "zendframework/zend-captcha", - "version": "2.8.0", + "version": "2.9.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-captcha.git", - "reference": "37e9b6a4f632a9399eecbf2e5e325ad89083f87b" + "reference": "4272f3d0cde0a1fa9135d0cbc4a629fb655391d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-captcha/zipball/37e9b6a4f632a9399eecbf2e5e325ad89083f87b", - "reference": "37e9b6a4f632a9399eecbf2e5e325ad89083f87b", + "url": "https://api.github.com/repos/zendframework/zend-captcha/zipball/4272f3d0cde0a1fa9135d0cbc4a629fb655391d3", + "reference": "4272f3d0cde0a1fa9135d0cbc4a629fb655391d3", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", "zendframework/zend-math": "^2.7 || ^3.0", - "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + "zendframework/zend-stdlib": "^3.2.1" }, "require-dev": { "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", @@ -2523,8 +2523,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8.x-dev", - "dev-develop": "2.9.x-dev" + "dev-master": "2.9.x-dev", + "dev-develop": "2.10.x-dev" } }, "autoload": { @@ -2542,7 +2542,7 @@ "captcha", "zf" ], - "time": "2018-04-24T17:24:10+00:00" + "time": "2019-06-18T09:32:52+00:00" }, { "name": "zendframework/zend-code", @@ -2655,21 +2655,21 @@ }, { "name": "zendframework/zend-console", - "version": "2.7.0", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-console.git", - "reference": "e8aa08da83de3d265256c40ba45cd649115f0e18" + "reference": "95817ae78f73c48026972e350a2ecc31c6d9f9ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-console/zipball/e8aa08da83de3d265256c40ba45cd649115f0e18", - "reference": "e8aa08da83de3d265256c40ba45cd649115f0e18", + "url": "https://api.github.com/repos/zendframework/zend-console/zipball/95817ae78f73c48026972e350a2ecc31c6d9f9ae", + "reference": "95817ae78f73c48026972e350a2ecc31c6d9f9ae", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", - "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + "zendframework/zend-stdlib": "^3.2.1" }, "require-dev": { "phpunit/phpunit": "^5.7.23 || ^6.4.3", @@ -2685,8 +2685,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7.x-dev", - "dev-develop": "2.8.x-dev" + "dev-master": "2.8.x-dev", + "dev-develop": "2.9.x-dev" } }, "autoload": { @@ -2704,7 +2704,7 @@ "console", "zf" ], - "time": "2018-01-25T19:08:04+00:00" + "time": "2019-02-04T19:48:22+00:00" }, { "name": "zendframework/zend-crypt", @@ -2972,33 +2972,37 @@ }, { "name": "zendframework/zend-eventmanager", - "version": "2.6.4", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "d238c443220dce4b6396579c8ab2200ec25f9108" + "reference": "a5e2583a211f73604691586b8406ff7296a946dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/d238c443220dce4b6396579c8ab2200ec25f9108", - "reference": "d238c443220dce4b6396579c8ab2200ec25f9108", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/a5e2583a211f73604691586b8406ff7296a946dd", + "reference": "a5e2583a211f73604691586b8406ff7296a946dd", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-stdlib": "^2.7" + "php": "^5.6 || ^7.0" }, "require-dev": { - "athletic/athletic": "dev-master", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0" + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" }, "type": "library", "extra": { "branch-alias": { - "dev-release-2.6": "2.6-dev", - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" } }, "autoload": { @@ -3010,31 +3014,36 @@ "license": [ "BSD-3-Clause" ], + "description": "Trigger and listen to events within a PHP application", "homepage": "https://github.com/zendframework/zend-eventmanager", "keywords": [ + "event", "eventmanager", + "events", "zf2" ], - "time": "2017-12-12T17:48:56+00:00" + "time": "2018-04-25T15:33:34+00:00" }, { "name": "zendframework/zend-feed", - "version": "2.10.3", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-feed.git", - "reference": "6641f4cf3f4586c63f83fd70b6d19966025c8888" + "reference": "d926c5af34b93a0121d5e2641af34ddb1533d733" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/6641f4cf3f4586c63f83fd70b6d19966025c8888", - "reference": "6641f4cf3f4586c63f83fd70b6d19966025c8888", + "url": "https://api.github.com/repos/zendframework/zend-feed/zipball/d926c5af34b93a0121d5e2641af34ddb1533d733", + "reference": "d926c5af34b93a0121d5e2641af34ddb1533d733", "shasum": "" }, "require": { + "ext-dom": "*", + "ext-libxml": "*", "php": "^5.6 || ^7.0", "zendframework/zend-escaper": "^2.5.2", - "zendframework/zend-stdlib": "^2.7.7 || ^3.1" + "zendframework/zend-stdlib": "^3.2.1" }, "require-dev": { "phpunit/phpunit": "^5.7.23 || ^6.4.3", @@ -3057,8 +3066,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.10.x-dev", - "dev-develop": "2.11.x-dev" + "dev-master": "2.12.x-dev", + "dev-develop": "2.13.x-dev" } }, "autoload": { @@ -3076,7 +3085,7 @@ "feed", "zf" ], - "time": "2018-08-01T13:53:20+00:00" + "time": "2019-03-05T20:08:49+00:00" }, { "name": "zendframework/zend-filter", @@ -3145,23 +3154,23 @@ }, { "name": "zendframework/zend-form", - "version": "2.13.0", + "version": "2.14.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-form.git", - "reference": "c713a12ccbd43148b71c9339e171ca11e3f8a1da" + "reference": "ff9385b7d0d93d9bdbc2aa4af82ab616dbc7d4be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-form/zipball/c713a12ccbd43148b71c9339e171ca11e3f8a1da", - "reference": "c713a12ccbd43148b71c9339e171ca11e3f8a1da", + "url": "https://api.github.com/repos/zendframework/zend-form/zipball/ff9385b7d0d93d9bdbc2aa4af82ab616dbc7d4be", + "reference": "ff9385b7d0d93d9bdbc2aa4af82ab616dbc7d4be", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", "zendframework/zend-hydrator": "^1.1 || ^2.1 || ^3.0", "zendframework/zend-inputfilter": "^2.8", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "zendframework/zend-stdlib": "^3.2.1" }, "require-dev": { "doctrine/annotations": "~1.0", @@ -3193,8 +3202,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.13.x-dev", - "dev-develop": "2.14.x-dev" + "dev-master": "2.14.x-dev", + "dev-develop": "2.15.x-dev" }, "zf": { "component": "Zend\\Form", @@ -3219,26 +3228,26 @@ "form", "zf" ], - "time": "2018-12-11T22:51:29+00:00" + "time": "2019-02-26T18:13:31+00:00" }, { "name": "zendframework/zend-http", - "version": "2.8.4", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-http.git", - "reference": "d160aedc096be230af0fe9c31151b2b33ad4e807" + "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-http/zipball/d160aedc096be230af0fe9c31151b2b33ad4e807", - "reference": "d160aedc096be230af0fe9c31151b2b33ad4e807", + "url": "https://api.github.com/repos/zendframework/zend-http/zipball/4b4983178693a8fdda53b0bbee58552e2d2b1ac0", + "reference": "4b4983178693a8fdda53b0bbee58552e2d2b1ac0", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", "zendframework/zend-loader": "^2.5.1", - "zendframework/zend-stdlib": "^3.1 || ^2.7.7", + "zendframework/zend-stdlib": "^3.2.1", "zendframework/zend-uri": "^2.5.2", "zendframework/zend-validator": "^2.10.1" }, @@ -3253,8 +3262,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8.x-dev", - "dev-develop": "2.9.x-dev" + "dev-master": "2.10.x-dev", + "dev-develop": "2.11.x-dev" } }, "autoload": { @@ -3274,29 +3283,29 @@ "zend", "zf" ], - "time": "2019-02-07T17:47:08+00:00" + "time": "2019-02-19T18:58:14+00:00" }, { "name": "zendframework/zend-hydrator", - "version": "1.1.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-hydrator.git", - "reference": "22652e1661a5a10b3f564cf7824a2206cf5a4a65" + "reference": "70b02f4d8676e64af932625751750b5ca72fff3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/22652e1661a5a10b3f564cf7824a2206cf5a4a65", - "reference": "22652e1661a5a10b3f564cf7824a2206cf5a4a65", + "url": "https://api.github.com/repos/zendframework/zend-hydrator/zipball/70b02f4d8676e64af932625751750b5ca72fff3a", + "reference": "70b02f4d8676e64af932625751750b5ca72fff3a", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-stdlib": "^2.7 || ^3.0" + "php": "^5.6 || ^7.0", + "zendframework/zend-stdlib": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "^2.0@dev", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0", "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", "zendframework/zend-filter": "^2.6", "zendframework/zend-inputfilter": "^2.6", @@ -3312,10 +3321,14 @@ "type": "library", "extra": { "branch-alias": { - "dev-release-1.0": "1.0-dev", - "dev-release-1.1": "1.1-dev", - "dev-master": "2.0-dev", - "dev-develop": "2.1-dev" + "dev-release-1.0": "1.0.x-dev", + "dev-release-1.1": "1.1.x-dev", + "dev-master": "2.4.x-dev", + "dev-develop": "2.5.x-dev" + }, + "zf": { + "component": "Zend\\Hydrator", + "config-provider": "Zend\\Hydrator\\ConfigProvider" } }, "autoload": { @@ -3327,12 +3340,13 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-hydrator", + "description": "Serialize objects to arrays, and vice versa", "keywords": [ + "ZendFramework", "hydrator", - "zf2" + "zf" ], - "time": "2016-02-18T22:38:26+00:00" + "time": "2018-11-19T19:16:10+00:00" }, { "name": "zendframework/zend-i18n", @@ -4275,45 +4289,31 @@ }, { "name": "zendframework/zend-stdlib", - "version": "2.7.7", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f" + "reference": "66536006722aff9e62d1b331025089b7ec71c065" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/0e44eb46788f65e09e077eb7f44d2659143bcc1f", - "reference": "0e44eb46788f65e09e077eb7f44d2659143bcc1f", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/66536006722aff9e62d1b331025089b7ec71c065", + "reference": "66536006722aff9e62d1b331025089b7ec71c065", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-hydrator": "~1.1" + "php": "^5.6 || ^7.0" }, "require-dev": { - "athletic/athletic": "~0.1", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "~4.0", - "zendframework/zend-config": "~2.5", - "zendframework/zend-eventmanager": "~2.5", - "zendframework/zend-filter": "~2.5", - "zendframework/zend-inputfilter": "~2.5", - "zendframework/zend-serializer": "~2.5", - "zendframework/zend-servicemanager": "~2.5" - }, - "suggest": { - "zendframework/zend-eventmanager": "To support aggregate hydrator usage", - "zendframework/zend-filter": "To support naming strategy hydrator usage", - "zendframework/zend-serializer": "Zend\\Serializer component", - "zendframework/zend-servicemanager": "To support hydrator plugin manager usage" + "phpbench/phpbench": "^0.13", + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.2", + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-release-2.7": "2.7-dev", - "dev-master": "3.0-dev", - "dev-develop": "3.1-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" } }, "autoload": { @@ -4325,12 +4325,13 @@ "license": [ "BSD-3-Clause" ], - "homepage": "https://github.com/zendframework/zend-stdlib", + "description": "SPL extensions, array utilities, error handlers, and more", "keywords": [ + "ZendFramework", "stdlib", - "zf2" + "zf" ], - "time": "2016-04-12T21:17:31+00:00" + "time": "2018-08-28T21:34:05+00:00" }, { "name": "zendframework/zend-text", @@ -4429,22 +4430,22 @@ }, { "name": "zendframework/zend-validator", - "version": "2.11.1", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-validator.git", - "reference": "3c28dfe4e5951ba38059cea895244d9d206190b3" + "reference": "64c33668e5fa2d39c6289a878f927ea2b0850c30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/3c28dfe4e5951ba38059cea895244d9d206190b3", - "reference": "3c28dfe4e5951ba38059cea895244d9d206190b3", + "url": "https://api.github.com/repos/zendframework/zend-validator/zipball/64c33668e5fa2d39c6289a878f927ea2b0850c30", + "reference": "64c33668e5fa2d39c6289a878f927ea2b0850c30", "shasum": "" }, "require": { "container-interop/container-interop": "^1.1", "php": "^5.6 || ^7.0", - "zendframework/zend-stdlib": "^2.7.6 || ^3.1" + "zendframework/zend-stdlib": "^3.2.1" }, "require-dev": { "phpunit/phpunit": "^6.0.8 || ^5.7.15", @@ -4475,8 +4476,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11.x-dev", - "dev-develop": "2.12.x-dev" + "dev-master": "2.12.x-dev", + "dev-develop": "2.13.x-dev" }, "zf": { "component": "Zend\\Validator", @@ -4498,7 +4499,7 @@ "validator", "zf2" ], - "time": "2019-01-29T22:26:39+00:00" + "time": "2019-01-30T14:26:10+00:00" }, { "name": "zendframework/zend-view", @@ -9275,23 +9276,23 @@ }, { "name": "symfony/service-contracts", - "version": "v1.1.2", + "version": "v1.1.5", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0" + "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0", - "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", + "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "psr/container": "^1.0" }, "suggest": { - "psr/container": "", "symfony/service-implementation": "" }, "type": "library", @@ -9329,7 +9330,7 @@ "interoperability", "standards" ], - "time": "2019-05-28T07:50:59+00:00" + "time": "2019-06-13T11:15:36+00:00" }, { "name": "symfony/stopwatch", From c92dd4e87bc85acbd7cf5ba3672705be9810f085 Mon Sep 17 00:00:00 2001 From: Lars Roettig <l.roettig@techdivision.com> Date: Fri, 21 Jun 2019 10:34:36 +0200 Subject: [PATCH 084/230] MC-16952: Install --- setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php b/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php index 20cf7a797c1d..3cc12bbaf357 100644 --- a/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php +++ b/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php @@ -62,12 +62,15 @@ class InitParamListener implements ListenerAggregateInterface, FactoryInterface public function attach(EventManagerInterface $events, $priority = 1) { $sharedEvents = $events->getSharedManager(); - $this->listeners[] = $sharedEvents->attach( + $sharedEvents->attach( Application::class, MvcEvent::EVENT_BOOTSTRAP, [$this, 'onBootstrap'], $priority ); + + $this->listeners = $sharedEvents->getListeners([Application::class], + MvcEvent::EVENT_BOOTSTRAP); } /** From 6f9b93c41314d6863daea3705d81e2b1c7739aca Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Fri, 21 Jun 2019 14:49:41 +0200 Subject: [PATCH 085/230] MC-16958: Update composer.json's to compatible with PHP 7.3 for dev/tests --- .../Magento/TestModuleIntegrationFromConfig/composer.json | 2 +- .../_files/Magento/TestModuleJoinDirectives/composer.json | 2 +- .../Magento/TestModuleMessageQueueConfigOverride/composer.json | 2 +- .../Magento/TestModuleMessageQueueConfiguration/composer.json | 2 +- .../integration/_files/Magento/TestModuleSample/composer.json | 2 +- .../testsuite/Magento/Deploy/_files/zoom1/composer.json | 2 +- .../testsuite/Magento/Deploy/_files/zoom2/composer.json | 2 +- .../testsuite/Magento/Deploy/_files/zoom3/composer.json | 2 +- .../Command/_files/root/app/code/Magento/A/composer.json | 2 +- .../Command/_files/root/app/code/Magento/B/composer.json | 2 +- .../Widget/_files/design/adminhtml/magento_basic/composer.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json index 8c3ed345146c..0629d3ded596 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json +++ b/dev/tests/api-functional/_files/Magento/TestModuleIntegrationFromConfig/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-integration": "*" }, diff --git a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json index e6670c85a14a..c15dc55b0504 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json +++ b/dev/tests/api-functional/_files/Magento/TestModuleJoinDirectives/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-sales": "*" }, diff --git a/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfigOverride/composer.json b/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfigOverride/composer.json index 7aa873f6cc71..4c124d7c1d7b 100644 --- a/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfigOverride/composer.json +++ b/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfigOverride/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-test-module-message-queue-config-override", "description": "test module for message queue configuration", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-integration": "*" }, diff --git a/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfiguration/composer.json b/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfiguration/composer.json index edc7f3d18942..eb168da3add1 100644 --- a/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfiguration/composer.json +++ b/dev/tests/integration/_files/Magento/TestModuleMessageQueueConfiguration/composer.json @@ -2,7 +2,7 @@ "name": "magento/module-test-module-message-queue-configuration", "description": "test module for message queue configuration", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-integration": "*" }, diff --git a/dev/tests/integration/_files/Magento/TestModuleSample/composer.json b/dev/tests/integration/_files/Magento/TestModuleSample/composer.json index 416439119b1c..29e9663e49a6 100644 --- a/dev/tests/integration/_files/Magento/TestModuleSample/composer.json +++ b/dev/tests/integration/_files/Magento/TestModuleSample/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-integration": "*" }, diff --git a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom1/composer.json b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom1/composer.json index cf28a42d6071..61c777489d83 100644 --- a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom1/composer.json +++ b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom1/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "type": "magento2-theme", diff --git a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom2/composer.json b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom2/composer.json index 6038c48fab29..52c3b9f3955f 100644 --- a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom2/composer.json +++ b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom2/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/theme-frontend-zoom1": "*" }, diff --git a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom3/composer.json b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom3/composer.json index 820abaee604b..778a95438505 100644 --- a/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom3/composer.json +++ b/dev/tests/integration/testsuite/Magento/Deploy/_files/zoom3/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/theme-frontend-zoom2": "*" }, diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json index c6836f980647..b010e4991aaf 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/A/composer.json @@ -4,7 +4,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "0.1", "magento/module-b": "0.1" }, diff --git a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json index 25ec67cb999c..0445a0a2056a 100644 --- a/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json +++ b/dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/root/app/code/Magento/B/composer.json @@ -4,7 +4,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-a": "0.1" }, diff --git a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json index 489a5f1fcb6c..b0ce07c2d292 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json +++ b/dev/tests/integration/testsuite/Magento/Widget/_files/design/adminhtml/magento_basic/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*" }, "type": "magento2-theme", From 5866a3af19d135db326df0a7b59f6d87a58a4e13 Mon Sep 17 00:00:00 2001 From: Lars Roettig <l.roettig@techdivision.com> Date: Mon, 24 Jun 2019 10:18:49 +0200 Subject: [PATCH 086/230] MC-16952: Fixes for Zend Framework Update --- .../Setup/Mvc/Bootstrap/InitParamListener.php | 6 ++---- .../Unit/Mvc/Bootstrap/InitParamListenerTest.php | 13 ++++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php b/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php index 3cc12bbaf357..c7bb7f30af41 100644 --- a/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php +++ b/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php @@ -69,8 +69,7 @@ public function attach(EventManagerInterface $events, $priority = 1) $priority ); - $this->listeners = $sharedEvents->getListeners([Application::class], - MvcEvent::EVENT_BOOTSTRAP); + $this->listeners = $sharedEvents->getListeners([Application::class], MvcEvent::EVENT_BOOTSTRAP); } /** @@ -79,9 +78,8 @@ public function attach(EventManagerInterface $events, $priority = 1) public function detach(EventManagerInterface $events) { foreach ($this->listeners as $index => $listener) { - if ($events->detach($listener)) { + $events->detach($listener); unset($this->listeners[$index]); - } } } diff --git a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php index f0a9d5316b3a..702724e64df6 100644 --- a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php @@ -27,6 +27,9 @@ class InitParamListenerTest extends \PHPUnit\Framework\TestCase */ private $callbackHandler; + /** callable[][] */ + private $callbacks = []; + protected function setUp() { $this->listener = new InitParamListener(); @@ -42,7 +45,7 @@ public function testDetach() { $events = $this->prepareEventManager(); $this->listener->attach($events); - $events->expects($this->once())->method('detach')->with($this->callbackHandler)->willReturn(true); + $events->expects($this->once())->method('detach')->with([$this->listener, 'onBootstrap'])->willReturn(true); $this->listener->detach($events); } @@ -230,9 +233,7 @@ public function testCreateFilesystem() */ private function prepareEventManager() { - $this->callbackHandler = $this->getMockBuilder(\Zend\Stdlib\CallbackHandler::class) - ->disableOriginalConstructor() - ->getMock(); + $this->callbacks[] = [$this->listener, 'onBootstrap']; /** @var \Zend\EventManager\EventManagerInterface|\PHPUnit_Framework_MockObject_MockObject $events */ $eventManager = $this->createMock(\Zend\EventManager\EventManagerInterface::class); @@ -242,7 +243,9 @@ private function prepareEventManager() \Zend\Mvc\Application::class, MvcEvent::EVENT_BOOTSTRAP, [$this->listener, 'onBootstrap'] - )->willReturn($this->callbackHandler); + ); + + $sharedManager->expects($this->once())->method('getListeners')->willReturn($this->callbacks); $eventManager->expects($this->once())->method('getSharedManager')->willReturn($sharedManager); return $eventManager; From 60e86d03e43f6dfaf5c0dc542c8846b345f578c4 Mon Sep 17 00:00:00 2001 From: Lars Roettig <l.roettig@techdivision.com> Date: Mon, 24 Jun 2019 11:33:36 +0200 Subject: [PATCH 087/230] MC-16952: Fixes for Zend Framework Update --- app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php | 2 +- app/code/Magento/Sitemap/Test/Unit/Model/_files/sitemap-1-3.xml | 2 +- .../Magento/Sitemap/Test/Unit/Model/_files/sitemap-single.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php b/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php index 86d57815e02b..55177ae4ff21 100644 --- a/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php +++ b/app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php @@ -530,7 +530,7 @@ protected function getModelMock($mockBeforeSave = false) [ new SitemapItem('category.html', '1.0', 'daily', '2012-12-21 00:00:00'), new SitemapItem('/category/sub-category.html', '1.0', 'daily', '2012-12-21 00:00:00'), - new SitemapItem('product.html', '0.5', 'monthly', '0000-00-00 00:00:00'), + new SitemapItem('product.html', '0.5', 'monthly', '2012-12-21 00:00:00'), new SitemapItem( 'product2.html', '0.5', diff --git a/app/code/Magento/Sitemap/Test/Unit/Model/_files/sitemap-1-3.xml b/app/code/Magento/Sitemap/Test/Unit/Model/_files/sitemap-1-3.xml index 519464cf76cf..3f2263e69b85 100644 --- a/app/code/Magento/Sitemap/Test/Unit/Model/_files/sitemap-1-3.xml +++ b/app/code/Magento/Sitemap/Test/Unit/Model/_files/sitemap-1-3.xml @@ -10,7 +10,7 @@ xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"> <url> <loc>http://store.com/product.html</loc> - <lastmod>0000-01-01T00:00:00-08:00</lastmod> + <lastmod>2012-12-21t00:00:00-08:00</lastmod> <changefreq>monthly</changefreq> <priority>0.5</priority> </url> diff --git a/app/code/Magento/Sitemap/Test/Unit/Model/_files/sitemap-single.xml b/app/code/Magento/Sitemap/Test/Unit/Model/_files/sitemap-single.xml index cc2ff96dd28f..7e3616cd3fc1 100644 --- a/app/code/Magento/Sitemap/Test/Unit/Model/_files/sitemap-single.xml +++ b/app/code/Magento/Sitemap/Test/Unit/Model/_files/sitemap-single.xml @@ -22,7 +22,7 @@ </url> <url> <loc>http://store.com/product.html</loc> - <lastmod>0000-01-01T00:00:00-08:00</lastmod> + <lastmod>2012-12-21t00:00:00-08:00</lastmod> <changefreq>monthly</changefreq> <priority>0.5</priority> </url> From 9a4332cb18945772c1458d53cd1a9c191c3f7a10 Mon Sep 17 00:00:00 2001 From: Lars Roettig <l.roettig@techdivision.com> Date: Mon, 24 Jun 2019 15:37:07 +0200 Subject: [PATCH 088/230] MC-16952: Update less compile lib --- composer.json | 2 +- composer.lock | 135 +++++++++---------- lib/internal/Magento/Framework/composer.json | 2 +- 3 files changed, 69 insertions(+), 70 deletions(-) diff --git a/composer.json b/composer.json index 1d6c794f947b..f187cf61da5f 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "magento/magento-composer-installer": ">=0.1.11", "magento/zendframework1": "~1.14.1", "monolog/monolog": "^1.17", - "oyejorge/less.php": "~1.7.0", + "wikimedia/less.php": "~1.8.0", "paragonie/sodium_compat": "^1.6", "pelago/emogrifier": "^2.0.0", "php-amqplib/php-amqplib": "~2.7.0", diff --git a/composer.lock b/composer.lock index 857591dcf101..5577af459b02 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0d1d76199a3ce384dc07177d2710a6c5", + "content-hash": "5938ee127b3c29708b0fc68b7ff21ac2", "packages": [ { "name": "braintree/braintree_php", @@ -1002,68 +1002,6 @@ ], "time": "2018-11-05T09:00:11+00:00" }, - { - "name": "oyejorge/less.php", - "version": "v1.7.0.14", - "source": { - "type": "git", - "url": "https://github.com/oyejorge/less.php.git", - "reference": "42925c5a01a07d67ca7e82dfc8fb31814d557bc9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/oyejorge/less.php/zipball/42925c5a01a07d67ca7e82dfc8fb31814d557bc9", - "reference": "42925c5a01a07d67ca7e82dfc8fb31814d557bc9", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.24" - }, - "bin": [ - "bin/lessc" - ], - "type": "library", - "autoload": { - "psr-0": { - "Less": "lib/" - }, - "classmap": [ - "lessc.inc.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Matt Agar", - "homepage": "https://github.com/agar" - }, - { - "name": "Martin Jantošovič", - "homepage": "https://github.com/Mordred" - }, - { - "name": "Josh Schmidt", - "homepage": "https://github.com/oyejorge" - } - ], - "description": "PHP port of the Javascript version of LESS http://lesscss.org (Originally maintained by Josh Schmidt)", - "homepage": "http://lessphp.gpeasy.com", - "keywords": [ - "css", - "less", - "less.js", - "lesscss", - "php", - "stylesheet" - ], - "time": "2017-03-28T22:19:25+00:00" - }, { "name": "paragonie/random_compat", "version": "v9.99.99", @@ -1387,16 +1325,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.19", + "version": "2.0.20", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "d2085db7b7394baa071a69c8f9159723c250f2ba" + "reference": "d6819a55b05e123db1e881d8b230d57f912126be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d2085db7b7394baa071a69c8f9159723c250f2ba", - "reference": "d2085db7b7394baa071a69c8f9159723c250f2ba", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d6819a55b05e123db1e881d8b230d57f912126be", + "reference": "d6819a55b05e123db1e881d8b230d57f912126be", "shasum": "" }, "require": { @@ -1475,7 +1413,7 @@ "x.509", "x509" ], - "time": "2019-06-20T03:34:11+00:00" + "time": "2019-06-23T16:33:11+00:00" }, { "name": "psr/container", @@ -2486,6 +2424,67 @@ ], "time": "2018-09-02T14:59:54+00:00" }, + { + "name": "wikimedia/less.php", + "version": "1.8.1", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/less.php.git", + "reference": "f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/less.php/zipball/f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b", + "reference": "f0f7768f6fa8a9d2ac6a0274f6f477c72159bf9b", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.24" + }, + "bin": [ + "bin/lessc" + ], + "type": "library", + "autoload": { + "psr-0": { + "Less": "lib/" + }, + "classmap": [ + "lessc.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Matt Agar", + "homepage": "https://github.com/agar" + }, + { + "name": "Martin Jantošovič", + "homepage": "https://github.com/Mordred" + }, + { + "name": "Josh Schmidt", + "homepage": "https://github.com/oyejorge" + } + ], + "description": "PHP port of the Javascript version of LESS http://lesscss.org (Originally maintained by Josh Schmidt)", + "keywords": [ + "css", + "less", + "less.js", + "lesscss", + "php", + "stylesheet" + ], + "time": "2019-01-19T01:01:33+00:00" + }, { "name": "zendframework/zend-captcha", "version": "2.9.0", diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index 06b57f432a25..fcedfaf076aa 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -26,7 +26,7 @@ "composer/composer": "^1.6", "magento/zendframework1": "~1.14.0", "monolog/monolog": "^1.17", - "oyejorge/less.php": "~1.7.0", + "wikimedia/less.php": "~1.8.0", "symfony/console": "~4.1.0", "symfony/process": "~4.1.0", "tedivm/jshrink": "~1.3.0", From bf3a152a12315303b58d786787eef9c948618cf9 Mon Sep 17 00:00:00 2001 From: Stepan Furman <furman.stepan@gmail.com> Date: Tue, 25 Jun 2019 14:37:29 +0300 Subject: [PATCH 089/230] MC-17683: Fixes for strpos --- .../Analytics/Model/Connector/Http/ResponseResolver.php | 3 ++- .../Catalog/Model/Category/Attribute/Backend/Image.php | 7 ++++--- app/code/Magento/Catalog/Model/CategoryManagement.php | 7 ++++--- .../Design/FileResolution/Fallback/Resolver/Simple.php | 4 +++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php b/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php index b3f8f9d4c97d..9ae099803ab8 100644 --- a/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php +++ b/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php @@ -41,7 +41,8 @@ public function getResult(\Zend_Http_Response $response) $converterMediaType = $this->converter->getContentMediaType(); /** Content-Type header may not only contain media-type declaration */ - if ($response->getBody() && is_int(strripos($response->getHeader('Content-Type'), (string) $converterMediaType))) { + if ($response->getBody() + && is_int(strripos($response->getHeader('Content-Type'), (string) $converterMediaType))) { $responseBody = $this->converter->fromBody($response->getBody()); } else { $responseBody = []; diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php index 5e3755452173..c3e90c478345 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php @@ -153,9 +153,10 @@ private function fileResidesOutsideCategoryDir($value) $fileUrl = ltrim($value[0]['url'], '/'); $baseMediaDir = $this->_filesystem->getUri(DirectoryList::MEDIA); - $usingPathRelativeToBase = strpos($fileUrl, (string) $baseMediaDir) === 0; - - return $usingPathRelativeToBase; + if (!$baseMediaDir) { + return false; + } + return strpos($fileUrl, $baseMediaDir) === 0; } /** diff --git a/app/code/Magento/Catalog/Model/CategoryManagement.php b/app/code/Magento/Catalog/Model/CategoryManagement.php index c259bcea6040..ea6d66df3627 100644 --- a/app/code/Magento/Catalog/Model/CategoryManagement.php +++ b/app/code/Magento/Catalog/Model/CategoryManagement.php @@ -30,7 +30,7 @@ class CategoryManagement implements \Magento\Catalog\Api\CategoryManagementInter * @var \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory */ private $categoriesFactory; - + /** * @param \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository * @param Category\Tree $categoryTree @@ -112,8 +112,9 @@ public function move($categoryId, $parentId, $afterId = null) $lastId = array_pop($categoryIds); $afterId = ($afterId === null || $afterId > $lastId) ? $lastId : $afterId; } - - if (strpos($parentCategory->getPath(), (string) $model->getPath()) === 0) { + $parentPath = $parentCategory->getPath(); + $path = $model->getPath(); + if ($path && strpos($parentPath, $path) === 0) { throw new \Magento\Framework\Exception\LocalizedException( __('Operation do not allow to move a parent category to any of children category') ); diff --git a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php index 16875a0f4bdb..20bb599e1e8e 100644 --- a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php +++ b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php @@ -6,6 +6,7 @@ namespace Magento\Framework\View\Design\FileResolution\Fallback\Resolver; +use function GuzzleHttp\Psr7\str; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\ObjectManager; use Magento\Framework\Filesystem\Directory\ReadFactory; @@ -103,7 +104,8 @@ private function checkFilePathAccess($fileName, $filePath) $fileRead = $this->readFactory->create($realPath); // Check if file path starts with web lib directory path - if (strpos($fileRead->getAbsolutePath(), $directoryWeb->getAbsolutePath()) === 0) { + $absolutePath = $directoryWeb->getAbsolutePath(); + if ($absolutePath && strpos($fileRead->getAbsolutePath(), $absolutePath) === 0) { return true; } From 5b1dbac98d66225639ac758015efe294ff8a9902 Mon Sep 17 00:00:00 2001 From: Harald Deiser <h.deiser@techdivision.com> Date: Tue, 25 Jun 2019 14:36:05 +0200 Subject: [PATCH 090/230] MC-16991: Fixed composer files of new modules, fixed an error where a privat variable will never be used and ignored error which can't be fixed without causing incompatibilities --- app/code/Magento/AmqpStore/composer.json | 2 +- app/code/Magento/AuthorizenetCardinal/composer.json | 2 +- app/code/Magento/AuthorizenetGraphQl/composer.json | 2 +- app/code/Magento/CardinalCommerce/composer.json | 2 +- app/code/Magento/PaypalGraphQl/composer.json | 2 +- app/code/Magento/Store/App/Response/Redirect.php | 1 + app/code/Magento/Theme/Helper/Storage.php | 1 + .../Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php | 5 ----- 8 files changed, 7 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/AmqpStore/composer.json b/app/code/Magento/AmqpStore/composer.json index bd11527bbb36..bfefab262d3f 100644 --- a/app/code/Magento/AmqpStore/composer.json +++ b/app/code/Magento/AmqpStore/composer.json @@ -8,7 +8,7 @@ "magento/framework": "*", "magento/framework-amqp": "*", "magento/module-store": "*", - "php": "~7.1.3||~7.2.0" + "php": "~7.1.3||~7.2.0||~7.3.0" }, "suggest": { "magento/module-asynchronous-operations": "*", diff --git a/app/code/Magento/AuthorizenetCardinal/composer.json b/app/code/Magento/AuthorizenetCardinal/composer.json index 2d3ceee20937..8b913f705603 100644 --- a/app/code/Magento/AuthorizenetCardinal/composer.json +++ b/app/code/Magento/AuthorizenetCardinal/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/module-authorizenet-acceptjs": "*", "magento/framework": "*", "magento/module-cardinal-commerce": "*", diff --git a/app/code/Magento/AuthorizenetGraphQl/composer.json b/app/code/Magento/AuthorizenetGraphQl/composer.json index 6adf11ff72b5..2b54049bab43 100644 --- a/app/code/Magento/AuthorizenetGraphQl/composer.json +++ b/app/code/Magento/AuthorizenetGraphQl/composer.json @@ -3,7 +3,7 @@ "description": "N/A", "type": "magento2-module", "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-quote-graph-ql": "*" }, diff --git a/app/code/Magento/CardinalCommerce/composer.json b/app/code/Magento/CardinalCommerce/composer.json index 3e839228dc79..bc7b31321037 100644 --- a/app/code/Magento/CardinalCommerce/composer.json +++ b/app/code/Magento/CardinalCommerce/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-checkout": "*", "magento/module-payment": "*", diff --git a/app/code/Magento/PaypalGraphQl/composer.json b/app/code/Magento/PaypalGraphQl/composer.json index c5bcae51e5ae..40ba132d8306 100644 --- a/app/code/Magento/PaypalGraphQl/composer.json +++ b/app/code/Magento/PaypalGraphQl/composer.json @@ -5,7 +5,7 @@ "sort-packages": true }, "require": { - "php": "~7.1.3||~7.2.0", + "php": "~7.1.3||~7.2.0||~7.3.0", "magento/framework": "*", "magento/module-quote": "*", "magento/module-checkout": "*", diff --git a/app/code/Magento/Store/App/Response/Redirect.php b/app/code/Magento/Store/App/Response/Redirect.php index b4af3c3c1bbf..144d526329c7 100644 --- a/app/code/Magento/Store/App/Response/Redirect.php +++ b/app/code/Magento/Store/App/Response/Redirect.php @@ -9,6 +9,7 @@ /** * Class Redirect computes redirect urls responses. + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class Redirect implements \Magento\Framework\App\Response\RedirectInterface { diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index d246c2a0aafc..4927cd2832e4 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -14,6 +14,7 @@ /** * @api * @since 100.0.2 + * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) */ class Storage extends \Magento\Framework\App\Helper\AbstractHelper { diff --git a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php index 702724e64df6..990893dfa909 100644 --- a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php @@ -22,11 +22,6 @@ class InitParamListenerTest extends \PHPUnit\Framework\TestCase */ private $listener; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $callbackHandler; - /** callable[][] */ private $callbacks = []; From 016dfa876882f87124a1f97214d6b10abf185f0c Mon Sep 17 00:00:00 2001 From: Harald Deiser <h.deiser@techdivision.com> Date: Tue, 25 Jun 2019 17:13:46 +0200 Subject: [PATCH 091/230] MC-16991: Updated magento codeing standard library --- composer.json | 4 +- composer.lock | 472 +++++++++++++++++++++++++------------------------- 2 files changed, 238 insertions(+), 238 deletions(-) diff --git a/composer.json b/composer.json index f187cf61da5f..d662265dad38 100644 --- a/composer.json +++ b/composer.json @@ -86,13 +86,13 @@ "allure-framework/allure-phpunit": "~1.2.0", "friendsofphp/php-cs-fixer": "~2.14.0", "lusitanian/oauth": "~0.8.10", - "magento/magento-coding-standard": "~1.0.0", + "magento/magento-coding-standard": "~3.0.0", "magento/magento2-functional-testing-framework": "~2.4.1", "pdepend/pdepend": "2.5.2", "phpmd/phpmd": "@stable", "phpunit/phpunit": "~6.5.0", "sebastian/phpcpd": "~3.0.0", - "squizlabs/php_codesniffer": "3.3.1" + "squizlabs/php_codesniffer": "~3.4.0" }, "suggest": { "ext-pcntl": "Need for run processes in parallel mode" diff --git a/composer.lock b/composer.lock index 5577af459b02..11dc14544b0a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5938ee127b3c29708b0fc68b7ff21ac2", + "content-hash": "46a8dd5ffc92e17a9d60469e973c4736", "packages": [ { "name": "braintree/braintree_php", @@ -592,6 +592,189 @@ ], "time": "2019-05-20T14:15:55+00:00" }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "9f83dded91781a01c63574e387eaa769be769115" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", + "reference": "9f83dded91781a01c63574e387eaa769be769115", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2018-12-04T20:46:45+00:00" + }, { "name": "guzzlehttp/ringphp", "version": "1.1.1", @@ -1561,6 +1744,46 @@ ], "time": "2018-11-20T15:27:04+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, { "name": "ramsey/uuid", "version": "3.8.0", @@ -6187,189 +6410,6 @@ "description": "Expands internal property references in a yaml file.", "time": "2017-12-16T16:06:03+00:00" }, - { - "name": "guzzlehttp/guzzle", - "version": "6.3.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.3-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2018-04-22T15:46:56+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.5.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "9f83dded91781a01c63574e387eaa769be769115" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", - "reference": "9f83dded91781a01c63574e387eaa769be769115", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2018-12-04T20:46:45+00:00" - }, { "name": "jms/metadata", "version": "1.7.0", @@ -6678,21 +6718,21 @@ }, { "name": "magento/magento-coding-standard", - "version": "1.0.2", + "version": "3", "source": { "type": "git", "url": "https://github.com/magento/magento-coding-standard.git", - "reference": "f7de26fb6add389d1b42286f67ee87424588a868" + "reference": "73a7b7f3c00b02242f45f706571430735586f608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/f7de26fb6add389d1b42286f67ee87424588a868", - "reference": "f7de26fb6add389d1b42286f67ee87424588a868", + "url": "https://api.github.com/repos/magento/magento-coding-standard/zipball/73a7b7f3c00b02242f45f706571430735586f608", + "reference": "73a7b7f3c00b02242f45f706571430735586f608", "shasum": "" }, "require": { "php": ">=5.6.0", - "squizlabs/php_codesniffer": "~3.3.0" + "squizlabs/php_codesniffer": "^3.4" }, "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" @@ -6704,7 +6744,7 @@ "AFL-3.0" ], "description": "A set of Magento specific PHP CodeSniffer rules.", - "time": "2019-04-05T19:05:17+00:00" + "time": "2019-06-18T21:01:42+00:00" }, { "name": "magento/magento2-functional-testing-framework", @@ -7933,46 +7973,6 @@ "abandoned": true, "time": "2018-08-09T05:50:03+00:00" }, - { - "name": "ralouphie/getallheaders", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "~3.7.0", - "satooshi/php-coveralls": ">=1.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "time": "2016-02-11T07:05:27+00:00" - }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -8623,16 +8623,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.3.1", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "628a481780561150481a9ec74709092b9759b3ec" + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/628a481780561150481a9ec74709092b9759b3ec", - "reference": "628a481780561150481a9ec74709092b9759b3ec", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", "shasum": "" }, "require": { @@ -8665,12 +8665,12 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], - "time": "2018-07-26T23:47:18+00:00" + "time": "2019-04-10T23:49:02+00:00" }, { "name": "symfony/browser-kit", From cbdfa97cf3cd46f7c0cabfd2a888b1479e018c70 Mon Sep 17 00:00:00 2001 From: Harald Deiser <h.deiser@techdivision.com> Date: Fri, 28 Jun 2019 11:03:10 +0200 Subject: [PATCH 092/230] MC-5920: Updated composer lock --- composer.lock | 92 +++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/composer.lock b/composer.lock index 11dc14544b0a..a807854b5a4c 100644 --- a/composer.lock +++ b/composer.lock @@ -2078,7 +2078,7 @@ }, { "name": "symfony/css-selector", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2194,16 +2194,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf" + "reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/bf2af40d738dec5e433faea7b00daa4431d0a4cf", - "reference": "bf2af40d738dec5e433faea7b00daa4431d0a4cf", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b9896d034463ad6fd2bf17e2bf9418caecd6313d", + "reference": "b9896d034463ad6fd2bf17e2bf9418caecd6313d", "shasum": "" }, "require": { @@ -2240,20 +2240,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-06-03T20:27:40+00:00" + "time": "2019-06-23T08:51:25+00:00" }, { "name": "symfony/finder", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "b3d4f4c0e4eadfdd8b296af9ca637cfbf51d8176" + "reference": "33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/b3d4f4c0e4eadfdd8b296af9ca637cfbf51d8176", - "reference": "b3d4f4c0e4eadfdd8b296af9ca637cfbf51d8176", + "url": "https://api.github.com/repos/symfony/finder/zipball/33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a", + "reference": "33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a", "shasum": "" }, "require": { @@ -2289,7 +2289,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-05-26T20:47:49+00:00" + "time": "2019-06-13T11:03:18+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2336,7 +2336,7 @@ }, { "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "email": "backendtea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", @@ -6820,7 +6820,7 @@ "time": "2019-06-10T17:57:40+00:00" }, { - "name": "mikey179/vfsstream", + "name": "mikey179/vfsStream", "version": "v1.6.6", "source": { "type": "git", @@ -8674,16 +8674,16 @@ }, { "name": "symfony/browser-kit", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "e07d50e84b8cf489590f22244f4f609579b4a2c4" + "reference": "a29dd02a1f3f81b9a15c7730cc3226718ddb55ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/e07d50e84b8cf489590f22244f4f609579b4a2c4", - "reference": "e07d50e84b8cf489590f22244f4f609579b4a2c4", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/a29dd02a1f3f81b9a15c7730cc3226718ddb55ca", + "reference": "a29dd02a1f3f81b9a15c7730cc3226718ddb55ca", "shasum": "" }, "require": { @@ -8729,20 +8729,20 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2019-05-30T16:10:05+00:00" + "time": "2019-06-11T15:41:59+00:00" }, { "name": "symfony/config", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "6379ee07398643e09e6ed1e87d9c62dfcad7f4eb" + "reference": "9198eea354be75794a7b1064de00d9ae9ae5090f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/6379ee07398643e09e6ed1e87d9c62dfcad7f4eb", - "reference": "6379ee07398643e09e6ed1e87d9c62dfcad7f4eb", + "url": "https://api.github.com/repos/symfony/config/zipball/9198eea354be75794a7b1064de00d9ae9ae5090f", + "reference": "9198eea354be75794a7b1064de00d9ae9ae5090f", "shasum": "" }, "require": { @@ -8793,20 +8793,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-05-30T16:10:05+00:00" + "time": "2019-06-08T06:33:08+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "fea7f73e278ee0337349a5a68b867fc656bb33f3" + "reference": "b851928be349c065197fdc0832f78d85139e3903" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/fea7f73e278ee0337349a5a68b867fc656bb33f3", - "reference": "fea7f73e278ee0337349a5a68b867fc656bb33f3", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/b851928be349c065197fdc0832f78d85139e3903", + "reference": "b851928be349c065197fdc0832f78d85139e3903", "shasum": "" }, "require": { @@ -8866,20 +8866,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-05-30T16:10:05+00:00" + "time": "2019-06-15T04:08:07+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "06ee58fbc9a8130f1d35b5280e15235a0515d457" + "reference": "291397232a2eefb3347eaab9170409981eaad0e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/06ee58fbc9a8130f1d35b5280e15235a0515d457", - "reference": "06ee58fbc9a8130f1d35b5280e15235a0515d457", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/291397232a2eefb3347eaab9170409981eaad0e2", + "reference": "291397232a2eefb3347eaab9170409981eaad0e2", "shasum": "" }, "require": { @@ -8927,20 +8927,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2019-05-31T18:55:30+00:00" + "time": "2019-06-13T11:03:18+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "b7e4945dd9b277cd24e93566e4da0a87956392a9" + "reference": "e1b507fcfa4e87d192281774b5ecd4265370180d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b7e4945dd9b277cd24e93566e4da0a87956392a9", - "reference": "b7e4945dd9b277cd24e93566e4da0a87956392a9", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e1b507fcfa4e87d192281774b5ecd4265370180d", + "reference": "e1b507fcfa4e87d192281774b5ecd4265370180d", "shasum": "" }, "require": { @@ -8982,11 +8982,11 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-06-06T10:05:02+00:00" + "time": "2019-06-26T09:25:00+00:00" }, { "name": "symfony/mime", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", @@ -9045,16 +9045,16 @@ }, { "name": "symfony/options-resolver", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "914e0edcb7cd0c9f494bc023b1d47534f4542332" + "reference": "40762ead607c8f792ee4516881369ffa553fee6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/914e0edcb7cd0c9f494bc023b1d47534f4542332", - "reference": "914e0edcb7cd0c9f494bc023b1d47534f4542332", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/40762ead607c8f792ee4516881369ffa553fee6f", + "reference": "40762ead607c8f792ee4516881369ffa553fee6f", "shasum": "" }, "require": { @@ -9095,7 +9095,7 @@ "configuration", "options" ], - "time": "2019-05-10T05:38:46+00:00" + "time": "2019-06-13T11:01:17+00:00" }, { "name": "symfony/polyfill-intl-idn", @@ -9333,7 +9333,7 @@ }, { "name": "symfony/stopwatch", - "version": "v4.3.1", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -9383,7 +9383,7 @@ }, { "name": "symfony/yaml", - "version": "v3.4.28", + "version": "v3.4.29", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", From 1081570d44948597f6b95c92e6a90b95f702dd7f Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Mon, 24 Jun 2019 14:45:49 +0200 Subject: [PATCH 093/230] MC-16969: fixes session manager create session fails when session is active --- lib/internal/Magento/Framework/Session/SessionManager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/internal/Magento/Framework/Session/SessionManager.php b/lib/internal/Magento/Framework/Session/SessionManager.php index c7d201676b22..b96925facf52 100644 --- a/lib/internal/Magento/Framework/Session/SessionManager.php +++ b/lib/internal/Magento/Framework/Session/SessionManager.php @@ -410,6 +410,9 @@ public function setSessionId($sessionId) { $this->_addHost(); if ($sessionId !== null && preg_match('#^[0-9a-zA-Z,-]+$#', $sessionId)) { + if ($this->getSessionId() !== $sessionId) { + $this->writeClose(); + } session_id($sessionId); } return $this; From 67bf7ad56c6c49dce22801cc76868a4bd2ccd1a3 Mon Sep 17 00:00:00 2001 From: Harald Deiser <h.deiser@techdivision.com> Date: Mon, 1 Jul 2019 14:11:35 +0200 Subject: [PATCH 094/230] MC-17912: Added fix for strpos --- dev/tests/functional/composer.json | 10 ++++++++-- .../Magento/Mtf/Util/ModuleResolver/SequenceSorter.php | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dev/tests/functional/composer.json b/dev/tests/functional/composer.json index 1bbff4401114..8f5204c9a9af 100644 --- a/dev/tests/functional/composer.json +++ b/dev/tests/functional/composer.json @@ -4,7 +4,7 @@ }, "require": { "php": "~7.1.3||~7.2.0||~7.3.0", - "magento/mtf": "1.0.0-rc61", + "magento/mtf": "dev-MC-17912", "allure-framework/allure-phpunit": "~1.2.0", "doctrine/annotations": "1.4.*", "phpunit/phpunit": "~6.5.0", @@ -19,5 +19,11 @@ "Magento\\": ["lib/Magento/", "testsuites/Magento", "generated/Magento/", "tests/app/Magento/"], "Test\\": "generated/Test/" } - } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/magento-techdivision/mtf.git" + } + ] } diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/ModuleResolver/SequenceSorter.php b/dev/tests/functional/lib/Magento/Mtf/Util/ModuleResolver/SequenceSorter.php index 110d9d5fbd6c..507d6bd362c8 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Util/ModuleResolver/SequenceSorter.php +++ b/dev/tests/functional/lib/Magento/Mtf/Util/ModuleResolver/SequenceSorter.php @@ -35,7 +35,7 @@ public function sort(array $paths) foreach ($paths as $key => $path) { $modulePath = realpath(MTF_TESTS_PATH . str_replace('_', DIRECTORY_SEPARATOR, $module)); $path = realpath($path); - if (strpos($path, $modulePath) !== false) { + if (!empty($modulePath) && strpos($path, $modulePath) !== false) { $sortedPaths[] = $path; unset($paths[$key]); } From 5728ead8acca446865251dff3b2b8e1319c58da4 Mon Sep 17 00:00:00 2001 From: Lars Roettig <l.roettig@techdivision.com> Date: Mon, 1 Jul 2019 15:54:07 +0200 Subject: [PATCH 095/230] MC-16959: Add new Zend Framework 1 Version --- composer.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index d662265dad38..070cda038e1d 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "elasticsearch/elasticsearch": "~2.0|~5.1|~6.1", "magento/composer": "dev-master", "magento/magento-composer-installer": ">=0.1.11", - "magento/zendframework1": "~1.14.1", + "magento/zendframework1": "~1.14.2", "monolog/monolog": "^1.17", "wikimedia/less.php": "~1.8.0", "paragonie/sodium_compat": "^1.6", @@ -334,10 +334,14 @@ "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/" } }, - "repositories": [ + "repositories": [ { "type": "vcs", "url": "https://github.com/magento/composer" + }, + { + "type": "vcs", + "url": "https://github.com/magento-techdivision/zf1.git" } ], "prefer-stable": true From fe94305dfbf1f9ab9c7c5a5764a05fd28d0377ae Mon Sep 17 00:00:00 2001 From: Lars Roettig <l.roettig@techdivision.com> Date: Mon, 1 Jul 2019 16:53:25 +0200 Subject: [PATCH 096/230] MC-17872: Update composer.json to php73 --- composer.lock | 518 +++++++++++++++++++------------------------------- 1 file changed, 195 insertions(+), 323 deletions(-) diff --git a/composer.lock b/composer.lock index a807854b5a4c..df5d948f9d22 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "46a8dd5ffc92e17a9d60469e973c4736", + "content-hash": "84f290c6a2bcc0790c872b1ab67e2026", "packages": [ { "name": "braintree/braintree_php", @@ -710,33 +710,37 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.5.2", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "9f83dded91781a01c63574e387eaa769be769115" + "reference": "dc784032a3f6f4e7a4b882e272b771f6fe4c37cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115", - "reference": "9f83dded91781a01c63574e387eaa769be769115", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc784032a3f6f4e7a4b882e272b771f6fe4c37cf", + "reference": "dc784032a3f6f4e7a4b882e272b771f6fe4c37cf", "shasum": "" }, "require": { "php": ">=5.4.0", "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5" + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { + "ext-zlib": "*", "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5-dev" + "dev-master": "1.6-dev" } }, "autoload": { @@ -773,7 +777,7 @@ "uri", "url" ], - "time": "2018-12-04T20:46:45+00:00" + "time": "2019-06-30T00:37:05+00:00" }, { "name": "guzzlehttp/ringphp", @@ -1062,18 +1066,25 @@ }, { "name": "magento/zendframework1", - "version": "1.14.1", + "version": "1.14.2", "source": { "type": "git", - "url": "https://github.com/magento/zf1.git", - "reference": "4df018254c70b5b998b00a8cb1a30760f831ff0d" + "url": "https://github.com/magento-techdivision/zf1.git", + "reference": "b93bba50de7535c49bd3fac43578c1261bb3c431" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/zf1/zipball/4df018254c70b5b998b00a8cb1a30760f831ff0d", - "reference": "4df018254c70b5b998b00a8cb1a30760f831ff0d", + "url": "https://api.github.com/repos/magento-techdivision/zf1/zipball/b93bba50de7535c49bd3fac43578c1261bb3c431", + "reference": "b93bba50de7535c49bd3fac43578c1261bb3c431", "shasum": "" }, + "archive": { + "exclude": [ + "/demos", + "/documentation", + "/tests" + ] + }, "require": { "php": ">=5.2.11" }, @@ -1092,7 +1103,6 @@ "Zend_": "library/" } }, - "notification-url": "https://packagist.org/downloads/", "include-path": [ "library/" ], @@ -1102,10 +1112,13 @@ "description": "Magento Zend Framework 1", "homepage": "http://framework.zend.com/", "keywords": [ - "ZF1", - "framework" + "framework", + "zf1" ], - "time": "2018-08-09T15:03:40+00:00" + "support": { + "source": "https://github.com/magento-techdivision/zf1/tree/1.14.2" + }, + "time": "2019-07-01T09:23:21+00:00" }, { "name": "monolog/monolog", @@ -1746,24 +1759,24 @@ }, { "name": "ralouphie/getallheaders", - "version": "2.0.5", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + "reference": "120b605dfeb996808c31b6477290a714d356e822" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", - "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", "shasum": "" }, "require": { - "php": ">=5.3" + "php": ">=5.6" }, "require-dev": { - "phpunit/phpunit": "~3.7.0", - "satooshi/php-coveralls": ">=1.0" + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" }, "type": "library", "autoload": { @@ -1782,7 +1795,7 @@ } ], "description": "A polyfill for getallheaders.", - "time": "2016-02-11T07:05:27+00:00" + "time": "2019-03-08T08:55:37+00:00" }, { "name": "ramsey/uuid", @@ -2459,16 +2472,16 @@ }, { "name": "tedivm/jshrink", - "version": "v1.3.2", + "version": "v1.3.3", "source": { "type": "git", "url": "https://github.com/tedious/JShrink.git", - "reference": "d9b51729f3c6692c2da3e3fe6c5cd7c9d1d3fa8f" + "reference": "566e0c731ba4e372be2de429ef7d54f4faf4477a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tedious/JShrink/zipball/d9b51729f3c6692c2da3e3fe6c5cd7c9d1d3fa8f", - "reference": "d9b51729f3c6692c2da3e3fe6c5cd7c9d1d3fa8f", + "url": "https://api.github.com/repos/tedious/JShrink/zipball/566e0c731ba4e372be2de429ef7d54f4faf4477a", + "reference": "566e0c731ba4e372be2de429ef7d54f4faf4477a", "shasum": "" }, "require": { @@ -2501,7 +2514,7 @@ "javascript", "minifier" ], - "time": "2019-06-15T23:11:19+00:00" + "time": "2019-06-28T18:11:46+00:00" }, { "name": "true/punycode", @@ -4865,25 +4878,26 @@ }, { "name": "allure-framework/allure-php-api", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", - "url": "https://github.com/allure-framework/allure-php-adapter-api.git", - "reference": "a462a0da121681577033e13c123b6cc4e89cdc64" + "url": "https://github.com/allure-framework/allure-php-commons.git", + "reference": "c7a675823ad75b8e02ddc364baae21668e7c4e88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/allure-framework/allure-php-adapter-api/zipball/a462a0da121681577033e13c123b6cc4e89cdc64", - "reference": "a462a0da121681577033e13c123b6cc4e89cdc64", + "url": "https://api.github.com/repos/allure-framework/allure-php-commons/zipball/c7a675823ad75b8e02ddc364baae21668e7c4e88", + "reference": "c7a675823ad75b8e02ddc364baae21668e7c4e88", "shasum": "" }, "require": { - "jms/serializer": ">=0.16.0", - "moontoast/math": ">=1.1.0", + "jms/serializer": "^0.16.0", "php": ">=5.4.0", - "phpunit/phpunit": ">=4.0.0", - "ramsey/uuid": ">=3.0.0", - "symfony/http-foundation": ">=2.0" + "ramsey/uuid": "^3.0.0", + "symfony/http-foundation": "^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0.0" }, "type": "library", "autoload": { @@ -4913,7 +4927,7 @@ "php", "report" ], - "time": "2016-12-07T12:15:46+00:00" + "time": "2018-05-25T14:02:11+00:00" }, { "name": "allure-framework/allure-phpunit", @@ -5844,76 +5858,6 @@ ], "time": "2019-03-25T19:12:02+00:00" }, - { - "name": "doctrine/collections", - "version": "v1.6.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/c5e0bc17b1620e97c968ac409acbff28b8b850be", - "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan-shim": "^0.9.2", - "phpunit/phpunit": "^7.0", - "vimeo/psalm": "^3.2.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", - "homepage": "https://www.doctrine-project.org/projects/collections.html", - "keywords": [ - "array", - "collections", - "iterators", - "php" - ], - "time": "2019-06-09T13:48:14+00:00" - }, { "name": "doctrine/instantiator", "version": "1.2.0", @@ -6030,52 +5974,6 @@ ], "time": "2019-06-08T11:03:04+00:00" }, - { - "name": "epfremme/swagger-php", - "version": "v2.0.0", - "source": { - "type": "git", - "url": "https://github.com/epfremmer/swagger-php.git", - "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/epfremmer/swagger-php/zipball/eee28a442b7e6220391ec953d3c9b936354f23bc", - "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.2", - "doctrine/collections": "^1.3", - "jms/serializer": "^1.1", - "php": ">=5.5", - "phpoption/phpoption": "^1.1", - "symfony/yaml": "^2.7|^3.1" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "~4.8|~5.0", - "satooshi/php-coveralls": "^1.0" - }, - "type": "package", - "autoload": { - "psr-4": { - "Epfremme\\Swagger\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Edward Pfremmer", - "email": "epfremme@nerdery.com" - } - ], - "description": "Library for parsing swagger documentation into PHP entities for use in testing and code generation", - "time": "2016-09-26T17:24:17+00:00" - }, { "name": "facebook/webdriver", "version": "1.7.1", @@ -6410,6 +6308,48 @@ "description": "Expands internal property references in a yaml file.", "time": "2017-12-16T16:06:03+00:00" }, + { + "name": "ircmaxell/password-compat", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/ircmaxell/password_compat.git", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", + "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "4.*" + }, + "type": "library", + "autoload": { + "files": [ + "lib/password.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anthony Ferrara", + "email": "ircmaxell@php.net", + "homepage": "http://blog.ircmaxell.com" + } + ], + "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", + "homepage": "https://github.com/ircmaxell/password_compat", + "keywords": [ + "hashing", + "password" + ], + "time": "2014-11-20T16:49:30+00:00" + }, { "name": "jms/metadata", "version": "1.7.0", @@ -6502,56 +6442,44 @@ }, { "name": "jms/serializer", - "version": "1.14.0", + "version": "0.16.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/serializer.git", - "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca" + "reference": "c8a171357ca92b6706e395c757f334902d430ea9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", - "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/c8a171357ca92b6706e395c757f334902d430ea9", + "reference": "c8a171357ca92b6706e395c757f334902d430ea9", "shasum": "" }, "require": { - "doctrine/annotations": "^1.0", - "doctrine/instantiator": "^1.0.3", - "jms/metadata": "^1.3", + "doctrine/annotations": "1.*", + "jms/metadata": "~1.1", "jms/parser-lib": "1.*", - "php": "^5.5|^7.0", - "phpcollection/phpcollection": "~0.1", - "phpoption/phpoption": "^1.1" - }, - "conflict": { - "twig/twig": "<1.12" + "php": ">=5.3.2", + "phpcollection/phpcollection": "~0.1" }, "require-dev": { "doctrine/orm": "~2.1", - "doctrine/phpcr-odm": "^1.3|^2.0", - "ext-pdo_sqlite": "*", - "jackalope/jackalope-doctrine-dbal": "^1.1.5", - "phpunit/phpunit": "^4.8|^5.0", + "doctrine/phpcr-odm": "~1.0.1", + "jackalope/jackalope-doctrine-dbal": "1.0.*", "propel/propel1": "~1.7", - "psr/container": "^1.0", - "symfony/dependency-injection": "^2.7|^3.3|^4.0", - "symfony/expression-language": "^2.6|^3.0", - "symfony/filesystem": "^2.1", - "symfony/form": "~2.1|^3.0", - "symfony/translation": "^2.1|^3.0", - "symfony/validator": "^2.2|^3.0", - "symfony/yaml": "^2.1|^3.0", - "twig/twig": "~1.12|~2.0" + "symfony/filesystem": "2.*", + "symfony/form": "~2.1", + "symfony/translation": "~2.0", + "symfony/validator": "~2.0", + "symfony/yaml": "2.*", + "twig/twig": ">=1.8,<2.0-dev" }, "suggest": { - "doctrine/cache": "Required if you like to use cache functionality.", - "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.", "symfony/yaml": "Required if you'd like to serialize data to YAML format." }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.14-dev" + "dev-master": "0.15-dev" } }, "autoload": { @@ -6561,16 +6489,14 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache2" ], "authors": [ { - "name": "Asmir Mustafic", - "email": "goetas@gmail.com" - }, - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh", + "role": "Developer of wrapped JMSSerializerBundle" } ], "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", @@ -6582,7 +6508,7 @@ "serialization", "xml" ], - "time": "2019-04-17T08:12:16+00:00" + "time": "2014-03-18T08:39:00+00:00" }, { "name": "league/container", @@ -6748,23 +6674,22 @@ }, { "name": "magento/magento2-functional-testing-framework", - "version": "2.4.1", + "version": "2.4.2", "source": { "type": "git", "url": "https://github.com/magento/magento2-functional-testing-framework.git", - "reference": "9b5de03fe069d4a36c911112c30b824ff4e80c3a" + "reference": "ec1dd8f26b9d6010c53a91d147c1283d82b1322f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/9b5de03fe069d4a36c911112c30b824ff4e80c3a", - "reference": "9b5de03fe069d4a36c911112c30b824ff4e80c3a", + "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/ec1dd8f26b9d6010c53a91d147c1283d82b1322f", + "reference": "ec1dd8f26b9d6010c53a91d147c1283d82b1322f", "shasum": "" }, "require": { "allure-framework/allure-codeception": "~1.3.0", "codeception/codeception": "~2.3.4 || ~2.4.0 ", "consolidation/robo": "^1.0.0", - "epfremme/swagger-php": "^2.0", "ext-curl": "*", "flow/jsonpath": ">0.2", "fzaninotto/faker": "^1.6", @@ -6788,6 +6713,9 @@ "squizlabs/php_codesniffer": "~3.2", "symfony/stopwatch": "~3.4.6" }, + "suggest": { + "epfremme/swagger-php": "^2.0" + }, "bin": [ "bin/mftf" ], @@ -6817,7 +6745,7 @@ "magento", "testing" ], - "time": "2019-06-10T17:57:40+00:00" + "time": "2019-06-28T15:36:47+00:00" }, { "name": "mikey179/vfsStream", @@ -6865,55 +6793,6 @@ "homepage": "http://vfs.bovigo.org/", "time": "2019-04-08T13:54:32+00:00" }, - { - "name": "moontoast/math", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/ramsey/moontoast-math.git", - "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/c2792a25df5cad4ff3d760dd37078fc5b6fccc79", - "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79", - "shasum": "" - }, - "require": { - "ext-bcmath": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "jakub-onderka/php-parallel-lint": "^0.9.0", - "phpunit/phpunit": "^4.7|>=5.0 <5.4", - "satooshi/php-coveralls": "^0.6.1", - "squizlabs/php_codesniffer": "^2.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Moontoast\\Math\\": "src/Moontoast/Math/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "description": "A mathematics library, providing functionality for large numbers", - "homepage": "https://github.com/ramsey/moontoast-math", - "keywords": [ - "bcmath", - "math" - ], - "time": "2017-02-16T16:54:46+00:00" - }, { "name": "mustache/mustache", "version": "v2.12.0", @@ -8931,31 +8810,31 @@ }, { "name": "symfony/http-foundation", - "version": "v4.3.2", + "version": "v2.8.50", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e1b507fcfa4e87d192281774b5ecd4265370180d" + "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e1b507fcfa4e87d192281774b5ecd4265370180d", - "reference": "e1b507fcfa4e87d192281774b5ecd4265370180d", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/746f8d3638bf46ee8b202e62f2b214c3d61fb06a", + "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/mime": "^4.3", - "symfony/polyfill-mbstring": "~1.1" + "php": ">=5.3.9", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php54": "~1.0", + "symfony/polyfill-php55": "~1.0" }, "require-dev": { - "predis/predis": "~1.0", - "symfony/expression-language": "~3.4|~4.0" + "symfony/expression-language": "~2.4|~3.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "2.8-dev" } }, "autoload": { @@ -8982,30 +8861,24 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-06-26T09:25:00+00:00" + "time": "2019-04-16T10:00:53+00:00" }, { - "name": "symfony/mime", + "name": "symfony/options-resolver", "version": "v4.3.2", "source": { "type": "git", - "url": "https://github.com/symfony/mime.git", - "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "40762ead607c8f792ee4516881369ffa553fee6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ec2c5565de60e03f33d4296a655e3273f0ad1f8b", - "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/40762ead607c8f792ee4516881369ffa553fee6f", + "reference": "40762ead607c8f792ee4516881369ffa553fee6f", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-intl-idn": "^1.10", - "symfony/polyfill-mbstring": "^1.0" - }, - "require-dev": { - "egulias/email-validator": "^2.0", - "symfony/dependency-injection": "~3.4|^4.1" + "php": "^7.1.3" }, "type": "library", "extra": { @@ -9015,7 +8888,7 @@ }, "autoload": { "psr-4": { - "Symfony\\Component\\Mime\\": "" + "Symfony\\Component\\OptionsResolver\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -9035,43 +8908,47 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "A library to manipulate MIME messages", + "description": "Symfony OptionsResolver Component", "homepage": "https://symfony.com", "keywords": [ - "mime", - "mime-type" + "config", + "configuration", + "options" ], - "time": "2019-06-04T09:22:54+00:00" + "time": "2019-06-13T11:01:17+00:00" }, { - "name": "symfony/options-resolver", - "version": "v4.3.2", + "name": "symfony/polyfill-php54", + "version": "v1.11.0", "source": { "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "40762ead607c8f792ee4516881369ffa553fee6f" + "url": "https://github.com/symfony/polyfill-php54.git", + "reference": "2964b17ddc32dba7bcba009d5501c84d3fba1452" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/40762ead607c8f792ee4516881369ffa553fee6f", - "reference": "40762ead607c8f792ee4516881369ffa553fee6f", + "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/2964b17ddc32dba7bcba009d5501c84d3fba1452", + "reference": "2964b17ddc32dba7bcba009d5501c84d3fba1452", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "1.11-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" + "Symfony\\Polyfill\\Php54\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -9080,54 +8957,51 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony OptionsResolver Component", + "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ - "config", - "configuration", - "options" + "compatibility", + "polyfill", + "portable", + "shim" ], - "time": "2019-06-13T11:01:17+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { - "name": "symfony/polyfill-intl-idn", + "name": "symfony/polyfill-php55", "version": "v1.11.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af" + "url": "https://github.com/symfony/polyfill-php55.git", + "reference": "96fa25cef405ea452919559a0025d5dc16e30e4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c766e95bec706cdd89903b1eda8afab7d7a6b7af", - "reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af", + "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/96fa25cef405ea452919559a0025d5dc16e30e4c", + "reference": "96fa25cef405ea452919559a0025d5dc16e30e4c", "shasum": "" }, "require": { - "php": ">=5.3.3", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php72": "^1.9" - }, - "suggest": { - "ext-intl": "For best performance" + "ircmaxell/password-compat": "~1.0", + "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" + "Symfony\\Polyfill\\Php55\\": "" }, "files": [ "bootstrap.php" @@ -9139,25 +9013,23 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "idn", - "intl", "polyfill", "portable", "shim" ], - "time": "2019-03-04T13:44:35+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-php70", @@ -9383,20 +9255,20 @@ }, { "name": "symfony/yaml", - "version": "v3.4.29", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" + "reference": "c60ecf5ba842324433b46f58dc7afc4487dbab99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", - "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c60ecf5ba842324433b46f58dc7afc4487dbab99", + "reference": "c60ecf5ba842324433b46f58dc7afc4487dbab99", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -9411,7 +9283,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -9438,7 +9310,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-03-25T07:48:46+00:00" + "time": "2019-04-06T14:04:46+00:00" }, { "name": "theseer/fdomdocument", From 18c9c8774d1c415f11c4c2b7bd273dee57539183 Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Mon, 8 Jul 2019 13:48:26 +0200 Subject: [PATCH 097/230] MC-17912: fixes AcceptanceTester class doesn't exist in suite folder --- composer.json | 2 +- composer.lock | 459 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 301 insertions(+), 160 deletions(-) diff --git a/composer.json b/composer.json index 070cda038e1d..de587e9b1c0f 100644 --- a/composer.json +++ b/composer.json @@ -87,7 +87,7 @@ "friendsofphp/php-cs-fixer": "~2.14.0", "lusitanian/oauth": "~0.8.10", "magento/magento-coding-standard": "~3.0.0", - "magento/magento2-functional-testing-framework": "~2.4.1", + "magento/magento2-functional-testing-framework": "2.4.1", "pdepend/pdepend": "2.5.2", "phpmd/phpmd": "@stable", "phpunit/phpunit": "~6.5.0", diff --git a/composer.lock b/composer.lock index df5d948f9d22..9951434dc460 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "84f290c6a2bcc0790c872b1ab67e2026", + "content-hash": "869d419d288c8eb4e90e1fb205cd16a7", "packages": [ { "name": "braintree/braintree_php", @@ -710,16 +710,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "dc784032a3f6f4e7a4b882e272b771f6fe4c37cf" + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc784032a3f6f4e7a4b882e272b771f6fe4c37cf", - "reference": "dc784032a3f6f4e7a4b882e272b771f6fe4c37cf", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", "shasum": "" }, "require": { @@ -777,7 +777,7 @@ "uri", "url" ], - "time": "2019-06-30T00:37:05+00:00" + "time": "2019-07-01T23:21:34+00:00" }, { "name": "guzzlehttp/ringphp", @@ -4878,26 +4878,25 @@ }, { "name": "allure-framework/allure-php-api", - "version": "1.1.5", + "version": "1.1.4", "source": { "type": "git", - "url": "https://github.com/allure-framework/allure-php-commons.git", - "reference": "c7a675823ad75b8e02ddc364baae21668e7c4e88" + "url": "https://github.com/allure-framework/allure-php-adapter-api.git", + "reference": "a462a0da121681577033e13c123b6cc4e89cdc64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/allure-framework/allure-php-commons/zipball/c7a675823ad75b8e02ddc364baae21668e7c4e88", - "reference": "c7a675823ad75b8e02ddc364baae21668e7c4e88", + "url": "https://api.github.com/repos/allure-framework/allure-php-adapter-api/zipball/a462a0da121681577033e13c123b6cc4e89cdc64", + "reference": "a462a0da121681577033e13c123b6cc4e89cdc64", "shasum": "" }, "require": { - "jms/serializer": "^0.16.0", + "jms/serializer": ">=0.16.0", + "moontoast/math": ">=1.1.0", "php": ">=5.4.0", - "ramsey/uuid": "^3.0.0", - "symfony/http-foundation": "^2.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0.0" + "phpunit/phpunit": ">=4.0.0", + "ramsey/uuid": ">=3.0.0", + "symfony/http-foundation": ">=2.0" }, "type": "library", "autoload": { @@ -4927,7 +4926,7 @@ "php", "report" ], - "time": "2018-05-25T14:02:11+00:00" + "time": "2016-12-07T12:15:46+00:00" }, { "name": "allure-framework/allure-phpunit", @@ -5858,6 +5857,76 @@ ], "time": "2019-03-25T19:12:02+00:00" }, + { + "name": "doctrine/collections", + "version": "v1.6.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/c5e0bc17b1620e97c968ac409acbff28b8b850be", + "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan-shim": "^0.9.2", + "phpunit/phpunit": "^7.0", + "vimeo/psalm": "^3.2.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", + "homepage": "https://www.doctrine-project.org/projects/collections.html", + "keywords": [ + "array", + "collections", + "iterators", + "php" + ], + "time": "2019-06-09T13:48:14+00:00" + }, { "name": "doctrine/instantiator", "version": "1.2.0", @@ -5974,6 +6043,52 @@ ], "time": "2019-06-08T11:03:04+00:00" }, + { + "name": "epfremme/swagger-php", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/epfremmer/swagger-php.git", + "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/epfremmer/swagger-php/zipball/eee28a442b7e6220391ec953d3c9b936354f23bc", + "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.2", + "doctrine/collections": "^1.3", + "jms/serializer": "^1.1", + "php": ">=5.5", + "phpoption/phpoption": "^1.1", + "symfony/yaml": "^2.7|^3.1" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "~4.8|~5.0", + "satooshi/php-coveralls": "^1.0" + }, + "type": "package", + "autoload": { + "psr-4": { + "Epfremme\\Swagger\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Edward Pfremmer", + "email": "epfremme@nerdery.com" + } + ], + "description": "Library for parsing swagger documentation into PHP entities for use in testing and code generation", + "time": "2016-09-26T17:24:17+00:00" + }, { "name": "facebook/webdriver", "version": "1.7.1", @@ -6308,48 +6423,6 @@ "description": "Expands internal property references in a yaml file.", "time": "2017-12-16T16:06:03+00:00" }, - { - "name": "ircmaxell/password-compat", - "version": "v1.0.4", - "source": { - "type": "git", - "url": "https://github.com/ircmaxell/password_compat.git", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c", - "reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "autoload": { - "files": [ - "lib/password.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", - "homepage": "http://blog.ircmaxell.com" - } - ], - "description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash", - "homepage": "https://github.com/ircmaxell/password_compat", - "keywords": [ - "hashing", - "password" - ], - "time": "2014-11-20T16:49:30+00:00" - }, { "name": "jms/metadata", "version": "1.7.0", @@ -6442,44 +6515,56 @@ }, { "name": "jms/serializer", - "version": "0.16.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/serializer.git", - "reference": "c8a171357ca92b6706e395c757f334902d430ea9" + "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/c8a171357ca92b6706e395c757f334902d430ea9", - "reference": "c8a171357ca92b6706e395c757f334902d430ea9", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", + "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", "shasum": "" }, "require": { - "doctrine/annotations": "1.*", - "jms/metadata": "~1.1", + "doctrine/annotations": "^1.0", + "doctrine/instantiator": "^1.0.3", + "jms/metadata": "^1.3", "jms/parser-lib": "1.*", - "php": ">=5.3.2", - "phpcollection/phpcollection": "~0.1" + "php": "^5.5|^7.0", + "phpcollection/phpcollection": "~0.1", + "phpoption/phpoption": "^1.1" + }, + "conflict": { + "twig/twig": "<1.12" }, "require-dev": { "doctrine/orm": "~2.1", - "doctrine/phpcr-odm": "~1.0.1", - "jackalope/jackalope-doctrine-dbal": "1.0.*", + "doctrine/phpcr-odm": "^1.3|^2.0", + "ext-pdo_sqlite": "*", + "jackalope/jackalope-doctrine-dbal": "^1.1.5", + "phpunit/phpunit": "^4.8|^5.0", "propel/propel1": "~1.7", - "symfony/filesystem": "2.*", - "symfony/form": "~2.1", - "symfony/translation": "~2.0", - "symfony/validator": "~2.0", - "symfony/yaml": "2.*", - "twig/twig": ">=1.8,<2.0-dev" + "psr/container": "^1.0", + "symfony/dependency-injection": "^2.7|^3.3|^4.0", + "symfony/expression-language": "^2.6|^3.0", + "symfony/filesystem": "^2.1", + "symfony/form": "~2.1|^3.0", + "symfony/translation": "^2.1|^3.0", + "symfony/validator": "^2.2|^3.0", + "symfony/yaml": "^2.1|^3.0", + "twig/twig": "~1.12|~2.0" }, "suggest": { + "doctrine/cache": "Required if you like to use cache functionality.", + "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.", "symfony/yaml": "Required if you'd like to serialize data to YAML format." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.15-dev" + "dev-1.x": "1.14-dev" } }, "autoload": { @@ -6489,14 +6574,16 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache2" + "MIT" ], "authors": [ { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + }, + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" } ], "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", @@ -6508,7 +6595,7 @@ "serialization", "xml" ], - "time": "2014-03-18T08:39:00+00:00" + "time": "2019-04-17T08:12:16+00:00" }, { "name": "league/container", @@ -6674,22 +6761,23 @@ }, { "name": "magento/magento2-functional-testing-framework", - "version": "2.4.2", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/magento/magento2-functional-testing-framework.git", - "reference": "ec1dd8f26b9d6010c53a91d147c1283d82b1322f" + "reference": "9b5de03fe069d4a36c911112c30b824ff4e80c3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/ec1dd8f26b9d6010c53a91d147c1283d82b1322f", - "reference": "ec1dd8f26b9d6010c53a91d147c1283d82b1322f", + "url": "https://api.github.com/repos/magento/magento2-functional-testing-framework/zipball/9b5de03fe069d4a36c911112c30b824ff4e80c3a", + "reference": "9b5de03fe069d4a36c911112c30b824ff4e80c3a", "shasum": "" }, "require": { "allure-framework/allure-codeception": "~1.3.0", "codeception/codeception": "~2.3.4 || ~2.4.0 ", "consolidation/robo": "^1.0.0", + "epfremme/swagger-php": "^2.0", "ext-curl": "*", "flow/jsonpath": ">0.2", "fzaninotto/faker": "^1.6", @@ -6713,9 +6801,6 @@ "squizlabs/php_codesniffer": "~3.2", "symfony/stopwatch": "~3.4.6" }, - "suggest": { - "epfremme/swagger-php": "^2.0" - }, "bin": [ "bin/mftf" ], @@ -6745,10 +6830,10 @@ "magento", "testing" ], - "time": "2019-06-28T15:36:47+00:00" + "time": "2019-06-10T17:57:40+00:00" }, { - "name": "mikey179/vfsStream", + "name": "mikey179/vfsstream", "version": "v1.6.6", "source": { "type": "git", @@ -6793,6 +6878,55 @@ "homepage": "http://vfs.bovigo.org/", "time": "2019-04-08T13:54:32+00:00" }, + { + "name": "moontoast/math", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/ramsey/moontoast-math.git", + "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/moontoast-math/zipball/c2792a25df5cad4ff3d760dd37078fc5b6fccc79", + "reference": "c2792a25df5cad4ff3d760dd37078fc5b6fccc79", + "shasum": "" + }, + "require": { + "ext-bcmath": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "jakub-onderka/php-parallel-lint": "^0.9.0", + "phpunit/phpunit": "^4.7|>=5.0 <5.4", + "satooshi/php-coveralls": "^0.6.1", + "squizlabs/php_codesniffer": "^2.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Moontoast\\Math\\": "src/Moontoast/Math/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A mathematics library, providing functionality for large numbers", + "homepage": "https://github.com/ramsey/moontoast-math", + "keywords": [ + "bcmath", + "math" + ], + "time": "2017-02-16T16:54:46+00:00" + }, { "name": "mustache/mustache", "version": "v2.12.0", @@ -8810,31 +8944,31 @@ }, { "name": "symfony/http-foundation", - "version": "v2.8.50", + "version": "v4.3.2", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a" + "reference": "e1b507fcfa4e87d192281774b5ecd4265370180d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/746f8d3638bf46ee8b202e62f2b214c3d61fb06a", - "reference": "746f8d3638bf46ee8b202e62f2b214c3d61fb06a", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e1b507fcfa4e87d192281774b5ecd4265370180d", + "reference": "e1b507fcfa4e87d192281774b5ecd4265370180d", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php54": "~1.0", - "symfony/polyfill-php55": "~1.0" + "php": "^7.1.3", + "symfony/mime": "^4.3", + "symfony/polyfill-mbstring": "~1.1" }, "require-dev": { - "symfony/expression-language": "~2.4|~3.0.0" + "predis/predis": "~1.0", + "symfony/expression-language": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -8861,24 +8995,30 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-04-16T10:00:53+00:00" + "time": "2019-06-26T09:25:00+00:00" }, { - "name": "symfony/options-resolver", + "name": "symfony/mime", "version": "v4.3.2", "source": { "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "40762ead607c8f792ee4516881369ffa553fee6f" + "url": "https://github.com/symfony/mime.git", + "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/40762ead607c8f792ee4516881369ffa553fee6f", - "reference": "40762ead607c8f792ee4516881369ffa553fee6f", + "url": "https://api.github.com/repos/symfony/mime/zipball/ec2c5565de60e03f33d4296a655e3273f0ad1f8b", + "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0" + }, + "require-dev": { + "egulias/email-validator": "^2.0", + "symfony/dependency-injection": "~3.4|^4.1" }, "type": "library", "extra": { @@ -8888,7 +9028,7 @@ }, "autoload": { "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" + "Symfony\\Component\\Mime\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -8908,47 +9048,43 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony OptionsResolver Component", + "description": "A library to manipulate MIME messages", "homepage": "https://symfony.com", "keywords": [ - "config", - "configuration", - "options" + "mime", + "mime-type" ], - "time": "2019-06-13T11:01:17+00:00" + "time": "2019-06-04T09:22:54+00:00" }, { - "name": "symfony/polyfill-php54", - "version": "v1.11.0", + "name": "symfony/options-resolver", + "version": "v4.3.2", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php54.git", - "reference": "2964b17ddc32dba7bcba009d5501c84d3fba1452" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "40762ead607c8f792ee4516881369ffa553fee6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/2964b17ddc32dba7bcba009d5501c84d3fba1452", - "reference": "2964b17ddc32dba7bcba009d5501c84d3fba1452", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/40762ead607c8f792ee4516881369ffa553fee6f", + "reference": "40762ead607c8f792ee4516881369ffa553fee6f", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "4.3-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php54\\": "" + "Symfony\\Component\\OptionsResolver\\": "" }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -8957,51 +9093,54 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions", + "description": "Symfony OptionsResolver Component", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" + "config", + "configuration", + "options" ], - "time": "2019-02-06T07:57:58+00:00" + "time": "2019-06-13T11:01:17+00:00" }, { - "name": "symfony/polyfill-php55", + "name": "symfony/polyfill-intl-idn", "version": "v1.11.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php55.git", - "reference": "96fa25cef405ea452919559a0025d5dc16e30e4c" + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/96fa25cef405ea452919559a0025d5dc16e30e4c", - "reference": "96fa25cef405ea452919559a0025d5dc16e30e4c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c766e95bec706cdd89903b1eda8afab7d7a6b7af", + "reference": "c766e95bec706cdd89903b1eda8afab7d7a6b7af", "shasum": "" }, "require": { - "ircmaxell/password-compat": "~1.0", - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/polyfill-mbstring": "^1.3", + "symfony/polyfill-php72": "^1.9" + }, + "suggest": { + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11-dev" + "dev-master": "1.9-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php55\\": "" + "Symfony\\Polyfill\\Intl\\Idn\\": "" }, "files": [ "bootstrap.php" @@ -9012,24 +9151,26 @@ "MIT" ], "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" + }, + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" } ], - "description": "Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions", + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "idn", + "intl", "polyfill", "portable", "shim" ], - "time": "2019-02-06T07:57:58+00:00" + "time": "2019-03-04T13:44:35+00:00" }, { "name": "symfony/polyfill-php70", @@ -9255,20 +9396,20 @@ }, { "name": "symfony/yaml", - "version": "v4.3.2", + "version": "v3.4.29", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "c60ecf5ba842324433b46f58dc7afc4487dbab99" + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/c60ecf5ba842324433b46f58dc7afc4487dbab99", - "reference": "c60ecf5ba842324433b46f58dc7afc4487dbab99", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -9283,7 +9424,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -9310,7 +9451,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-04-06T14:04:46+00:00" + "time": "2019-03-25T07:48:46+00:00" }, { "name": "theseer/fdomdocument", From 735024aef05ccf39412b343439b074129a8dfdaa Mon Sep 17 00:00:00 2001 From: Harald Deiser <h.deiser@techdivision.com> Date: Fri, 28 Jun 2019 11:38:48 +0200 Subject: [PATCH 098/230] MC-16991: Fixed static tests, changed formating and updated unit tests --- .../Model/Connector/Http/ResponseResolver.php | 3 +- .../Backend/App/Area/FrontNameResolver.php | 33 ++++++++-- .../Unit/App/Area/FrontNameResolverTest.php | 50 +++++++++++++- .../Braintree/Model/LocaleResolver.php | 3 + .../Category/Attribute/Backend/Image.php | 4 ++ .../Catalog/Model/CategoryManagement.php | 27 ++++++-- .../Form/Modifier/AbstractModifier.php | 2 - .../Cms/Model/Wysiwyg/Images/Storage.php | 65 +++++++++++++++---- .../Unit/Model/Wysiwyg/Images/StorageTest.php | 22 ++++++- .../Model/Checkout/ConfigProvider.php | 7 +- app/code/Magento/Deploy/Service/Bundle.php | 35 ++++++++-- .../Eav/Model/Entity/Increment/Alphanum.php | 3 + app/code/Magento/GraphQl/composer.json | 1 - .../Unit/Model/Payflow/TransparentTest.php | 2 +- .../ResourceModel/Product/Collection.php | 11 +++- .../ResourceModel/Product/CollectionTest.php | 5 +- .../Magento/Store/App/Response/Redirect.php | 32 ++++++--- app/code/Magento/Theme/Helper/Storage.php | 44 +++++++++++-- .../Theme/Model/Design/Backend/Exceptions.php | 8 +++ .../Theme/Model/Theme/Registration.php | 14 ++-- .../Magento/Theme/Model/Wysiwyg/Storage.php | 27 ++++++-- .../Test/Unit/Model/Wysiwyg/StorageTest.php | 21 +++++- .../Ui/Component/VariablesDataProvider.php | 23 +++++-- .../Webapi/Model/Rest/Swagger/Generator.php | 10 +-- .../AsynchronousSchemaRequestProcessor.php | 20 +++++- .../Fallback/Resolver/Simple.php | 2 +- .../Setup/Mvc/Bootstrap/InitParamListener.php | 29 ++++++--- .../Test/Unit/Controller/DataOptionTest.php | 1 - .../Test/Unit/Controller/EnvironmentTest.php | 2 +- .../Test/Unit/Controller/InstallTest.php | 1 - .../Mvc/Bootstrap/InitParamListenerTest.php | 36 +++++++--- 31 files changed, 444 insertions(+), 99 deletions(-) diff --git a/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php b/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php index 9ae099803ab8..e32b37ef239c 100644 --- a/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php +++ b/app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php @@ -31,8 +31,9 @@ public function __construct(ConverterInterface $converter, array $responseHandle } /** - * @param \Zend_Http_Response $response + * Get result from $response. * + * @param \Zend_Http_Response $response * @return bool|string */ public function getResult(\Zend_Http_Response $response) diff --git a/app/code/Magento/Backend/App/Area/FrontNameResolver.php b/app/code/Magento/Backend/App/Area/FrontNameResolver.php index 0738804b5f76..f03e97e32d2a 100644 --- a/app/code/Magento/Backend/App/Area/FrontNameResolver.php +++ b/app/code/Magento/Backend/App/Area/FrontNameResolver.php @@ -10,10 +10,15 @@ use Magento\Backend\Setup\ConfigOptionsList; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\DeploymentConfig; +use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\RequestInterface; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\Store; +use Zend\Uri\Uri; /** + * Class to get area front name. + * * @api * @since 100.0.2 */ @@ -59,19 +64,35 @@ class FrontNameResolver implements \Magento\Framework\App\Area\FrontNameResolver */ private $scopeConfig; + /** + * @var Uri + */ + private $uri; + + /** + * @var RequestInterface + */ + private $request; + /** * @param \Magento\Backend\App\Config $config * @param DeploymentConfig $deploymentConfig * @param ScopeConfigInterface $scopeConfig + * @param Uri $uri + * @param RequestInterface $request */ public function __construct( \Magento\Backend\App\Config $config, DeploymentConfig $deploymentConfig, - ScopeConfigInterface $scopeConfig + ScopeConfigInterface $scopeConfig, + Uri $uri = null, + RequestInterface $request = null ) { $this->config = $config; $this->defaultFrontName = $deploymentConfig->get(ConfigOptionsList::CONFIG_PATH_BACKEND_FRONTNAME); $this->scopeConfig = $scopeConfig; + $this->uri = $uri ?: ObjectManager::getInstance()->get(Uri::class); + $this->request = $request ?: ObjectManager::getInstance()->get(RequestInterface::class); } /** @@ -104,7 +125,7 @@ public function isHostBackend() } else { $backendUrl = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE); } - $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; + $host = $this->request->getServer('HTTP_HOST', ''); return stripos($this->getHostWithPort($backendUrl), (string) $host) !== false; } @@ -116,9 +137,11 @@ public function isHostBackend() */ private function getHostWithPort($url) { - $scheme = parse_url(trim($url), PHP_URL_SCHEME); - $host = parse_url(trim($url), PHP_URL_HOST); - $port = parse_url(trim($url), PHP_URL_PORT); + $this->uri->parse($url); + $scheme = $this->uri->getScheme(); + $host = $this->uri->getHost(); + $port = $this->uri->getPort(); + if (!$port) { $port = isset($this->standardPorts[$scheme]) ? $this->standardPorts[$scheme] : null; } diff --git a/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php b/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php index 642c6283deca..2da5a9263072 100644 --- a/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php +++ b/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php @@ -28,6 +28,16 @@ class FrontNameResolverTest extends \PHPUnit\Framework\TestCase */ protected $scopeConfigMock; + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Zend\Uri\Uri + */ + protected $uri; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\App\Request\Http + */ + protected $request; + /** * @var string */ @@ -41,9 +51,19 @@ protected function setUp() ->method('get') ->with(ConfigOptionsList::CONFIG_PATH_BACKEND_FRONTNAME) ->will($this->returnValue($this->_defaultFrontName)); + $this->uri = $this->createMock(\Zend\Uri\Uri::class); + + $this->request = $this->createMock(\Magento\Framework\App\Request\Http::class); + $this->configMock = $this->createMock(\Magento\Backend\App\Config::class); $this->scopeConfigMock = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class); - $this->model = new FrontNameResolver($this->configMock, $deploymentConfigMock, $this->scopeConfigMock); + $this->model = new FrontNameResolver( + $this->configMock, + $deploymentConfigMock, + $this->scopeConfigMock, + $this->uri, + $this->request + ); } public function testIfCustomPathUsed() @@ -93,7 +113,6 @@ public function testIfCustomPathNotUsed() */ public function testIsHostBackend($url, $host, $useCustomAdminUrl, $customAdminUrl, $expectedValue) { - $_SERVER['HTTP_HOST'] = $host; $this->scopeConfigMock->expects($this->exactly(2)) ->method('getValue') ->will( @@ -115,6 +134,33 @@ public function testIsHostBackend($url, $host, $useCustomAdminUrl, $customAdminU ] ) ); + + $this->request->expects($this->any()) + ->method('getServer') + ->will($this->returnValue($host)); + + $urlParts = []; + $this->uri->expects($this->once()) + ->method('parse') + ->willReturnCallback(function ($url) use (&$urlParts) { + $urlParts = parse_url($url); + }); + $this->uri->expects($this->once()) + ->method('getScheme') + ->willReturnCallback(function () use (&$urlParts) { + return array_key_exists('scheme', $urlParts) ? $urlParts['scheme'] : ''; + }); + $this->uri->expects($this->once()) + ->method('getHost') + ->willReturnCallback(function () use (&$urlParts) { + return array_key_exists('host', $urlParts) ? $urlParts['host'] : ''; + }); + $this->uri->expects($this->once()) + ->method('getPort') + ->willReturnCallback(function () use (&$urlParts) { + return array_key_exists('port', $urlParts) ? $urlParts['port'] : ''; + }); + $this->assertEquals($this->model->isHostBackend(), $expectedValue); } diff --git a/app/code/Magento/Braintree/Model/LocaleResolver.php b/app/code/Magento/Braintree/Model/LocaleResolver.php index 5dcd2e8a343e..df6f914ec34b 100644 --- a/app/code/Magento/Braintree/Model/LocaleResolver.php +++ b/app/code/Magento/Braintree/Model/LocaleResolver.php @@ -8,6 +8,9 @@ use Magento\Framework\Locale\ResolverInterface; use Magento\Braintree\Gateway\Config\PayPal\Config; +/** + * Resolve stores locale. + */ class LocaleResolver implements ResolverInterface { /** diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php index c3e90c478345..16fc76f81f34 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Backend/Image.php @@ -70,6 +70,7 @@ public function __construct( /** * Gets image name from $value array. + * * Will return empty string in a case when $value is not an array * * @param array $value Attribute value @@ -86,6 +87,7 @@ private function getUploadedImageName($value) /** * Avoiding saving potential upload data to DB + * * Will set empty image attribute value if image was not uploaded * * @param \Magento\Framework\DataObject $object @@ -113,6 +115,8 @@ public function beforeSave($object) } /** + * Get Instance of Category Image Uploader. + * * @return \Magento\Catalog\Model\ImageUploader * * @deprecated 101.0.0 diff --git a/app/code/Magento/Catalog/Model/CategoryManagement.php b/app/code/Magento/Catalog/Model/CategoryManagement.php index ea6d66df3627..bf6f26ebfb10 100644 --- a/app/code/Magento/Catalog/Model/CategoryManagement.php +++ b/app/code/Magento/Catalog/Model/CategoryManagement.php @@ -1,14 +1,14 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model; -use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory; - +/** + * Handles the category tree. + */ class CategoryManagement implements \Magento\Catalog\Api\CategoryManagementInterface { /** @@ -47,7 +47,14 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc + * + * @param int $rootCategoryId + * @param int $depth + * @return \Magento\Catalog\Api\Data\CategoryTreeInterface + * + * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function getTree($rootCategoryId = null, $depth = null) { @@ -99,7 +106,15 @@ private function getTopLevelCategory() } /** - * {@inheritdoc} + * @inheritdoc + * + * @param int $categoryId + * @param int $parentId + * @param int $afterId + * @return bool + * + * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function move($categoryId, $parentId, $afterId = null) { @@ -128,7 +143,7 @@ public function move($categoryId, $parentId, $afterId = null) } /** - * {@inheritdoc} + * @inheritdoc */ public function getCount() { diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php index 6280c9b11826..b9a959f88584 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php @@ -11,8 +11,6 @@ /** * Class AbstractModifier * - * @api - * * @SuppressWarnings(PHPMD.NumberOfChildren) * @since 101.0.0 */ diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index 70f0bde49fc4..7c6c62c74576 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -10,6 +10,7 @@ use Magento\Cms\Helper\Wysiwyg\Images; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; /** * Wysiwyg Images model. @@ -136,6 +137,20 @@ class Storage extends \Magento\Framework\DataObject */ protected $_uploaderFactory; + /** + * @var \Psr\Log\LoggerInterface|null + */ + private $logger; + /** + * @var \Magento\Framework\Filesystem\DriverInterface + */ + private $file; + + /** + * @var \Magento\Framework\Filesystem\Io\File|null + */ + private $ioFile; + /** * Construct * @@ -151,11 +166,17 @@ class Storage extends \Magento\Framework\DataObject * @param \Magento\MediaStorage\Model\File\Storage\DatabaseFactory $storageDatabaseFactory * @param \Magento\MediaStorage\Model\File\Storage\Directory\DatabaseFactory $directoryDatabaseFactory * @param \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory + * @param \Psr\Log\LoggerInterface|null $logger * @param array $resizeParameters * @param array $extensions * @param array $dirs * @param array $data + * @param \Magento\Framework\Filesystem\DriverInterface $file + * @param \Magento\Framework\Filesystem\Io\File|null $ioFile * + * @param \Magento\Framework\Filesystem\Io\File|null $ioFile + * + * @throws \Magento\Framework\Exception\FileSystemException * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -171,10 +192,13 @@ public function __construct( \Magento\MediaStorage\Model\File\Storage\DatabaseFactory $storageDatabaseFactory, \Magento\MediaStorage\Model\File\Storage\Directory\DatabaseFactory $directoryDatabaseFactory, \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory, + \Psr\Log\LoggerInterface $logger = null, array $resizeParameters = [], array $extensions = [], array $dirs = [], - array $data = [] + array $data = [], + \Magento\Framework\Filesystem\DriverInterface $file = null, + \Magento\Framework\Filesystem\Io\File $ioFile = null ) { $this->_session = $session; $this->_backendUrl = $backendUrl; @@ -188,9 +212,14 @@ public function __construct( $this->_storageDatabaseFactory = $storageDatabaseFactory; $this->_directoryDatabaseFactory = $directoryDatabaseFactory; $this->_uploaderFactory = $uploaderFactory; + $this->logger = $logger ?: ObjectManager::getInstance()->get(\Psr\Log\LoggerInterface::class); $this->_resizeParameters = $resizeParameters; $this->_extensions = $extensions; $this->_dirs = $dirs; + $this->file = $file ?: ObjectManager::getInstance()->get(\Magento\Framework\Filesystem\DriverInterface::class); + $this->ioFile = $ioFile ?: ObjectManager::getInstance()->get( + \Magento\Framework\Filesystem\Io\File::class + ); parent::__construct($data); } @@ -288,9 +317,12 @@ public function getDirsCollection($path) /** * Return files * - * @param string $path Parent directory path - * @param string $type Type of storage, e.g. image, media etc. - * @return \Magento\Framework\Data\Collection\Filesystem + * @param string $path Parent directory path + * @param string $type Type of storage, e.g. image, media etc. + * @return \Magento\Framework\Data\Collection\Filesystem + * + * @throws \Magento\Framework\Exception\FileSystemException + * @throws \Magento\Framework\Exception\LocalizedException */ public function getFilesCollection($path, $type = null) { @@ -328,7 +360,8 @@ public function getFilesCollection($path, $type = null) $item->setName($item->getBasename()); $item->setShortName($this->_cmsWysiwygImages->getShortFilename($item->getBasename())); $item->setUrl($this->_cmsWysiwygImages->getCurrentUrl() . $item->getBasename()); - $item->setSize(filesize($item->getFilename())); + $itemStats = $this->file->stat($item->getFilename()); + $item->setSize($itemStats['size']); $item->setMimeType(\mime_content_type($item->getFilename())); if ($this->isImage($item->getBasename())) { @@ -338,11 +371,15 @@ public function getFilesCollection($path, $type = null) $thumbUrl = $this->_backendUrl->getUrl('cms/*/thumbnail', ['file' => $item->getId()]); } - $size = @getimagesize($item->getFilename()); + try { + $size = getimagesize($item->getFilename()); - if (is_array($size)) { - $item->setWidth($size[0]); - $item->setHeight($size[1]); + if (is_array($size)) { + $item->setWidth($size[0]); + $item->setHeight($size[1]); + } + } catch (\Error $e) { + $this->logger->notice(sprintf("GetImageSize caused error: %s", $e->getMessage())); } } else { $thumbUrl = $this->_assetRepo->getUrl(self::THUMB_PLACEHOLDER_PATH_SUFFIX); @@ -589,7 +626,7 @@ public function resizeFile($source, $keepRatio = true) $image->open($source); $image->keepAspectRatio($keepRatio); $image->resize($this->_resizeParameters['width'], $this->_resizeParameters['height']); - $dest = $targetDir . '/' . pathinfo($source, PATHINFO_BASENAME); + $dest = $targetDir . '/' . $this->ioFile->getPathInfo($source)['basename']; $image->save($dest); if ($this->_directory->isFile($this->_directory->getRelativePath($dest))) { return $dest; @@ -624,7 +661,7 @@ public function getThumbsPath($filePath = false) $thumbnailDir = $this->getThumbnailRoot(); if ($filePath && strpos($filePath, (string) $mediaRootDir) === 0) { - $thumbnailDir .= dirname(substr($filePath, strlen($mediaRootDir))); + $thumbnailDir .= $this->file->getParentDirectory(substr($filePath, strlen($mediaRootDir))); } return $thumbnailDir; @@ -674,7 +711,11 @@ public function isImage($filename) if (!$this->hasData('_image_extensions')) { $this->setData('_image_extensions', $this->getAllowedExtensions('image')); } - $ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); + + $ext = ""; + if (array_key_exists('extension', $this->ioFile->getPathInfo($filename))) { + $ext = strtolower($this->ioFile->getPathInfo($filename)['extension']); + } return in_array($ext, $this->_getData('_image_extensions')); } diff --git a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php index 7bec1e360146..413307741dce 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php @@ -107,6 +107,11 @@ class StorageTest extends \PHPUnit\Framework\TestCase */ protected $objectManagerHelper; + /** + * @var \Magento\Framework\Filesystem\Io\File|\PHPUnit_Framework_MockObject_MockObject + */ + protected $ioFile; + private $allowedImageExtensions = [ 'jpg' => 'image/jpg', 'jpeg' => 'image/jpeg', @@ -148,6 +153,19 @@ protected function setUp() $this->returnValue($this->directoryMock) ); + $this->ioFile = $this->createPartialMock(\Magento\Framework\Filesystem\Io\File::class, ['getPathInfo']); + $this->ioFile->expects( + $this->any() + )->method( + 'getPathInfo' + )->will( + $this->returnCallback( + function ($path) { + return pathinfo($path); + } + ) + ); + $this->adapterFactoryMock = $this->createMock(\Magento\Framework\Image\AdapterFactory::class); $this->imageHelperMock = $this->createPartialMock( \Magento\Cms\Helper\Wysiwyg\Images::class, @@ -223,11 +241,13 @@ protected function setUp() 'directoryDatabaseFactory' => $this->directoryDatabaseFactoryMock, 'uploaderFactory' => $this->uploaderFactoryMock, 'resizeParameters' => $this->resizeParameters, + 'extensions' => $allowedExtensions, 'dirs' => [ 'exclude' => [], 'include' => [], ], - 'extensions' => $allowedExtensions, + 'data' => [], + 'ioFile' => $this->ioFile ] ); } diff --git a/app/code/Magento/Customer/Model/Checkout/ConfigProvider.php b/app/code/Magento/Customer/Model/Checkout/ConfigProvider.php index e212dea27369..ef0b8b7163ad 100644 --- a/app/code/Magento/Customer/Model/Checkout/ConfigProvider.php +++ b/app/code/Magento/Customer/Model/Checkout/ConfigProvider.php @@ -14,6 +14,9 @@ use Magento\Customer\Model\Form; use Magento\Store\Model\ScopeInterface; +/** + * Provides some configurations for customer. + */ class ConfigProvider implements ConfigProviderInterface { /** @@ -57,7 +60,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function getConfig() { @@ -96,6 +99,8 @@ protected function getLoginUrl() * Whether redirect to login page is required * * @return bool + * + * @throws \Magento\Framework\Exception\NoSuchEntityException */ protected function isRedirectRequired() { diff --git a/app/code/Magento/Deploy/Service/Bundle.php b/app/code/Magento/Deploy/Service/Bundle.php index 351413fd05f3..f16b93a18559 100644 --- a/app/code/Magento/Deploy/Service/Bundle.php +++ b/app/code/Magento/Deploy/Service/Bundle.php @@ -9,8 +9,10 @@ use Magento\Deploy\Package\BundleInterface; use Magento\Deploy\Package\BundleInterfaceFactory; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Filesystem; use Magento\Framework\App\Utility\Files; +use Magento\Framework\Filesystem\Io\File; use Magento\Framework\View\Asset\Repository; use Magento\Framework\View\Asset\RepositoryMap; @@ -76,6 +78,11 @@ class Bundle self::ASSET_TYPE_HTML ]; + /** + * @var File|null + */ + private $file; + /** * Bundle constructor * @@ -83,17 +90,25 @@ class Bundle * @param BundleInterfaceFactory $bundleFactory * @param BundleConfig $bundleConfig * @param Files $files + * + * @param File|null $file + * + * @throws \Magento\Framework\Exception\FileSystemException */ public function __construct( Filesystem $filesystem, BundleInterfaceFactory $bundleFactory, BundleConfig $bundleConfig, - Files $files + Files $files, + File $file = null ) { $this->pubStaticDir = $filesystem->getDirectoryWrite(DirectoryList::STATIC_VIEW); $this->bundleFactory = $bundleFactory; $this->bundleConfig = $bundleConfig; $this->utilityFiles = $files; + $this->file = $file ?: ObjectManager::getInstance()->get( + \Magento\Framework\Filesystem\Io\File::class + ); } /** @@ -103,14 +118,19 @@ public function __construct( * @param string $theme * @param string $locale * @return void + * + * @throws \Magento\Framework\Exception\FileSystemException + * @throws \Magento\Framework\Exception\LocalizedException */ public function deploy($area, $theme, $locale) { - $bundle = $this->bundleFactory->create([ + $bundle = $this->bundleFactory->create( + [ 'area' => $area, 'theme' => $theme, 'locale' => $locale - ]); + ] + ); // delete all previously created bundle files $bundle->clear(); @@ -140,10 +160,13 @@ public function deploy($area, $theme, $locale) $filePath = substr($sourcePath, strlen($area . '/' . $theme . '/' . $locale) + 1); } - $contentType = pathinfo($filePath, PATHINFO_EXTENSION); - if (!in_array($contentType, self::$availableTypes)) { + $contentType = $this->file->getPathInfo($filePath); + if (!array_key_exists('extension', $contentType) || + !in_array($contentType['extension'], self::$availableTypes) + ) { continue; } + $contentType = $contentType['extension']; if ($this->hasMinVersion($filePath) || $this->isExcluded($filePath, $area, $theme)) { continue; @@ -166,7 +189,7 @@ private function hasMinVersion($filePath) return true; } - $info = pathinfo($filePath); + $info = $this->file->getPathInfo($filePath); if (strpos($filePath, '.min.') !== false) { $this->excludedCache[] = str_replace(".min.{$info['extension']}", ".{$info['extension']}", $filePath); } else { diff --git a/app/code/Magento/Eav/Model/Entity/Increment/Alphanum.php b/app/code/Magento/Eav/Model/Entity/Increment/Alphanum.php index f0b1d621e5ac..8116717676f5 100644 --- a/app/code/Magento/Eav/Model/Entity/Increment/Alphanum.php +++ b/app/code/Magento/Eav/Model/Entity/Increment/Alphanum.php @@ -15,6 +15,9 @@ */ namespace Magento\Eav\Model\Entity\Increment; +/** + * Handle alphanumeric ids. + */ class Alphanum extends \Magento\Eav\Model\Entity\Increment\AbstractIncrement { /** diff --git a/app/code/Magento/GraphQl/composer.json b/app/code/Magento/GraphQl/composer.json index 8ea033b49996..166e3f170f2d 100644 --- a/app/code/Magento/GraphQl/composer.json +++ b/app/code/Magento/GraphQl/composer.json @@ -4,7 +4,6 @@ "type": "magento2-module", "require": { "php": "~7.1.3||~7.2.0||~7.3.0", - "magento/module-authorization": "*", "magento/module-eav": "*", "magento/framework": "*" }, diff --git a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php index f6df35ae272b..888814fa7f1c 100644 --- a/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php +++ b/app/code/Magento/Paypal/Test/Unit/Model/Payflow/TransparentTest.php @@ -194,7 +194,7 @@ private function getPaymentExtensionInterfaceFactory() ->disableOriginalConstructor() ->getMock(); $orderPaymentExtension = $this->getMockBuilder(OrderPaymentExtensionInterface::class) - ->setMethods(['setVaultPaymentToken']) + ->setMethods(['setVaultPaymentToken', 'getVaultPaymentToken']) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php index 2145f924edee..8dca418a3a6a 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Product/Collection.php @@ -9,6 +9,8 @@ */ namespace Magento\Reports\Model\ResourceModel\Product; +use Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory; + /** * Products Report collection. * @@ -66,6 +68,7 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection /** * Collection constructor. + * * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy @@ -90,7 +93,13 @@ class Collection extends \Magento\Catalog\Model\ResourceModel\Product\Collection * @param \Magento\Catalog\Model\Product\Type $productType * @param \Magento\Quote\Model\ResourceModel\Quote\Collection $quoteResource * @param \Magento\Framework\DB\Adapter\AdapterInterface|null $connection + * @param ProductLimitationFactory|null $productLimitationFactory + * @param \Magento\Framework\EntityManager\MetadataPool|null $metadataPool + * @param \Magento\Catalog\Model\Indexer\Category\Product\TableMaintainer|null $tableMaintainer + * @param \Magento\Catalog\Model\Indexer\Product\Price\PriceTableResolver|null $priceTableResolver + * @param \Magento\Framework\Indexer\DimensionFactory|null $dimensionFactory * + * @throws \Magento\Framework\Exception\LocalizedException * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -118,7 +127,7 @@ public function __construct( \Magento\Catalog\Model\Product\Type $productType, \Magento\Quote\Model\ResourceModel\Quote\Collection $quoteResource, \Magento\Framework\DB\Adapter\AdapterInterface $connection = null, - \Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory $productLimitationFactory = null, + ProductLimitationFactory $productLimitationFactory = null, \Magento\Framework\EntityManager\MetadataPool $metadataPool = null, \Magento\Catalog\Model\Indexer\Category\Product\TableMaintainer $tableMaintainer = null, \Magento\Catalog\Model\Indexer\Product\Price\PriceTableResolver $priceTableResolver = null, diff --git a/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php b/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php index 6e98f7f04238..ace99369d325 100644 --- a/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php +++ b/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Product/CollectionTest.php @@ -138,7 +138,10 @@ protected function setUp() $this->resourceMock->expects($this->atLeastOnce())->method('getConnection')->willReturn($this->connectionMock); $this->connectionMock->expects($this->atLeastOnce())->method('select')->willReturn($this->selectMock); - $productLimitationFactoryMock = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory::class) + $productLimitationFactoryMock = $this + ->getMockBuilder( + \Magento\Catalog\Model\ResourceModel\Product\Collection\ProductLimitationFactory::class + ) ->disableOriginalConstructor() ->getMock(); diff --git a/app/code/Magento/Store/App/Response/Redirect.php b/app/code/Magento/Store/App/Response/Redirect.php index 144d526329c7..cdb5a313e456 100644 --- a/app/code/Magento/Store/App/Response/Redirect.php +++ b/app/code/Magento/Store/App/Response/Redirect.php @@ -7,6 +7,8 @@ */ namespace Magento\Store\App\Response; +use Magento\Framework\App\ObjectManager; + /** * Class Redirect computes redirect urls responses. * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) @@ -47,6 +49,10 @@ class Redirect implements \Magento\Framework\App\Response\RedirectInterface * @var \Magento\Framework\UrlInterface */ protected $_urlBuilder; + /** + * @var \Zend\Uri\UriInterface|null + */ + private $uri; /** * Constructor @@ -57,6 +63,7 @@ class Redirect implements \Magento\Framework\App\Response\RedirectInterface * @param \Magento\Framework\Session\SessionManagerInterface $session * @param \Magento\Framework\Session\SidResolverInterface $sidResolver * @param \Magento\Framework\UrlInterface $urlBuilder + * @param \Zend\Uri\UriInterface|null $uri * @param bool $canUseSessionIdInParam */ public function __construct( @@ -66,6 +73,7 @@ public function __construct( \Magento\Framework\Session\SessionManagerInterface $session, \Magento\Framework\Session\SidResolverInterface $sidResolver, \Magento\Framework\UrlInterface $urlBuilder, + \Zend\Uri\UriInterface $uri = null, $canUseSessionIdInParam = true ) { $this->_canUseSessionIdInParam = $canUseSessionIdInParam; @@ -75,6 +83,7 @@ public function __construct( $this->_session = $session; $this->_sidResolver = $sidResolver; $this->_urlBuilder = $urlBuilder; + $this->uri = $uri ?: ObjectManager::getInstance()->get(\Zend\Uri\Uri::class); } /** @@ -121,6 +130,8 @@ public function getRefererUrl() * * @param string $defaultUrl * @return \Magento\Framework\App\ActionInterface + * + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function getRedirectUrl($defaultUrl = null) { @@ -134,8 +145,10 @@ public function getRedirectUrl($defaultUrl = null) /** * Redirect to error page * - * @param string $defaultUrl + * @param string $defaultUrl * @return string + * + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function error($defaultUrl) { @@ -154,6 +167,8 @@ public function error($defaultUrl) * * @param string $defaultUrl * @return string + * + * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function success($defaultUrl) { @@ -218,21 +233,20 @@ protected function normalizeRefererUrl($refererUrl) return $refererUrl; } - $redirectParsedUrl = parse_url($refererUrl); - $refererQuery = []; + $redirectParsedUrl = $this->uri->parse($refererUrl); - if (!isset($redirectParsedUrl['query'])) { + if (!$redirectParsedUrl->getQuery()) { return $refererUrl; } - parse_str($redirectParsedUrl['query'], $refererQuery); + $refererQuery = $redirectParsedUrl->getQueryAsArray(); $refererQuery = $this->normalizeRefererQueryParts($refererQuery); - $normalizedUrl = $redirectParsedUrl['scheme'] + $normalizedUrl = $redirectParsedUrl->getScheme() . '://' - . $redirectParsedUrl['host'] - . (isset($redirectParsedUrl['port']) ? ':' . $redirectParsedUrl['port'] : '') - . $redirectParsedUrl['path'] + . $redirectParsedUrl->getHost() + . ($redirectParsedUrl->getPort() ? ':' . $redirectParsedUrl->getPort() : '') + . $redirectParsedUrl->getPath() . ($refererQuery ? '?' . http_build_query($refererQuery) : ''); return $normalizedUrl; diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index 4927cd2832e4..06b4c816d428 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -10,8 +10,11 @@ namespace Magento\Theme\Helper; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; /** + * Handles the storage of media files like images and fonts. + * * @api * @since 100.0.2 * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) @@ -89,17 +92,27 @@ class Storage extends \Magento\Framework\App\Helper\AbstractHelper */ protected $mediaDirectoryWrite; + /** + * @var \Magento\Framework\Filesystem\Io\File|null + */ + protected $file; + /** * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Framework\Filesystem $filesystem * @param \Magento\Backend\Model\Session $session * @param \Magento\Framework\View\Design\Theme\FlyweightFactory $themeFactory + * @param \Magento\Framework\Filesystem\Io\File|null $file + * + * @throws \Magento\Framework\Exception\FileSystemException + * @throws \Magento\Framework\Exception\ValidatorException */ public function __construct( \Magento\Framework\App\Helper\Context $context, \Magento\Framework\Filesystem $filesystem, \Magento\Backend\Model\Session $session, - \Magento\Framework\View\Design\Theme\FlyweightFactory $themeFactory + \Magento\Framework\View\Design\Theme\FlyweightFactory $themeFactory, + \Magento\Framework\Filesystem\Io\File $file = null ) { parent::__construct($context); $this->filesystem = $filesystem; @@ -107,6 +120,9 @@ public function __construct( $this->_themeFactory = $themeFactory; $this->mediaDirectoryWrite = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA); $this->mediaDirectoryWrite->create($this->mediaDirectoryWrite->getRelativePath($this->getStorageRoot())); + $this->file = $file ?: ObjectManager::getInstance()->get( + \Magento\Framework\Filesystem\Io\File::class + ); } /** @@ -247,7 +263,11 @@ public function getCurrentPath() */ public function getThumbnailDirectory($path) { - return pathinfo($path, PATHINFO_DIRNAME) . '/' . \Magento\Theme\Model\Wysiwyg\Storage::THUMBNAIL_DIRECTORY; + return sprintf( + "%s/%s", + $this->getFile()->getPathInfo($path)['dirname'], + \Magento\Theme\Model\Wysiwyg\Storage::THUMBNAIL_DIRECTORY + ); } /** @@ -260,10 +280,16 @@ public function getThumbnailDirectory($path) public function getThumbnailPath($imageName) { $imagePath = $this->getCurrentPath() . '/' . $imageName; - if (!$this->mediaDirectoryWrite->isExist($imagePath) || 0 !== strpos($imagePath, (string) $this->getStorageRoot())) { + if (!$this->mediaDirectoryWrite->isExist($imagePath) || + 0 !== strpos($imagePath, (string) $this->getStorageRoot()) + ) { throw new \InvalidArgumentException('The image not found.'); } - return $this->getThumbnailDirectory($imagePath) . '/' . pathinfo($imageName, PATHINFO_BASENAME); + return sprintf( + "%s/%s", + $this->getThumbnailDirectory($imagePath), + $this->getFile()->getPathInfo($imageName)['basename'] + ); } /** @@ -318,4 +344,14 @@ public function getSession() { return $this->_session; } + + /** + * Get io file. + * + * @return \Magento\Framework\Filesystem\Io\File|null + */ + public function getFile() + { + return $this->file; + } } diff --git a/app/code/Magento/Theme/Model/Design/Backend/Exceptions.php b/app/code/Magento/Theme/Model/Design/Backend/Exceptions.php index b2b4ef506bf4..d4ae0458625b 100644 --- a/app/code/Magento/Theme/Model/Design/Backend/Exceptions.php +++ b/app/code/Magento/Theme/Model/Design/Backend/Exceptions.php @@ -8,6 +8,9 @@ use Magento\Config\Model\Config\Backend\Serialized\ArraySerialized; use Magento\Framework\Serialize\Serializer\Json; +/** + * Validate Eav Model before save. + */ class Exceptions extends ArraySerialized { /** @@ -100,14 +103,17 @@ public function beforeSave() * * @param string $search * @return string + * * @throws \Magento\Framework\Exception\LocalizedException on invalid regular expression */ protected function _composeRegexp($search) { // If valid regexp entered - do nothing + /** @codingStandardsIgnoreStart */ if (@preg_match($search, '') !== false) { return $search; } + /** @codingStandardsIgnoreEnd */ // Find out - whether user wanted to enter regexp or normal string. if ($this->_isRegexp($search)) { @@ -163,6 +169,8 @@ public function afterLoad() } /** + * Get Value from data array. + * * @return array */ public function getValue() diff --git a/app/code/Magento/Theme/Model/Theme/Registration.php b/app/code/Magento/Theme/Model/Theme/Registration.php index 0cef321640ed..e42d8dad77bf 100644 --- a/app/code/Magento/Theme/Model/Theme/Registration.php +++ b/app/code/Magento/Theme/Model/Theme/Registration.php @@ -49,8 +49,8 @@ class Registration /** * Initialize dependencies * - * @param \Magento\Theme\Model\ResourceModel\Theme\Data\CollectionFactory $collectionFactory - * @param \Magento\Theme\Model\Theme\Data\Collection $filesystemCollection + * @param \Magento\Theme\Model\ResourceModel\Theme\Data\CollectionFactory $collectionFactory + * @param \Magento\Theme\Model\Theme\Data\Collection $filesystemCollection */ public function __construct( \Magento\Theme\Model\ResourceModel\Theme\Data\CollectionFactory $collectionFactory, @@ -80,12 +80,14 @@ public function register() /** * Register theme and recursively all its ascendants + * * Second param is optional and is used to prevent circular references in inheritance chain * - * @param ThemeInterface &$theme - * @param array $inheritanceChain - * @return $this - * @throws LocalizedException + * @param ThemeInterface &$theme + * @param array $inheritanceChain + * @return $this + * + * @throws LocalizedException */ protected function _registerThemeRecursively(&$theme, $inheritanceChain = []) { diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index de38bfcb1d63..3d1acc0f68f8 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -7,6 +7,7 @@ namespace Magento\Theme\Model\Wysiwyg; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; /** * Theme wysiwyg storage model @@ -74,6 +75,10 @@ class Storage * @var \Magento\Framework\Url\DecoderInterface */ protected $urlDecoder; + /** + * @var \Magento\Framework\Filesystem\Io\File|null + */ + private $file; /** * Initialize dependencies @@ -84,6 +89,9 @@ class Storage * @param \Magento\Framework\Image\AdapterFactory $imageFactory * @param \Magento\Framework\Url\EncoderInterface $urlEncoder * @param \Magento\Framework\Url\DecoderInterface $urlDecoder + * @param \Magento\Framework\Filesystem\Io\File|null $file + * + * @throws \Magento\Framework\Exception\FileSystemException */ public function __construct( \Magento\Framework\Filesystem $filesystem, @@ -91,7 +99,8 @@ public function __construct( \Magento\Framework\ObjectManagerInterface $objectManager, \Magento\Framework\Image\AdapterFactory $imageFactory, \Magento\Framework\Url\EncoderInterface $urlEncoder, - \Magento\Framework\Url\DecoderInterface $urlDecoder + \Magento\Framework\Url\DecoderInterface $urlDecoder, + \Magento\Framework\Filesystem\Io\File $file = null ) { $this->mediaWriteDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA); $this->_helper = $helper; @@ -99,6 +108,9 @@ public function __construct( $this->_imageFactory = $imageFactory; $this->urlEncoder = $urlEncoder; $this->urlDecoder = $urlDecoder; + $this->file = $file ?: ObjectManager::getInstance()->get( + \Magento\Framework\Filesystem\Io\File::class + ); } /** @@ -147,7 +159,7 @@ public function _createThumbnail($source) return false; } $thumbnailDir = $this->_helper->getThumbnailDirectory($source); - $thumbnailPath = $thumbnailDir . '/' . pathinfo($source, PATHINFO_BASENAME); + $thumbnailPath = sprintf("%s/%s", $thumbnailDir, $this->file->getPathInfo($source)['basename']); try { $this->mediaWriteDirectory->isExist($thumbnailDir); $image = $this->_imageFactory->create(); @@ -217,7 +229,9 @@ public function deleteFile($file) $filePath = $this->mediaWriteDirectory->getRelativePath($path . '/' . $file); $thumbnailPath = $this->_helper->getThumbnailDirectory($filePath) . '/' . $file; - if (0 === strpos($filePath, (string) $path) && 0 === strpos($filePath, (string) $this->_helper->getStorageRoot())) { + if (0 === strpos($filePath, (string) $path) && + 0 === strpos($filePath, (string) $this->_helper->getStorageRoot()) + ) { $this->mediaWriteDirectory->delete($filePath); $this->mediaWriteDirectory->delete($thumbnailPath); } @@ -261,7 +275,7 @@ public function getFilesCollection() if (!$this->mediaWriteDirectory->isFile($path)) { continue; } - $fileName = pathinfo($path, PATHINFO_BASENAME); + $fileName = $this->file->getPathInfo($path)['basename']; $file = ['text' => $fileName, 'id' => $this->urlEncoder->encode($fileName)]; if (self::TYPE_IMAGE == $storageType) { $requestParams['file'] = $fileName; @@ -289,7 +303,10 @@ public function getTreeArray() $resultArray = []; foreach ($directories as $path) { $resultArray[] = [ - 'text' => $this->_helper->getShortFilename(pathinfo($path, PATHINFO_BASENAME), 20), + 'text' => $this->_helper->getShortFilename( + $this->file->getPathInfo($path)['basename'], + 20 + ), 'id' => $this->_helper->convertPathToId($path), 'cls' => 'folder' ]; diff --git a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php index ddd6ebc43ce8..1990391a66ea 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php @@ -59,6 +59,19 @@ class StorageTest extends \PHPUnit\Framework\TestCase protected function setUp() { $this->_filesystem = $this->createMock(\Magento\Framework\Filesystem::class); + + $file = $this->createPartialMock(\Magento\Framework\Filesystem\Io\File::class, ['getPathInfo']); + + $file->expects($this->any()) + ->method('getPathInfo') + ->will( + $this->returnCallback( + function ($path) { + return pathinfo($path); + } + ) + ); + $this->_helperStorage = $this->createPartialMock( \Magento\Theme\Helper\Storage::class, [ @@ -69,9 +82,15 @@ protected function setUp() 'getShortFilename', 'getSession', 'convertPathToId', - 'getRequestParams' + 'getRequestParams', + 'getFile' ] ); + + $this->_helperStorage->expects($this->any()) + ->method('getFile') + ->will($this->returnValue($file)); + $this->_objectManager = $this->createMock(\Magento\Framework\ObjectManagerInterface::class); $this->_imageFactory = $this->createMock(\Magento\Framework\Image\AdapterFactory::class); $this->directoryWrite = $this->createMock(\Magento\Framework\Filesystem\Directory\Write::class); diff --git a/app/code/Magento/Variable/Ui/Component/VariablesDataProvider.php b/app/code/Magento/Variable/Ui/Component/VariablesDataProvider.php index 12f36f080e48..f685b7dac922 100644 --- a/app/code/Magento/Variable/Ui/Component/VariablesDataProvider.php +++ b/app/code/Magento/Variable/Ui/Component/VariablesDataProvider.php @@ -70,9 +70,12 @@ public function __construct( */ private function sortBy($items, $field, $direction) { - usort($items, function ($item1, $item2) use ($field, $direction) { - return $this->variablesCompare($item1, $item2, $field, $direction); - }); + usort( + $items, + function ($item1, $item2) use ($field, $direction) { + return $this->variablesCompare($item1, $item2, $field, $direction); + } + ); return $items; } @@ -95,7 +98,8 @@ private function variablesCompare($variable1, $variable2, $partIndex, $direction /** * Merge variables from different sources: - * custom variables and default (stores configuration variables) + * + * Custom variables and default (stores configuration variables) * * @return array */ @@ -120,9 +124,14 @@ public function getData() foreach ($filterGroup->getFilters() as $filter) { $value = str_replace('%', '', $filter->getValue()); $filterField = $filter->getField(); - $items = array_values(array_filter($items, function ($item) use ($value, $filterField) { - return strpos(strtolower($item[$filterField]), (string) strtolower($value)) !== false; - })); + $items = array_values( + array_filter( + $items, + function ($item) use ($value, $filterField) { + return strpos(strtolower($item[$filterField]), (string) strtolower($value)) !== false; + } + ) + ); } } diff --git a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php index d612a4a8d275..51b474cc215b 100644 --- a/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php +++ b/app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php @@ -751,12 +751,14 @@ private function handleComplex($name, $type, $prefix, $isArray) if ($isArray) { $subPrefix .= self::ARRAY_SIGNIFIER; } - $queryNames = array_merge( - $queryNames, - $this->getQueryParamNames($subParameterName, $subParameterType, $subParameterDescription, $subPrefix) + $queryNames[] = $this->getQueryParamNames( + $subParameterName, + $subParameterType, + $subParameterDescription, + $subPrefix ); } - return $queryNames; + return array_merge(...$queryNames); } /** diff --git a/app/code/Magento/WebapiAsync/Controller/Rest/AsynchronousSchemaRequestProcessor.php b/app/code/Magento/WebapiAsync/Controller/Rest/AsynchronousSchemaRequestProcessor.php index f85c58ee0613..313bdb232cc6 100644 --- a/app/code/Magento/WebapiAsync/Controller/Rest/AsynchronousSchemaRequestProcessor.php +++ b/app/code/Magento/WebapiAsync/Controller/Rest/AsynchronousSchemaRequestProcessor.php @@ -13,6 +13,9 @@ use Magento\Framework\Webapi\Request; use Magento\Webapi\Controller\Rest\RequestProcessorInterface; +/** + * Get schema from request to generate swagger body. + */ class AsynchronousSchemaRequestProcessor implements RequestProcessorInterface { /** @@ -25,10 +28,12 @@ class AsynchronousSchemaRequestProcessor implements RequestProcessorInterface * @var \Magento\Webapi\Model\Rest\Swagger\Generator */ private $swaggerGenerator; + /** * @var \Magento\Framework\Webapi\Rest\Response */ private $response; + /** * @var string */ @@ -52,7 +57,13 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc + * + * @return void + * + * @throws \Magento\Framework\Exception\AuthorizationException + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Webapi\Exception */ public function process(\Magento\Framework\Webapi\Rest\Request $request) { @@ -70,7 +81,10 @@ public function process(\Magento\Framework\Webapi\Rest\Request $request) } /** - * {@inheritdoc} + * @inheritdoc + * + * @param \Magento\Framework\Webapi\Rest\Request $request + * @return bool */ public function canProcess(\Magento\Framework\Webapi\Rest\Request $request) { @@ -81,6 +95,8 @@ public function canProcess(\Magento\Framework\Webapi\Rest\Request $request) } /** + * Check if a request is a bulk request. + * * @param \Magento\Framework\Webapi\Rest\Request $request * @return bool */ diff --git a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php index 20bb599e1e8e..fb2d8f429088 100644 --- a/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php +++ b/lib/internal/Magento/Framework/View/Design/FileResolution/Fallback/Resolver/Simple.php @@ -50,7 +50,7 @@ public function __construct(ReadFactory $readFactory, RulePool $rulePool) } /** - * {@inheritdoc} + * @inheritdoc */ public function resolve($type, $file, $area = null, ThemeInterface $theme = null, $locale = null, $module = null) { diff --git a/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php b/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php index c7bb7f30af41..709be46eac42 100644 --- a/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php +++ b/setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php @@ -5,10 +5,9 @@ */ namespace Magento\Setup\Mvc\Bootstrap; -use Interop\Container\ContainerInterface; -use Interop\Container\Exception\ContainerException; use Magento\Framework\App\Bootstrap as AppBootstrap; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\Request\Http; use Magento\Framework\App\State; use Magento\Framework\Filesystem; @@ -19,16 +18,16 @@ use Zend\Mvc\Application; use Zend\Mvc\MvcEvent; use Zend\Router\Http\RouteMatch; -use Zend\ServiceManager\Exception\ServiceNotCreatedException; -use Zend\ServiceManager\Exception\ServiceNotFoundException; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\Stdlib\RequestInterface; +use Zend\Uri\UriInterface; /** * A listener that injects relevant Magento initialization parameters and initializes filesystem * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @codingStandardsIgnoreStart */ class InitParamListener implements ListenerAggregateInterface, FactoryInterface { @@ -53,11 +52,15 @@ class InitParamListener implements ListenerAggregateInterface, FactoryInterface ]; /** - * {@inheritdoc} + * @inheritdoc * * The $priority argument is added to support latest versions of Zend Event Manager. * Starting from Zend Event Manager 3.0.0 release the ListenerAggregateInterface::attach() * supports the `priority` argument. + * + * @param EventManagerInterface $events + * @param int $priority + * @return void */ public function attach(EventManagerInterface $events, $priority = 1) { @@ -73,13 +76,16 @@ public function attach(EventManagerInterface $events, $priority = 1) } /** - * {@inheritdoc} + * @inheritdoc + * + * @param EventManagerInterface $events + * @return void */ public function detach(EventManagerInterface $events) { foreach ($this->listeners as $index => $listener) { - $events->detach($listener); - unset($this->listeners[$index]); + $events->detach($listener); + unset($this->listeners[$index]); } } @@ -110,7 +116,9 @@ public function onBootstrap(MvcEvent $e) * * @param \Zend\Mvc\MvcEvent $event * @return false|\Zend\Http\Response + * * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Magento\Setup\Exception */ public function authPreDispatch($event) { @@ -189,7 +197,10 @@ private function getSetupCookiePath(\Magento\Framework\ObjectManagerInterface $o } /** - * {@inheritdoc} + * @inheritdoc + * + * @param ServiceLocatorInterface $serviceLocator + * @return mixed */ public function createService(ServiceLocatorInterface $serviceLocator) { diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php index 264bde3a9440..89831dd1471f 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/DataOptionTest.php @@ -59,7 +59,6 @@ public function setUp() ->willReturn($this->mvcEvent); $this->mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); $this->mvcEvent->expects($this->any())->method('getName')->willReturn('dispatch'); - } public function testIndexAction() diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php index 105bcbce325d..aa16ea1f8cd6 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/EnvironmentTest.php @@ -307,5 +307,5 @@ protected function getMvcEventMock( $mvcEvent->expects($this->any())->method('getName')->willReturn('dispatch'); return $mvcEvent; -} + } } diff --git a/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php b/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php index c87b7fa10d9a..d0fd62adc42b 100644 --- a/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Controller/InstallTest.php @@ -215,7 +215,6 @@ public function testDispatch() $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); $mvcEvent->expects($this->any())->method('getName')->willReturn('dispatch'); - $contentArray = '{"config": { "address": { "base_url": "http://123.45.678.12"}}}'; $request->expects($this->any())->method('getContent')->willReturn($contentArray); $this->controller->setEvent($mvcEvent); diff --git a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php index 990893dfa909..79717ab55558 100644 --- a/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Mvc/Bootstrap/InitParamListenerTest.php @@ -304,10 +304,20 @@ public function testAuthPreDispatch() $routeMatchMock->expects($this->exactly(2)) ->method('getParam') - ->willReturnMap([ - ['controller', null, 'testController'], - ['action', null, 'testAction'] - ]); + ->willReturnMap( + [ + [ + 'controller', + null, + 'testController' + ], + [ + 'action', + null, + 'testAction' + ] + ] + ); $eventMock->expects($this->once()) ->method('getRouteMatch') ->willReturn($routeMatchMock); @@ -437,10 +447,20 @@ public function testAuthPreDispatchSkip() ->method('isAvailable'); $routeMatchMock->expects($this->exactly(2)) ->method('getParam') - ->willReturnMap([ - ['controller', null, \Magento\Setup\Controller\Session::class], - ['action', null, 'unlogin'] - ]); + ->willReturnMap( + [ + [ + 'controller', + null, + \Magento\Setup\Controller\Session::class + ], + [ + 'action', + null, + 'unlogin' + ] + ] + ); $eventMock->expects($this->once()) ->method('getRouteMatch') ->willReturn($routeMatchMock); From 5cc44b729e152ebba52e07fbc4cf77d4cbdccf2c Mon Sep 17 00:00:00 2001 From: Andrii Meysar <andrii.meysar@transoftgroup.com> Date: Tue, 9 Jul 2019 16:05:46 +0300 Subject: [PATCH 099/230] MC-6420: Ship Order API. Two bundle products with ship bundle items set to separately in order --- .../Sales/Service/V1/ShipOrderTest.php | 159 +++++++++++++++--- ...der_with_2_bundles_shipping_separately.php | 84 +++++++++ ...2_bundles_shipping_separately_rollback.php | 8 + ...bundle_products_with_separate_shipping.php | 102 +++++++++++ ...oducts_with_separate_shipping_rollback.php | 28 +++ 5 files changed, 354 insertions(+), 27 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately.php create mode 100644 dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping.php create mode 100644 dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping_rollback.php diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php index e2a156cc6fbf..ccbeadecdb62 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php @@ -5,6 +5,12 @@ */ namespace Magento\Sales\Service\V1; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\ObjectManagerInterface; +use Magento\Sales\Api\Data\OrderItemInterface; +use Magento\Sales\Api\ShipmentRepositoryInterface; +use Magento\Sales\Model\Order; + /** * API test for creation of Shipment for certain Order. */ @@ -14,22 +20,28 @@ class ShipOrderTest extends \Magento\TestFramework\TestCase\WebapiAbstract const SERVICE_VERSION = 'V1'; /** - * @var \Magento\Framework\ObjectManagerInterface + * @var ObjectManagerInterface */ private $objectManager; /** - * @var \Magento\Sales\Api\ShipmentRepositoryInterface + * @var ShipmentRepositoryInterface */ private $shipmentRepository; + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @inheritdoc + */ protected function setUp() { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - - $this->shipmentRepository = $this->objectManager->get( - \Magento\Sales\Api\ShipmentRepositoryInterface::class - ); + $this->shipmentRepository = $this->objectManager->get(ShipmentRepositoryInterface::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); } /** @@ -40,9 +52,8 @@ public function testConfigurableShipOrder() $this->markTestIncomplete('https://github.com/magento-engcom/msi/issues/1335'); $productsQuantity = 1; - /** @var \Magento\Sales\Model\Order $existingOrder */ - $existingOrder = $this->objectManager->create(\Magento\Sales\Model\Order::class) - ->loadByIncrementId('100000001'); + /** @var Order $existingOrder */ + $existingOrder = $this->getOrder('100000001'); $requestData = [ 'orderId' => $existingOrder->getId(), @@ -83,9 +94,8 @@ public function testConfigurableShipOrder() */ public function testShipOrder() { - /** @var \Magento\Sales\Model\Order $existingOrder */ - $existingOrder = $this->objectManager->create(\Magento\Sales\Model\Order::class) - ->loadByIncrementId('100000001'); + /** @var Order $existingOrder */ + $existingOrder = $this->getOrder('100000001'); $requestData = [ 'orderId' => $existingOrder->getId(), @@ -103,7 +113,7 @@ public function testShipOrder() ] ]; - /** @var \Magento\Sales\Api\Data\OrderItemInterface $item */ + /** @var OrderItemInterface $item */ foreach ($existingOrder->getAllItems() as $item) { $requestData['items'][] = [ 'order_item_id' => $item->getItemId(), @@ -121,9 +131,8 @@ public function testShipOrder() $this->fail('Failed asserting that Shipment was created'); } - /** @var \Magento\Sales\Model\Order $updatedOrder */ - $updatedOrder = $this->objectManager->create(\Magento\Sales\Model\Order::class) - ->loadByIncrementId('100000001'); + /** @var Order $updatedOrder */ + $updatedOrder = $this->getOrder('100000001'); $this->assertNotEquals( $existingOrder->getStatus(), @@ -144,9 +153,8 @@ public function testShipOrderWithoutTrackingNumberReturnsError() { $this->_markTestAsRestOnly('SOAP requires an tracking number to be provided so this case is not possible.'); - /** @var \Magento\Sales\Model\Order $existingOrder */ - $existingOrder = $this->objectManager->create(\Magento\Sales\Model\Order::class) - ->loadByIncrementId('100000001'); + /** @var Order $existingOrder */ + $existingOrder = $this->getOrder('100000001'); $requestData = [ 'orderId' => $existingOrder->getId(), @@ -170,9 +178,7 @@ public function testShipOrderWithoutTrackingNumberReturnsError() */ public function testPartialShipOrderWithBundleShippedSeparately() { - /** @var \Magento\Sales\Model\Order $existingOrder */ - $existingOrder = $this->objectManager->create(\Magento\Sales\Model\Order::class) - ->loadByIncrementId('100000001'); + $existingOrder = $this->getOrder('100000001'); $requestData = [ 'orderId' => $existingOrder->getId(), @@ -213,9 +219,8 @@ public function testPartialShipOrderWithBundleShippedSeparately() $this->assertEquals(1, $shipment->getTotalQty()); - /** @var \Magento\Sales\Model\Order $existingOrder */ - $existingOrder = $this->objectManager->create(\Magento\Sales\Model\Order::class) - ->loadByIncrementId('100000001'); + /** @var Order $existingOrder */ + $existingOrder = $this->getOrder('100000001'); foreach ($existingOrder->getAllItems() as $item) { if ($item->getItemId() == $shippedItemId) { @@ -227,10 +232,75 @@ public function testPartialShipOrderWithBundleShippedSeparately() } /** - * @param \Magento\Sales\Model\Order $order + * @magentoApiDataFixture Magento/Bundle/_files/order_with_2_bundles_shipping_separately.php + */ + public function testPartialShipOrderWithTwoBundleShippedSeparatelyContainsSameSimple() + { + /** @var Order $order */ + $order = $this->getOrder('order_bundle_separately_shipped'); + + $requestData = [ + 'orderId' => $order->getId(), + 'items' => [], + 'comment' => [ + 'comment' => 'Test Comment', + 'is_visible_on_front' => 1, + ], + 'tracks' => [] + ]; + + $shippedItemId = null; + $parentItemId = null; + foreach ($order->getAllItems() as $item) { + if ($item->getSku() === 'simple1') { + $requestData['items'][] = [ + 'order_item_id' => $item->getItemId(), + 'qty' => $item->getQtyOrdered(), + ]; + $shippedItemId = $item->getItemId(); + $parentItemId = $item->getParentItemId(); + break; + } + } + + $shipmentId = $this->_webApiCall($this->getServiceInfo($order), $requestData); + $this->assertNotEmpty($shipmentId); + + try { + $shipment = $this->shipmentRepository->get($shipmentId); + } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + $this->fail('Failed asserting that Shipment was created'); + } + + $this->assertEquals(1, $shipment->getTotalQty()); + + /** @var Order $existingOrder */ + $order = $this->getOrder('order_bundle_separately_shipped'); + + foreach ($order->getAllItems() as $item) { + if (in_array($item->getItemId(), [$shippedItemId, $parentItemId])) { + $this->assertEquals(1, $item->getQtyShipped()); + continue; + } + $this->assertEquals(0, $item->getQtyShipped()); + } + + try { + $this->_webApiCall($this->getServiceInfo($order), $requestData); + $this->fail('Expected exception was not raised'); + } catch (\Exception $exception) { + $this->assertExceptionMessage( + $exception, + 'Shipment Document Validation Error(s): You can\'t create a shipment without products.' + ); + } + } + + /** + * @param Order $order * @return array */ - private function getServiceInfo(\Magento\Sales\Model\Order $order) + private function getServiceInfo(Order $order): array { $serviceInfo = [ 'rest' => [ @@ -243,6 +313,41 @@ private function getServiceInfo(\Magento\Sales\Model\Order $order) 'operation' => self::SERVICE_READ_NAME . 'execute', ], ]; + return $serviceInfo; } + + /** + * Returns order by increment id. + * + * @param string $incrementId + * @return Order + */ + private function getOrder(string $incrementId): Order + { + return $this->objectManager->create(Order::class)->loadByIncrementId($incrementId); + } + + /** + * Assert correct exception message. + * + * @param \Exception $exception + * @param string $expectedMessage + * @return void + */ + private function assertExceptionMessage(\Exception $exception, string $expectedMessage): void + { + $actualMessage = ''; + switch (TESTS_WEB_API_ADAPTER) { + case self::ADAPTER_SOAP: + $actualMessage = trim(preg_replace('/\s+/', ' ', $exception->getMessage())); + break; + case self::ADAPTER_REST: + $error = $this->processRestExceptionResult($exception); + $actualMessage = $error['message']; + break; + } + + $this->assertEquals($expectedMessage, $actualMessage); + } } diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately.php new file mode 100644 index 000000000000..f2f0a99e3150 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately.php @@ -0,0 +1,84 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +require __DIR__ . '/two_bundle_products_with_separate_shipping.php'; +$addressData = include __DIR__ . '/../../../Magento/Sales/_files/address_data.php'; + +$billingAddress = $objectManager->create(\Magento\Quote\Model\Quote\Address::class, ['data' => $addressData]); +$billingAddress->setAddressType('billing'); + +$shippingAddress = clone $billingAddress; +$shippingAddress->setId(null)->setAddressType('shipping')->setShippingMethod('flatrate_flatrate'); + +/** @var \Magento\Quote\Model\Quote\Payment $payment */ +$payment = $objectManager->create(\Magento\Quote\Model\Quote\Payment::class); +$payment->setMethod('checkmo'); + +/** @var \Magento\Catalog\Model\ProductRepository $productRepository */ +$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); + +$bundleProduct = $productRepository->get('bundle-product-separate-shipping-1'); +$bundleProduct2 = $productRepository->get('bundle-product-separate-shipping-2'); +$selectionProducts = [ + $bundleProduct->getId() => [10, 12], + $bundleProduct2->getId() => [11, 13], +]; + +/** @var $cart \Magento\Checkout\Model\Cart */ +$cart = $objectManager->create(\Magento\Checkout\Model\Cart::class); + +foreach ([$bundleProduct, $bundleProduct2] as $product) { + + /** @var $typeInstance \Magento\Bundle\Model\Product\Type */ + $typeInstance = $product->getTypeInstance(); + $typeInstance->setStoreFilter($product->getStoreId(), $product); + $optionCollection = $typeInstance->getOptionsCollection($product); + + $bundleOptions = []; + $bundleOptionsQty = []; + $optionsData = []; + foreach ($optionCollection as $option) { + /** @var $option \Magento\Bundle\Model\Option */ + $selectionsCollection = $typeInstance->getSelectionsCollection([$option->getId()], $product); + $selectionIds = $selectionProducts[$product->getId()]; + $selectionsCollection->addIdFilter($selectionIds); + + foreach ($selectionIds as $productId) { + $selection = $selectionsCollection->getItemByColumnValue('product_id', $productId); + if ($selection !== null) { + $bundleOptions[$option->getId()] = $selection->getSelectionId(); + $optionsData[$option->getId()] = $selection->getProductId(); + $bundleOptionsQty[$option->getId()] = 1; + } + } + } + + $requestInfo = [ + 'product' => $product->getId(), + 'bundle_option' => $bundleOptions, + 'bundle_option_qty' => $bundleOptionsQty, + 'qty' => 1, + ]; + + $cart->addProduct($product, $requestInfo); +} + +$cart->getQuote() + ->setReservedOrderId('order_bundle_separately_shipped') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->setCheckoutMethod(\Magento\Quote\Api\CartManagementInterface::METHOD_GUEST) + ->setPayment($payment); +$cart->save(); + +/** @var \Magento\Quote\Model\QuoteManagement $quoteManager */ +$quoteManager = $objectManager->get(\Magento\Quote\Model\QuoteManagement::class); +$orderId = $quoteManager->placeOrder($cart->getQuote()->getId()); + +$objectManager->removeSharedInstance(\Magento\Checkout\Model\Session::class); diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately_rollback.php new file mode 100644 index 000000000000..96e3adb65a7d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately_rollback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/../../../Magento/Sales/_files/default_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping.php new file mode 100644 index 000000000000..e1dd3b23666b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping.php @@ -0,0 +1,102 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/multiple_products.php'; + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +/** @var \Magento\Catalog\Model\ProductRepository $productRepository */ +$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); +/** @var \Magento\Catalog\Model\ProductFactory $productFactory */ +$productFactory = $objectManager->create(\Magento\Catalog\Model\ProductFactory::class); +/** @var \Magento\Bundle\Api\Data\OptionInterfaceFactory $bundleOptionFactory */ +$bundleOptionFactory = $objectManager->create(\Magento\Bundle\Api\Data\OptionInterfaceFactory::class); +/** @var \Magento\Bundle\Api\Data\LinkInterfaceFactory $bundleLinkFactory */ +$bundleLinkFactory = $objectManager->create(\Magento\Bundle\Api\Data\LinkInterfaceFactory::class); + +/** @var $bundleProduct \Magento\Catalog\Model\Product */ +$bundleProduct = $productFactory->create(); +$bundleProduct->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) + ->setAttributeSetId(4) + ->setWebsiteIds([1]) + ->setName('Bundle Product With Separate Items Shipping') + ->setSku('bundle-product-separate-shipping-1') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->setPriceView(1) + ->setPriceType(1) + ->setPrice(10.0) + ->setShipmentType(1) + ->setBundleOptionsData( + [ + [ + 'title' => 'Option 1', + 'default_title' => 'Option 1', + 'type' => 'radio', + 'required' => 1, + 'delete' => '', + ], + [ + 'title' => 'Option 2', + 'default_title' => 'Option 2', + 'type' => 'radio', + 'required' => 1, + 'delete' => '', + ], + ] + )->setBundleSelectionsData( + [ + [ + ['product_id' => 10, 'selection_qty' => 1, 'selection_can_change_qty' => 1, 'delete' => ''], + ['product_id' => 11, 'selection_qty' => 1, 'selection_can_change_qty' => 1, 'delete' => ''], + ], + [ + ['product_id' => 12, 'selection_qty' => 1, 'selection_can_change_qty' => 1, 'delete' => ''], + ['product_id' => 13, 'selection_qty' => 1, 'selection_can_change_qty' => 1, 'delete' => ''], + ], + ] + ); + +$bundleProduct2 = $productFactory->create(['data' => $bundleProduct->getData()]); +$bundleProduct2 + ->setName('Bundle Product With Separate Items Shipping Two') + ->setSku('bundle-product-separate-shipping-2'); + +foreach ([$bundleProduct, $bundleProduct2] as $product) { + if ($product->getBundleOptionsData()) { + $options = []; + foreach ($product->getBundleOptionsData() as $key => $optionData) { + if (!(bool)$optionData['delete']) { + $option = $bundleOptionFactory->create(['data' => $optionData]); + $option->setSku($product->getSku()); + $option->setOptionId(null); + + $links = []; + $bundleLinks = $product->getBundleSelectionsData(); + if (!empty($bundleLinks[$key])) { + foreach ($bundleLinks[$key] as $linkData) { + if (!(bool)$linkData['delete']) { + $link = $bundleLinkFactory->create(['data' => $linkData]); + $linkProduct = $productRepository->getById($linkData['product_id']); + $link->setSku($linkProduct->getSku()); + $link->setQty($linkData['selection_qty']); + $links[] = $link; + } + } + $option->setProductLinks($links); + $options[] = $option; + } + } + } + $extension = $product->getExtensionAttributes(); + $extension->setBundleProductOptions($options); + $product->setExtensionAttributes($extension); + } + + $productRepository->save($product, true); +} diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping_rollback.php new file mode 100644 index 000000000000..19f73060c5ca --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping_rollback.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + +/** @var \Magento\Framework\Registry $registry */ +$registry = $objectManager->get(\Magento\Framework\Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); + +try { + $productRepository->deleteById('bundle-product-separate-shipping-1'); + $productRepository->deleteById('bundle-product-separate-shipping-2'); +} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { + // When DbIsolation is used products can be already removed by rollback main transaction +} + +$registry->register('isSecureArea', false); + +require __DIR__ . '/multiple_products_rollback.php'; From 53738ff8b6a9ab919320bf1ec79202a0f836cbb8 Mon Sep 17 00:00:00 2001 From: Ievgenii Gryshkun <i.gryshkun@gmail.com> Date: Wed, 10 Jul 2019 08:05:00 +0300 Subject: [PATCH 100/230] customizable_options.values contains everything but value(s) --- .../CartItem/DataProvider/CustomizableOptionValue/Multiple.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php index 619e84568a54..b3fa22c0cf61 100644 --- a/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php +++ b/app/code/Magento/QuoteGraphQl/Model/CartItem/DataProvider/CustomizableOptionValue/Multiple.php @@ -54,6 +54,7 @@ public function getData( $selectedOptionValueData[] = [ 'id' => $selectedOption->getId(), 'label' => $optionValue->getTitle(), + 'value' => $optionId, 'price' => [ 'type' => strtoupper($optionValue->getPriceType()), 'units' => $priceValueUnits, From 69761aea095f60c1585bdfbf5d030090d0a09b06 Mon Sep 17 00:00:00 2001 From: Andrii Meysar <andrii.meysar@transoftgroup.com> Date: Wed, 10 Jul 2019 10:02:17 +0300 Subject: [PATCH 101/230] MC-6420: Ship Order API. Two bundle products with ship bundle items set to separately in order --- .../Sales/Service/V1/ShipOrderTest.php | 4 +- ...der_with_2_bundles_shipping_separately.php | 43 ++++++++++++------- ...bundle_products_with_separate_shipping.php | 43 ++++++++++++------- ...oducts_with_separate_shipping_rollback.php | 17 +++++--- 4 files changed, 68 insertions(+), 39 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php index ccbeadecdb62..049f49c93c7c 100644 --- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/ShipOrderTest.php @@ -236,7 +236,6 @@ public function testPartialShipOrderWithBundleShippedSeparately() */ public function testPartialShipOrderWithTwoBundleShippedSeparatelyContainsSameSimple() { - /** @var Order $order */ $order = $this->getOrder('order_bundle_separately_shipped'); $requestData = [ @@ -246,7 +245,7 @@ public function testPartialShipOrderWithTwoBundleShippedSeparatelyContainsSameSi 'comment' => 'Test Comment', 'is_visible_on_front' => 1, ], - 'tracks' => [] + 'tracks' => [], ]; $shippedItemId = null; @@ -274,7 +273,6 @@ public function testPartialShipOrderWithTwoBundleShippedSeparatelyContainsSameSi $this->assertEquals(1, $shipment->getTotalQty()); - /** @var Order $existingOrder */ $order = $this->getOrder('order_bundle_separately_shipped'); foreach ($order->getAllItems() as $item) { diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately.php index f2f0a99e3150..11d99ef59f91 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/order_with_2_bundles_shipping_separately.php @@ -5,23 +5,35 @@ */ declare(strict_types=1); -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +use Magento\Bundle\Model\Option; +use Magento\Bundle\Model\Product\Type as BundleProductType; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Checkout\Model\Cart; +use Magento\Checkout\Model\Session; +use Magento\Quote\Api\CartManagementInterface; +use Magento\Quote\Model\Quote\Address; +use Magento\Quote\Model\Quote\Payment; +use Magento\Quote\Model\QuoteManagement; +use Magento\TestFramework\Helper\Bootstrap; require __DIR__ . '/two_bundle_products_with_separate_shipping.php'; $addressData = include __DIR__ . '/../../../Magento/Sales/_files/address_data.php'; -$billingAddress = $objectManager->create(\Magento\Quote\Model\Quote\Address::class, ['data' => $addressData]); +$objectManager = Bootstrap::getObjectManager(); +$billingAddress = $objectManager->create(Address::class, ['data' => $addressData]); $billingAddress->setAddressType('billing'); $shippingAddress = clone $billingAddress; -$shippingAddress->setId(null)->setAddressType('shipping')->setShippingMethod('flatrate_flatrate'); +$shippingAddress->setId(null) + ->setAddressType('shipping') + ->setShippingMethod('flatrate_flatrate'); -/** @var \Magento\Quote\Model\Quote\Payment $payment */ -$payment = $objectManager->create(\Magento\Quote\Model\Quote\Payment::class); +/** @var Payment $payment */ +$payment = $objectManager->create(Payment::class); $payment->setMethod('checkmo'); -/** @var \Magento\Catalog\Model\ProductRepository $productRepository */ -$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); $bundleProduct = $productRepository->get('bundle-product-separate-shipping-1'); $bundleProduct2 = $productRepository->get('bundle-product-separate-shipping-2'); @@ -30,12 +42,12 @@ $bundleProduct2->getId() => [11, 13], ]; -/** @var $cart \Magento\Checkout\Model\Cart */ -$cart = $objectManager->create(\Magento\Checkout\Model\Cart::class); +/** @var Cart $cart */ +$cart = $objectManager->create(Cart::class); foreach ([$bundleProduct, $bundleProduct2] as $product) { - /** @var $typeInstance \Magento\Bundle\Model\Product\Type */ + /** @var BundleProductType $typeInstance */ $typeInstance = $product->getTypeInstance(); $typeInstance->setStoreFilter($product->getStoreId(), $product); $optionCollection = $typeInstance->getOptionsCollection($product); @@ -43,8 +55,9 @@ $bundleOptions = []; $bundleOptionsQty = []; $optionsData = []; + + /** @var Option $option */ foreach ($optionCollection as $option) { - /** @var $option \Magento\Bundle\Model\Option */ $selectionsCollection = $typeInstance->getSelectionsCollection([$option->getId()], $product); $selectionIds = $selectionProducts[$product->getId()]; $selectionsCollection->addIdFilter($selectionIds); @@ -73,12 +86,12 @@ ->setReservedOrderId('order_bundle_separately_shipped') ->setBillingAddress($billingAddress) ->setShippingAddress($shippingAddress) - ->setCheckoutMethod(\Magento\Quote\Api\CartManagementInterface::METHOD_GUEST) + ->setCheckoutMethod(CartManagementInterface::METHOD_GUEST) ->setPayment($payment); $cart->save(); -/** @var \Magento\Quote\Model\QuoteManagement $quoteManager */ -$quoteManager = $objectManager->get(\Magento\Quote\Model\QuoteManagement::class); +/** @var QuoteManagement $quoteManager */ +$quoteManager = $objectManager->get(QuoteManagement::class); $orderId = $quoteManager->placeOrder($cart->getQuote()->getId()); -$objectManager->removeSharedInstance(\Magento\Checkout\Model\Session::class); +$objectManager->removeSharedInstance(Session::class); diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping.php index e1dd3b23666b..5521b1635408 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping.php @@ -5,31 +5,44 @@ */ declare(strict_types=1); +use Magento\Bundle\Api\Data\LinkInterfaceFactory; +use Magento\Bundle\Api\Data\OptionInterfaceFactory; +use Magento\Bundle\Model\Product\Price as BundlePrice; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type as BundleProductType; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Model\ProductFactory; +use Magento\TestFramework\Helper\Bootstrap; + require __DIR__ . '/multiple_products.php'; -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +$objectManager = Bootstrap::getObjectManager(); + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->create(ProductRepositoryInterface::class); + +/** @var ProductFactory $productFactory */ +$productFactory = $objectManager->create(ProductFactory::class); + +/** @var OptionInterfaceFactory $bundleOptionFactory */ +$bundleOptionFactory = $objectManager->create(OptionInterfaceFactory::class); -/** @var \Magento\Catalog\Model\ProductRepository $productRepository */ -$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class); -/** @var \Magento\Catalog\Model\ProductFactory $productFactory */ -$productFactory = $objectManager->create(\Magento\Catalog\Model\ProductFactory::class); -/** @var \Magento\Bundle\Api\Data\OptionInterfaceFactory $bundleOptionFactory */ -$bundleOptionFactory = $objectManager->create(\Magento\Bundle\Api\Data\OptionInterfaceFactory::class); -/** @var \Magento\Bundle\Api\Data\LinkInterfaceFactory $bundleLinkFactory */ -$bundleLinkFactory = $objectManager->create(\Magento\Bundle\Api\Data\LinkInterfaceFactory::class); +/** @var LinkInterfaceFactory $bundleLinkFactory */ +$bundleLinkFactory = $objectManager->create(LinkInterfaceFactory::class); -/** @var $bundleProduct \Magento\Catalog\Model\Product */ $bundleProduct = $productFactory->create(); -$bundleProduct->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) - ->setAttributeSetId(4) +$attributeSetId = $bundleProduct->getDefaultAttributeSetId(); +$bundleProduct->setTypeId(BundleProductType::TYPE_BUNDLE) + ->setAttributeSetId($attributeSetId) ->setWebsiteIds([1]) ->setName('Bundle Product With Separate Items Shipping') ->setSku('bundle-product-separate-shipping-1') - ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) - ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) ->setPriceView(1) - ->setPriceType(1) + ->setPriceType(BundlePrice::PRICE_TYPE_FIXED) ->setPrice(10.0) ->setShipmentType(1) ->setBundleOptionsData( diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping_rollback.php index 19f73060c5ca..c2c4d992d763 100644 --- a/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/two_bundle_products_with_separate_shipping_rollback.php @@ -5,21 +5,26 @@ */ declare(strict_types=1); -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; -/** @var \Magento\Framework\Registry $registry */ -$registry = $objectManager->get(\Magento\Framework\Registry::class); +$objectManager = Bootstrap::getObjectManager(); + +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', true); -/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ -$productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); try { $productRepository->deleteById('bundle-product-separate-shipping-1'); $productRepository->deleteById('bundle-product-separate-shipping-2'); -} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { +} catch (NoSuchEntityException $exception) { // When DbIsolation is used products can be already removed by rollback main transaction } From c67ce054cd8087271c4108d82d7cf2139020f091 Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Wed, 10 Jul 2019 14:18:05 +0200 Subject: [PATCH 102/230] MC-18027: Fixes Admin should be able to add image to WYSIWYG Editor on Catalog Page --- app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index 7c6c62c74576..a070a8e66ee6 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -141,6 +141,7 @@ class Storage extends \Magento\Framework\DataObject * @var \Psr\Log\LoggerInterface|null */ private $logger; + /** * @var \Magento\Framework\Filesystem\DriverInterface */ @@ -174,8 +175,6 @@ class Storage extends \Magento\Framework\DataObject * @param \Magento\Framework\Filesystem\DriverInterface $file * @param \Magento\Framework\Filesystem\Io\File|null $ioFile * - * @param \Magento\Framework\Filesystem\Io\File|null $ioFile - * * @throws \Magento\Framework\Exception\FileSystemException * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -216,10 +215,8 @@ public function __construct( $this->_resizeParameters = $resizeParameters; $this->_extensions = $extensions; $this->_dirs = $dirs; - $this->file = $file ?: ObjectManager::getInstance()->get(\Magento\Framework\Filesystem\DriverInterface::class); - $this->ioFile = $ioFile ?: ObjectManager::getInstance()->get( - \Magento\Framework\Filesystem\Io\File::class - ); + $this->file = $file ?: ObjectManager::getInstance()->get(\Magento\Framework\Filesystem\Driver\File::class); + $this->ioFile = $ioFile ?: ObjectManager::getInstance()->get(\Magento\Framework\Filesystem\Io\File::class); parent::__construct($data); } From 71c0fe9b41cad90388b36566ed71b2e3579abc3f Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Wed, 10 Jul 2019 15:14:30 +0200 Subject: [PATCH 103/230] MC-16991: Fixed static tests --- app/code/Magento/Store/App/Response/Redirect.php | 7 ++++--- app/code/Magento/Theme/Model/Wysiwyg/Storage.php | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Store/App/Response/Redirect.php b/app/code/Magento/Store/App/Response/Redirect.php index cdb5a313e456..178395ff6eb6 100644 --- a/app/code/Magento/Store/App/Response/Redirect.php +++ b/app/code/Magento/Store/App/Response/Redirect.php @@ -49,8 +49,9 @@ class Redirect implements \Magento\Framework\App\Response\RedirectInterface * @var \Magento\Framework\UrlInterface */ protected $_urlBuilder; + /** - * @var \Zend\Uri\UriInterface|null + * @var \Zend\Uri\Uri|null */ private $uri; @@ -63,7 +64,7 @@ class Redirect implements \Magento\Framework\App\Response\RedirectInterface * @param \Magento\Framework\Session\SessionManagerInterface $session * @param \Magento\Framework\Session\SidResolverInterface $sidResolver * @param \Magento\Framework\UrlInterface $urlBuilder - * @param \Zend\Uri\UriInterface|null $uri + * @param \Zend\Uri\Uri|null $uri * @param bool $canUseSessionIdInParam */ public function __construct( @@ -73,7 +74,7 @@ public function __construct( \Magento\Framework\Session\SessionManagerInterface $session, \Magento\Framework\Session\SidResolverInterface $sidResolver, \Magento\Framework\UrlInterface $urlBuilder, - \Zend\Uri\UriInterface $uri = null, + \Zend\Uri\Uri $uri = null, $canUseSessionIdInParam = true ) { $this->_canUseSessionIdInParam = $canUseSessionIdInParam; diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index 3d1acc0f68f8..edf8c148f8e6 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -11,6 +11,8 @@ /** * Theme wysiwyg storage model + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Storage { From ac09e09ab2c526d571aecc87f245d4d5100560ca Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Wed, 10 Jul 2019 15:36:31 +0200 Subject: [PATCH 104/230] MC-16192: Fixes for static and unit test --- app/code/Magento/Theme/Helper/Storage.php | 22 +++++-------------- .../Test/Unit/Model/Wysiwyg/StorageTest.php | 12 +++++----- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index 06b4c816d428..a98d49efc100 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -93,7 +93,7 @@ class Storage extends \Magento\Framework\App\Helper\AbstractHelper protected $mediaDirectoryWrite; /** - * @var \Magento\Framework\Filesystem\Io\File|null + * @var \Magento\Framework\Filesystem\Io\File */ protected $file; @@ -265,7 +265,7 @@ public function getThumbnailDirectory($path) { return sprintf( "%s/%s", - $this->getFile()->getPathInfo($path)['dirname'], + $this->file->getPathInfo($path)['dirname'], \Magento\Theme\Model\Wysiwyg\Storage::THUMBNAIL_DIRECTORY ); } @@ -288,7 +288,7 @@ public function getThumbnailPath($imageName) return sprintf( "%s/%s", $this->getThumbnailDirectory($imagePath), - $this->getFile()->getPathInfo($imageName)['basename'] + $this->file->getPathInfo($imageName)['basename'] ); } @@ -318,8 +318,8 @@ public function getRequestParams() public function getAllowedExtensionsByType() { return $this->getStorageType() == \Magento\Theme\Model\Wysiwyg\Storage::TYPE_FONT - ? ['ttf', 'otf', 'eot', 'svg', 'woff'] - : ['jpg', 'jpeg', 'gif', 'png', 'xbm', 'wbmp']; + ? ['ttf', 'otf', 'eot', 'svg', 'woff'] + : ['jpg', 'jpeg', 'gif', 'png', 'xbm', 'wbmp']; } /** @@ -344,14 +344,4 @@ public function getSession() { return $this->_session; } - - /** - * Get io file. - * - * @return \Magento\Framework\Filesystem\Io\File|null - */ - public function getFile() - { - return $this->file; - } -} +} \ No newline at end of file diff --git a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php index 1990391a66ea..39ace3d41987 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php @@ -82,14 +82,14 @@ function ($path) { 'getShortFilename', 'getSession', 'convertPathToId', - 'getRequestParams', - 'getFile' + 'getRequestParams' ] ); - $this->_helperStorage->expects($this->any()) - ->method('getFile') - ->will($this->returnValue($file)); + $reflection = new \ReflectionClass($this->_helperStorage); + $reflection_property = $reflection->getProperty('file'); + $reflection_property->setAccessible(true); + $reflection_property->setValue($this->_helperStorage, $file); $this->_objectManager = $this->createMock(\Magento\Framework\ObjectManagerInterface::class); $this->_imageFactory = $this->createMock(\Magento\Framework\Image\AdapterFactory::class); @@ -566,4 +566,4 @@ public function booleanCasesDataProvider() { return [[true], [false]]; } -} +} \ No newline at end of file From 571a72c3d22f601a6958958dae16408c49d1659b Mon Sep 17 00:00:00 2001 From: Ryan Simmons <rsimmons@crimsonagility.com> Date: Wed, 10 Jul 2019 17:33:05 -0700 Subject: [PATCH 105/230] Fixes issue 22112 (https://github.com/magento/magento2/issues/22112) by removing shipping address validation from the new billing address form in checkout. It appears this was added initially simply to validate the postcode in the form, but running the billing address through the actual shipping rate functionality in shipping-rates-validator's validateFields function was causing the issues leading to the address disappearing from the Ship To section & being deselected in the Shipping step. Instead, this validation is replaced in the billing address form by a simpler validator which only checks the postcode. --- .../billing-address-postcode-validator.js | 83 +++++++++++++++++++ .../frontend/web/js/view/billing-address.js | 6 +- 2 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js new file mode 100644 index 000000000000..863954add73b --- /dev/null +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js @@ -0,0 +1,83 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +define([ + 'jquery', + 'Magento_Checkout/js/model/postcode-validator', + 'mage/translate', + 'uiRegistry', + ], function ( + $, + postcodeValidator, + $t, + uiRegistry, +) { + 'use strict'; + + var postcodeElementName = 'postcode'; + + + return { + validateZipCodeTimeout: 0, + validateDelay: 2000, + + + /** + * Perform postponed binding for fieldset elements + * + * @param {String} formPath + */ + initFields: function (formPath) { + var self = this; + uiRegistry.async(formPath + '.' + postcodeElementName)(self.bindHandler.bind(self)); + }, + + /** + * @param {Object} element + * @param {Number} delay + */ + bindHandler: function (element, delay) { + var self = this; + + delay = typeof delay === 'undefined' ? self.validateDelay : delay; + + element.on('value', function () { + clearTimeout(self.validateZipCodeTimeout); + self.validateZipCodeTimeout = setTimeout(function () { + self.postcodeValidation(element); + }, delay); + }); + }, + + /** + * @param {Object} postcodeElement + * @return {*} + */ + postcodeValidation: function (postcodeElement) { + var countryId = $('select[name="country_id"]:visible').val(), + validationResult, + warnMessage; + + if (postcodeElement == null || postcodeElement.value() == null) { + return true; + } + + postcodeElement.warn(null); + validationResult = postcodeValidator.validate(postcodeElement.value(), countryId); + + if (!validationResult) { + warnMessage = $t('Provided Zip/Postal Code seems to be invalid.'); + + if (postcodeValidator.validatedPostCodeExample.length) { + warnMessage += $t(' Example: ') + postcodeValidator.validatedPostCodeExample.join('; ') + '. '; + } + warnMessage += $t('If you believe it is the right one you can ignore this notice.'); + postcodeElement.warn(warnMessage); + } + + return validationResult; + } + }; +}); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js index a552aa01da06..59d1daa75713 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js @@ -18,7 +18,7 @@ define([ 'Magento_Checkout/js/action/set-billing-address', 'Magento_Ui/js/model/messageList', 'mage/translate', - 'Magento_Checkout/js/model/shipping-rates-validator' + 'Magento_Checkout/js/model/billing-address-postcode-validator' ], function ( ko, @@ -35,7 +35,7 @@ function ( setBillingAddressAction, globalMessageList, $t, - shippingRatesValidator + billingAddressPostcodeValidator ) { 'use strict'; @@ -66,7 +66,7 @@ function ( quote.paymentMethod.subscribe(function () { checkoutDataResolver.resolveBillingAddress(); }, this); - shippingRatesValidator.initFields(this.get('name') + '.form-fields'); + billingAddressPostcodeValidator.initFields(this.get('name') + '.form-fields'); }, /** From 415937e1d29239894427e1a742271dfb341eb5a6 Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Thu, 11 Jul 2019 09:27:24 +0200 Subject: [PATCH 106/230] MC-16991: Fixes for static test --- app/code/Magento/Theme/Helper/Storage.php | 1 + app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index a98d49efc100..9267bd2c2831 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -18,6 +18,7 @@ * @api * @since 100.0.2 * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class Storage extends \Magento\Framework\App\Helper\AbstractHelper { diff --git a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php index 39ace3d41987..43dc39b09ada 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php @@ -9,6 +9,9 @@ */ namespace Magento\Theme\Test\Unit\Model\Wysiwyg; +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class StorageTest extends \PHPUnit\Framework\TestCase { /** From b25ce1c00c22742c09b43938e34b9ffd14954bf3 Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Thu, 11 Jul 2019 09:58:22 +0200 Subject: [PATCH 107/230] MC-16991: Fixes for static test --- app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php index 43dc39b09ada..6bc855275613 100644 --- a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php +++ b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php @@ -569,4 +569,4 @@ public function booleanCasesDataProvider() { return [[true], [false]]; } -} \ No newline at end of file +} From 896ff4981d60a766d2f6acde95f852f21cba9358 Mon Sep 17 00:00:00 2001 From: roettigl <l.roettig@techdivision.com> Date: Thu, 11 Jul 2019 11:24:29 +0200 Subject: [PATCH 108/230] MC-16991: Fixes for static --- app/code/Magento/Theme/Helper/Storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index 9267bd2c2831..81e34e986dee 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -345,4 +345,4 @@ public function getSession() { return $this->_session; } -} \ No newline at end of file +} From 10d4911289ef5fe19483b2677122c54cf8da6964 Mon Sep 17 00:00:00 2001 From: Alex Taranovsky <firster@atwix.com> Date: Thu, 11 Jul 2019 13:28:46 +0300 Subject: [PATCH 109/230] magento/magento2#: Fix storeId param type in the EmailNotification::newAccount, EmailNotificationInterface::newAccount methods - Magento\Customer\Model\EmailNotificationInterface - Magento\Customer\Model\EmailNotification --- app/code/Magento/Customer/Model/EmailNotification.php | 2 +- app/code/Magento/Customer/Model/EmailNotificationInterface.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Model/EmailNotification.php b/app/code/Magento/Customer/Model/EmailNotification.php index 144c24f8e835..573f86247e0c 100644 --- a/app/code/Magento/Customer/Model/EmailNotification.php +++ b/app/code/Magento/Customer/Model/EmailNotification.php @@ -362,7 +362,7 @@ public function passwordResetConfirmation(CustomerInterface $customer) * @param CustomerInterface $customer * @param string $type * @param string $backUrl - * @param string $storeId + * @param int $storeId * @param string $sendemailStoreId * @return void * @throws LocalizedException diff --git a/app/code/Magento/Customer/Model/EmailNotificationInterface.php b/app/code/Magento/Customer/Model/EmailNotificationInterface.php index 0821abff0475..028322acdd9d 100644 --- a/app/code/Magento/Customer/Model/EmailNotificationInterface.php +++ b/app/code/Magento/Customer/Model/EmailNotificationInterface.php @@ -73,7 +73,7 @@ public function passwordResetConfirmation(CustomerInterface $customer); * @param CustomerInterface $customer * @param string $type * @param string $backUrl - * @param string $storeId + * @param int $storeId * @param string $sendemailStoreId * @return void * @throws LocalizedException From 841a853dc9c43113b41ac647079332f15bd96b6e Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Thu, 11 Jul 2019 14:38:22 +0200 Subject: [PATCH 110/230] MC-16991: Fixes for static --- .../Unit/App/Area/FrontNameResolverTest.php | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php b/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php index 2da5a9263072..ba0b01d4055d 100644 --- a/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php +++ b/app/code/Magento/Backend/Test/Unit/App/Area/FrontNameResolverTest.php @@ -142,24 +142,32 @@ public function testIsHostBackend($url, $host, $useCustomAdminUrl, $customAdminU $urlParts = []; $this->uri->expects($this->once()) ->method('parse') - ->willReturnCallback(function ($url) use (&$urlParts) { - $urlParts = parse_url($url); - }); + ->willReturnCallback( + function ($url) use (&$urlParts) { + $urlParts = parse_url($url); + } + ); $this->uri->expects($this->once()) ->method('getScheme') - ->willReturnCallback(function () use (&$urlParts) { - return array_key_exists('scheme', $urlParts) ? $urlParts['scheme'] : ''; - }); + ->willReturnCallback( + function () use (&$urlParts) { + return array_key_exists('scheme', $urlParts) ? $urlParts['scheme'] : ''; + } + ); $this->uri->expects($this->once()) ->method('getHost') - ->willReturnCallback(function () use (&$urlParts) { - return array_key_exists('host', $urlParts) ? $urlParts['host'] : ''; - }); + ->willReturnCallback( + function () use (&$urlParts) { + return array_key_exists('host', $urlParts) ? $urlParts['host'] : ''; + } + ); $this->uri->expects($this->once()) ->method('getPort') - ->willReturnCallback(function () use (&$urlParts) { - return array_key_exists('port', $urlParts) ? $urlParts['port'] : ''; - }); + ->willReturnCallback( + function () use (&$urlParts) { + return array_key_exists('port', $urlParts) ? $urlParts['port'] : ''; + } + ); $this->assertEquals($this->model->isHostBackend(), $expectedValue); } From ec0e89f9024e743faa29167cf61b71ad49ebf304 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Thu, 11 Jul 2019 15:48:23 +0300 Subject: [PATCH 111/230] MAGETWO-97216: Random fail of test "Add products to wishlist from different stores" --- .../DeleteCustomStoreActionGroup.xml | 4 +- ...AddMultipleStoreProductsToWishlistTest.xml | 44 ++++++++++++------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml index 8a1d830661aa..70fc08528f85 100644 --- a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml +++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomStoreActionGroup.xml @@ -22,6 +22,8 @@ <click selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="clickDeleteStoreGroupButtonOnEditStorePage"/> <selectOption userInput="No" selector="{{AdminStoresDeleteStoreGroupSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/> <click selector="{{AdminStoresDeleteStoreGroupSection.deleteStoreGroupButton}}" stepKey="clickDeleteStoreGroupButtonOnDeleteStorePage"/> + <waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.successMessage}}" userInput="You deleted the store." stepKey="seeSuccessMessage"/> </actionGroup> <actionGroup name="DeleteCustomStoreBackupEnabledYesActionGroup"> <arguments> @@ -52,4 +54,4 @@ <waitForPageLoad stepKey="waitForStoreToLoad"/> <see selector="{{AdminStoresGridSection.emptyText}}" userInput="We couldn't find any records." stepKey="seeAssertStoreGroupNotInGridMessage"/> </actionGroup> -</actionGroups> \ No newline at end of file +</actionGroups> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml index ede63322235f..e8b645990390 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml @@ -10,16 +10,14 @@ <test name="StorefrontAddMultipleStoreProductsToWishlistTest"> <annotations> <features value="Wishlist"/> - <stories value="Adding to wishlist"/> + <stories value="Add product to wishlist"/> <title value="Customer should be able to add products to wishlist from different stores"/> <description value="All products added to wishlist should be visible on any store. Even if product visibility was set to 'Not Visible Individually' for this store"/> <group value="wishlist"/> <severity value="AVERAGE"/> - <testCaseId value="MAGETWO-95678"/> - <skip> - <issueId value="MC-13867"/> - </skip> + <testCaseId value="MC-6243"/> </annotations> + <before> <createData entity="customStoreGroup" stepKey="storeGroup"/> <createData entity="SimpleSubCategory" stepKey="categoryHandle"/> @@ -36,6 +34,7 @@ <argument name="storeGroupName" value="$$storeGroup.group[name]$$"/> </actionGroup> </before> + <after> <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> <deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/> @@ -43,8 +42,16 @@ <actionGroup ref="DeleteCustomStoreActionGroup" stepKey="deleteCustomStoreGroup"> <argument name="storeGroupName" value="$$storeGroup.group[name]$$"/> </actionGroup> - <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearWebsitesGridFilter"/> + + <!--Clear products filter--> + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsFilters"/> + <!--Logout everywhere--> + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> </after> + <!-- Change products visibility on store-view level --> <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForProduct1"> <argument name="product" value="$$product$$"/> @@ -52,7 +59,9 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1"> <argument name="product" value="$$product$$"/> </actionGroup> + <scrollToTopOfPage stepKey="scrollToTopToChangeStore"/> <click selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="clickSwitchStoreMenuForProduct1"/> + <waitForElementVisible selector="{{AdminProductFormChangeStoreSection.storeSelector(customStore.name)}}" stepKey="waitCustomStoreItemAppers"/> <click selector="{{AdminProductFormChangeStoreSection.storeSelector(customStore.name)}}" stepKey="clickOnStoreNameItemForProduct1"/> <waitForElementVisible selector="{{AdminProductFormChangeStoreSection.acceptButton}}" stepKey="waitAcceptStoreSwitchingForProduct1n"/> <click selector="{{AdminProductFormChangeStoreSection.acceptButton}}" stepKey="acceptStoreSwitchingForProduct1"/> @@ -65,36 +74,37 @@ <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct2"> <argument name="product" value="$$secondProduct$$"/> </actionGroup> + <scrollToTopOfPage stepKey="scrollToTopToChangeStoreAgain"/> <click selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="clickSwitchStoreMenuForProduct2"/> + <waitForElementVisible selector="{{AdminProductFormChangeStoreSection.storeSelector(customStore.name)}}" stepKey="waitDefaultStoreItemAppers"/> <click selector="{{AdminProductFormChangeStoreSection.storeSelector('Default Store View')}}" stepKey="clickOnStoreNameItemForProduct2"/> <waitForElementVisible selector="{{AdminProductFormChangeStoreSection.acceptButton}}" stepKey="waitAcceptStoreSwitchingForProduct2"/> <click selector="{{AdminProductFormChangeStoreSection.acceptButton}}" stepKey="acceptStoreSwitchingForProduct2"/> <click selector="{{AdminProductFormSection.visibilityUseDefault}}" stepKey="uncheckVisibilityUseDefaultValueForProduct2"/> <selectOption userInput="Not Visible Individually" selector="{{AdminProductFormSection.visibility}}" stepKey="makeProductNotVisibleOnDefaultStoreView"/> <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveEditedProductForProduct2"/> + <!-- Sign in as customer --> - <amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/> - <fillField userInput="$$customer.email$$" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/> - <fillField userInput="$$customer.password$$" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/> - <waitForElementVisible selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="waitForButton"/> - <click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> + <argument name="Customer" value="$$customer$$" /> + </actionGroup> <see userInput="$$customer.firstname$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeFirstName"/> <see userInput="$$customer.lastname$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeLastName"/> <see userInput="$$customer.email$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeEmail"/> <!-- Add product visible on default store to wishlist --> - <amOnPage url="$$product.name$$.html" stepKey="navigateToProductPageOnDefaultStore"/> + <amOnPage url="{{StorefrontProductPage.url($$product.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageOnDefaultStore"/> <see userInput="$$product.name$$" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertFirstProductNameTitle"/> <click selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="addFirstProductToWishlist"/> <!-- Switch to second store and add second product (visible on second store) to wishlist --> - <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="ClickSwitchStoreButtonOnDefaultStore"/> - <click selector="{{StorefrontFooterSection.storeLink($$storeGroup.group[name]$$)}}" stepKey="SelectSecondStoreToSwitchOn"/> + <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickSwitchStoreButtonOnDefaultStore"/> + <click selector="{{StorefrontFooterSection.storeLink($$storeGroup.group[name]$$)}}" stepKey="selectSecondStoreToSwitchOn"/> <!-- Verify that both products are visible in wishlist on both stores --> - <amOnPage url="$$secondProduct.name$$.html" stepKey="navigateToProductPageOnSecondStore"/> + <amOnPage url="{{StorefrontProductPage.url($$secondProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageOnSecondStore"/> <see userInput="$$secondProduct.name$$" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertSecondProductNameTitle"/> <click selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="addSecondProductToWishlist"/> <see userInput="$$secondProduct.name$$" selector="{{StorefrontCustomerWishlistSection.productItemNameText}}" stepKey="seeProduct2InWishlistOnSecondStore"/> - <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="ClickSwitchStoreButtonOnSecondStore"/> - <click selector="{{StorefrontFooterSection.storeLink('Main Website Store')}}" stepKey="SelectDefaultStoreToSwitchOn"/> + <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickSwitchStoreButtonOnSecondStore"/> + <click selector="{{StorefrontFooterSection.storeLink('Main Website Store')}}" stepKey="selectDefaultStoreToSwitchOn"/> <see userInput="$$product.name$$" selector="{{StorefrontCustomerWishlistSection.productItemNameText}}" stepKey="seeProduct1InWishlistOnDefaultStore"/> </test> </tests> From 2756bc970d160d30afe4315259067da7cb8c4fea Mon Sep 17 00:00:00 2001 From: Ryan Simmons <rsimmons@crimsonagility.com> Date: Thu, 11 Jul 2019 09:55:24 -0700 Subject: [PATCH 112/230] Fixes static test failure - removes unnecessary multiple line break --- .../frontend/web/js/model/billing-address-postcode-validator.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js index 863954add73b..2c1c21eea6ec 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js @@ -23,7 +23,6 @@ define([ validateZipCodeTimeout: 0, validateDelay: 2000, - /** * Perform postponed binding for fieldset elements * From e6ab6a5b6b1900155c6e23b3b95bf19697051b29 Mon Sep 17 00:00:00 2001 From: Ryan Simmons <rsimmons@crimsonagility.com> Date: Thu, 11 Jul 2019 10:31:44 -0700 Subject: [PATCH 113/230] Removes another unnecessary multiple line break --- .../frontend/web/js/model/billing-address-postcode-validator.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js index 2c1c21eea6ec..c2bf33ac6c57 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js @@ -18,7 +18,6 @@ define([ var postcodeElementName = 'postcode'; - return { validateZipCodeTimeout: 0, validateDelay: 2000, From 1c9df248b370ac67432c395e72846adf28c35eb2 Mon Sep 17 00:00:00 2001 From: Ryan Simmons <rsimmons@crimsonagility.com> Date: Thu, 11 Jul 2019 15:22:44 -0700 Subject: [PATCH 114/230] Fixes static test failure - removes trailing commas --- .../web/js/model/billing-address-postcode-validator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js index c2bf33ac6c57..4a4729211588 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js @@ -7,12 +7,12 @@ define([ 'jquery', 'Magento_Checkout/js/model/postcode-validator', 'mage/translate', - 'uiRegistry', + 'uiRegistry' ], function ( $, postcodeValidator, $t, - uiRegistry, + uiRegistry ) { 'use strict'; From a3c306161c5b3509970e38f4840cf983acb0c599 Mon Sep 17 00:00:00 2001 From: Ryan Simmons <rsimmons@crimsonagility.com> Date: Thu, 11 Jul 2019 16:38:34 -0700 Subject: [PATCH 115/230] Fixes static test failure - adds blank line after variable declaration --- .../frontend/web/js/model/billing-address-postcode-validator.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js index 4a4729211588..b101b67d26ba 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/billing-address-postcode-validator.js @@ -29,6 +29,7 @@ define([ */ initFields: function (formPath) { var self = this; + uiRegistry.async(formPath + '.' + postcodeElementName)(self.bindHandler.bind(self)); }, From 089e24a10d2ee8d527e5e65308d384a095127461 Mon Sep 17 00:00:00 2001 From: Andrea Parmeggiani <andrea.parmeggiani@santacleo.com> Date: Fri, 12 Jul 2019 17:02:06 +0200 Subject: [PATCH 116/230] Moved Zero Subtotal Checkout Payment Settings --- .../OfflinePayments/etc/adminhtml/system.xml | 35 ------------------- .../Magento/Payment/etc/adminhtml/system.xml | 35 +++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/app/code/Magento/OfflinePayments/etc/adminhtml/system.xml b/app/code/Magento/OfflinePayments/etc/adminhtml/system.xml index 89cc4d0986a0..01f041bcb68c 100644 --- a/app/code/Magento/OfflinePayments/etc/adminhtml/system.xml +++ b/app/code/Magento/OfflinePayments/etc/adminhtml/system.xml @@ -152,41 +152,6 @@ <label>Sort Order</label> </field> </group> - <group id="free" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1"> - <label>Zero Subtotal Checkout</label> - <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> - <label>Enabled</label> - <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> - </field> - <field id="order_status" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> - <label>New Order Status</label> - <source_model>Magento\Sales\Model\Config\Source\Order\Status\Newprocessing</source_model> - </field> - <field id="payment_action" translate="label" type="select" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> - <label>Automatically Invoice All Items</label> - <source_model>Magento\Payment\Model\Source\Invoice</source_model> - <depends> - <field id="order_status" separator=",">processing</field> - </depends> - </field> - <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> - <label>Sort Order</label> - <frontend_class>validate-number</frontend_class> - </field> - <field id="title" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> - <label>Title</label> - </field> - <field id="allowspecific" translate="label" type="allowspecific" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> - <label>Payment from Applicable Countries</label> - <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model> - </field> - <field id="specificcountry" translate="label" type="multiselect" sortOrder="51" showInDefault="1" showInWebsite="1" showInStore="0"> - <label>Payment from Specific Countries</label> - <source_model>Magento\Directory\Model\Config\Source\Country</source_model> - <can_be_empty>1</can_be_empty> - </field> - <field id="model"></field> - </group> </section> </system> </config> diff --git a/app/code/Magento/Payment/etc/adminhtml/system.xml b/app/code/Magento/Payment/etc/adminhtml/system.xml index 3aa4ee53b30f..d168dc13a397 100644 --- a/app/code/Magento/Payment/etc/adminhtml/system.xml +++ b/app/code/Magento/Payment/etc/adminhtml/system.xml @@ -11,6 +11,41 @@ <label>Payment Methods</label> <tab>sales</tab> <resource>Magento_Payment::payment</resource> + <group id="free" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1"> + <label>Zero Subtotal Checkout</label> + <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> + <label>Enabled</label> + <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> + </field> + <field id="order_status" translate="label" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> + <label>New Order Status</label> + <source_model>Magento\Sales\Model\Config\Source\Order\Status\Newprocessing</source_model> + </field> + <field id="payment_action" translate="label" type="select" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> + <label>Automatically Invoice All Items</label> + <source_model>Magento\Payment\Model\Source\Invoice</source_model> + <depends> + <field id="order_status" separator=",">processing</field> + </depends> + </field> + <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> + <label>Sort Order</label> + <frontend_class>validate-number</frontend_class> + </field> + <field id="title" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> + <label>Title</label> + </field> + <field id="allowspecific" translate="label" type="allowspecific" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1"> + <label>Payment from Applicable Countries</label> + <source_model>Magento\Payment\Model\Config\Source\Allspecificcountries</source_model> + </field> + <field id="specificcountry" translate="label" type="multiselect" sortOrder="51" showInDefault="1" showInWebsite="1" showInStore="0"> + <label>Payment from Specific Countries</label> + <source_model>Magento\Directory\Model\Config\Source\Country</source_model> + <can_be_empty>1</can_be_empty> + </field> + <field id="model"></field> + </group> </section> </system> </config> From 0773987e3074c9b4a121b8a3eddd9bac721922b5 Mon Sep 17 00:00:00 2001 From: Eden <quocviet312@gmail.com> Date: Fri, 12 Jul 2019 22:29:32 +0700 Subject: [PATCH 117/230] Resolve Frontend Label For Custom Order Status not Editable in Magento Admin in Single Store Mode #23654 --- .../Adminhtml/Order/Status/NewStatus/Form.php | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus/Form.php index 363c8cb22f25..c4d8907c9762 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/NewStatus/Form.php @@ -56,9 +56,7 @@ protected function _prepareForm() ['name' => 'label', 'label' => __('Status Label'), 'class' => 'required-entry', 'required' => true] ); - if (!$this->_storeManager->isSingleStoreMode()) { - $this->_addStoresFieldset($model, $form); - } + $this->_addStoresFieldset($model, $form); if ($model) { $form->addValues($model->getData()); @@ -80,10 +78,31 @@ protected function _prepareForm() protected function _addStoresFieldset($model, $form) { $labels = $model ? $model->getStoreLabels() : []; - $fieldset = $form->addFieldset( - 'store_labels_fieldset', - ['legend' => __('Store View Specific Labels'), 'class' => 'store-scope'] - ); + if (!$this->_storeManager->isSingleStoreMode()) { + $fieldset = $form->addFieldset( + 'store_labels_fieldset', + ['legend' => __('Store View Specific Labels'), 'class' => 'store-scope'] + ); + } else { + $fieldset = $form->addFieldset( + 'store_labels_fieldset', + ['legend' => __('Frontend Label')] + ); + $store = $this->_storeManager->getDefaultStoreView(); + $fieldset->addField( + "store_label_{$store->getId()}", + 'text', + [ + 'name' => 'store_labels[' . $store->getId() . ']', + 'required' => false, + 'label' => $store->getName(), + 'value' => isset($labels[$store->getId()]) ? $labels[$store->getId()] : '', + 'fieldset_html_class' => 'store' + ] + ); + return ; + } + $renderer = $this->getLayout()->createBlock( \Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset::class ); From aa3cef4041ed90cf032390e855e2388197bb3d0d Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Mon, 15 Jul 2019 16:11:41 +0530 Subject: [PATCH 118/230] MC-4555: Convert UpdateCustomerCustomAttributesEntityTest to MFTF Fixed locators --- .../Mftf/Section/CheckoutPaymentSection.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml index aac20e7ec4af..903c21d7ec0c 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml @@ -16,15 +16,15 @@ <element name="billingAddressNotSameCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-checkmo"/> <element name="editAddress" type="button" selector="button.action.action-edit-address"/> <element name="placeOrderDisabled" type="button" selector="#checkout-payment-method-load button.disabled"/> - <element name="update" type="button" selector=".payment-method-billing-address .action.action-update"/> - <element name="guestFirstName" type="input" selector=".billing-address-form input[name*='firstname']"/> - <element name="guestLastName" type="input" selector=".billing-address-form input[name*='lastname']"/> - <element name="guestStreet" type="input" selector=".billing-address-form input[name*='street[0]']"/> - <element name="guestCity" type="input" selector=".billing-address-form input[name*='city']"/> - <element name="guestCountry" type="select" selector=".billing-address-form select[name*='country_id']"/> - <element name="guestRegion" type="select" selector=".billing-address-form select[name*='region_id']"/> - <element name="guestPostcode" type="input" selector=".billing-address-form input[name*='postcode']"/> - <element name="guestTelephone" type="input" selector=".billing-address-form input[name*='telephone']"/> + <element name="update" type="button" selector=".payment-method._active .payment-method-billing-address .action.action-update"/> + <element name="guestFirstName" type="input" selector=".payment-method._active .billing-address-form input[name='firstname']"/> + <element name="guestLastName" type="input" selector=".payment-method._active .billing-address-form input[name*='lastname']"/> + <element name="guestStreet" type="input" selector=".payment-method._active .billing-address-form input[name*='street[0]']"/> + <element name="guestCity" type="input" selector=".payment-method._active .billing-address-form input[name*='city']"/> + <element name="guestCountry" type="select" selector=".payment-method._active .billing-address-form select[name*='country_id']"/> + <element name="guestRegion" type="select" selector=".payment-method._active .billing-address-form select[name*='region_id']"/> + <element name="guestPostcode" type="input" selector=".payment-method._active .billing-address-form input[name*='postcode']"/> + <element name="guestTelephone" type="input" selector=".payment-method._active .billing-address-form input[name*='telephone']"/> <element name="billingAddress" type="text" selector=".payment-method._active div.billing-address-details"/> <element name="cartItems" type="text" selector="ol.minicart-items"/> <element name="cartItemsArea" type="button" selector="div.block.items-in-cart"/> From 7c55d9a031112fbb5351fb50ffc8d7edcea39d34 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@gmail.com> Date: Tue, 16 Jul 2019 11:27:09 +0300 Subject: [PATCH 119/230] MC-16289: Buttons for Credentials don't show correctly for PayPal --- .../Magento_Paypal/web/css/source/_module.less | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less diff --git a/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less new file mode 100644 index 000000000000..26af8e829715 --- /dev/null +++ b/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less @@ -0,0 +1,11 @@ +// /** +// * Copyright © Magento, Inc. All rights reserved. +// * See COPYING.txt for license details. +// */ + +a { + &[data-paypal-button=true] { + display: inline-block; + margin: .6rem 0; + } +} From 8c6875b47003df960179918b09fe90d40baf1ae4 Mon Sep 17 00:00:00 2001 From: Dmitriy Kogut <kogut.dmitriy@gmail.com> Date: Tue, 16 Jul 2019 12:12:14 +0300 Subject: [PATCH 120/230] MC-3483: Admin should be able to associate simple product to websites --- .../ActionGroup/AdminProductActionGroup.xml | 15 ++++ ...undErrorOnProductDetailPageActionGroup.xml | 19 +++++ ...ductPageUsingStoreCodeInUrlActionGroup.xml | 18 ++++ ...ToAssociateSimpleProductToWebsitesTest.xml | 83 +++++++++++++++++++ 4 files changed, 135 insertions(+) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml index c1cb69373b00..83bb7841614d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml @@ -388,6 +388,14 @@ <waitForPageLoad stepKey="waitForSave"/> </actionGroup> + <!-- Action group assign to one website and unassign from another --> + <actionGroup name="AdminProcessProductWebsitesActionGroup" extends="CreatedProductConnectToWebsite"> + <arguments> + <argument name="websiteToUnassign"/> + </arguments> + <uncheckOption selector="{{ProductInWebsitesSection.website(websiteToUnassign.name)}}" after="SelectWebsite" stepKey="uncheckWebsite"/> + </actionGroup> + <!--Check tier price with a discount percentage on product--> <actionGroup name="AssertDiscountsPercentageOfProducts"> <arguments> @@ -538,4 +546,11 @@ <remove keyForRemoval="seeCheckboxForWebsite"/> <seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/> </actionGroup> + + <!-- You are on product Edit Page --> + <!-- Assert checkbox is not checked for website in Product In Websites --> + <actionGroup name="AssertProductIsNotAssignedToWebsite" extends="AssertWebsiteIsAvailableInProductWebsites"> + <remove keyForRemoval="seeCheckboxForWebsite"/> + <dontSeeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsNotChecked"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup.xml new file mode 100644 index 000000000000..1de5933c6969 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <!-- Assert 404 Page Not Found on product detail page --> + <actionGroup name="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup"> + <arguments> + <argument name="product"/> + </arguments> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="assert404Page"/> + <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product.name}}" stepKey="dontSeeProductName"/> + <seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkProductUrl"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup.xml new file mode 100644 index 000000000000..7c79a624d4d1 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <!-- Action group opens product detail page from second website using Store code in URL option --> + <actionGroup name="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup"> + <arguments> + <argument name="product"/> + <argument name="storeView"/> + </arguments> + <amOnPage url="/{{storeView.code}}/{{product.custom_attributes[url_key]}}.html" stepKey="openProductPageUsingStoreCodeInUrl"/> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product.name}}" stepKey="assertProductName"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml new file mode 100644 index 000000000000..061c30b22482 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest.xml @@ -0,0 +1,83 @@ +<?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="AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest"> + <annotations> + <features value="Catalog"/> + <stories value="Edit products"/> + <title value="Admin should be able to associate simple product to websites"/> + <description value="Admin should be able to associate simple product to websites"/> + <testCaseId value="MC-3483"/> + <group value="catalog"/> + <severity value="AVERAGE"/> + </annotations> + + <before> + <magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToYes"/> + <createData entity="secondCustomWebsite" stepKey="createCustomWebsite"/> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminStoreGroupCreateActionGroup" stepKey="createNewStore"> + <argument name="Website" value="secondCustomWebsite"/> + <argument name="storeGroup" value="customStoreGroup"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> + <argument name="StoreGroup" value="customStoreGroup"/> + <argument name="customStore" value="customStoreEN"/> + </actionGroup> + </before> + + <after> + <magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToNo"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <!-- Delete second website --> + <actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteCustomWeWebsite"> + <argument name="websiteName" value="$createCustomWebsite.website[name]$"/> + </actionGroup> + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetFiltersOnStoresIndexPage"/> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToResetFilters"/> + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- 1. Go to product page in admin panel to edit --> + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToAssociateToSecondWebsite"/> + <actionGroup ref="filterProductGridByName2" stepKey="filterProductInGrid"> + <argument name="name" value="$$createSimpleProduct.name$$"/> + </actionGroup> + + <!-- 2. Go to Product in Websites tab, unassign product from Main website and assign it to Second website --> + <actionGroup ref="AdminProcessProductWebsitesActionGroup" stepKey="processProductWebsites"> + <argument name="website" value="secondCustomWebsite"/> + <argument name="websiteToUnassign" value="_defaultWebsite"/> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> + <argument name="website" value="$createCustomWebsite.website[name]$"/> + </actionGroup> + <actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked"> + <argument name="website" value="{{_defaultWebsite.name}}"/> + </actionGroup> + + <!-- 3. Go to frontend and open Simple product on Main website and assert 404 page--> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> + <argument name="productUrl" value="$createSimpleProduct.custom_attributes[url_key]$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup" stepKey="assertPageNotFoundErrorOnProductDetailPage"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + + <!-- 4. Open Simple product on Second website and assert its name --> + <actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl"> + <argument name="product" value="$$createSimpleProduct$$"/> + <argument name="storeView" value="customStoreEN"/> + </actionGroup> + </test> +</tests> From d8fc77673812b635d7a6b93f12c2579324c86dd1 Mon Sep 17 00:00:00 2001 From: Nikita Fomin <nikita.fomin@transoftgroup.com> Date: Tue, 16 Jul 2019 12:41:23 +0300 Subject: [PATCH 121/230] MC-18053: [MTF] OnePageCheckoutJsValidationTestVariation1_0 randomly fails on jenkins --- .../Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.php | 2 +- .../Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.php index ff0038715bcb..276398265707 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.php @@ -17,7 +17,7 @@ * 5. Perform assertions. * * @group One_Page_Checkout - * @ZephyrId MAGETWO-59697 + * @ZephyrId MC-18203 */ class OnePageCheckoutJsValidationTest extends Scenario { diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml index 75603d12cbe3..c01f25a6066d 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutJsValidationTest.xml @@ -6,9 +6,8 @@ */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutJsValidationTest" summary="JS validation verification for Checkout flow" ticketId="MAGETWO-59697"> + <testCase name="Magento\Checkout\Test\TestCase\OnePageCheckoutJsValidationTest" summary="JS validation verification for Checkout flow" ticketId="MC-18203"> <variation name="OnePageCheckoutJsValidationTestVariation1" summary="JS validation is not applied for empty required checkout fields if customer did not fill them"> - <data name="issue" xsi:type="string">MAGETWO-97990: [MTF] OnePageCheckoutJsValidationTestVariation1_0 randomly fails on jenkins</data> <data name="tag" xsi:type="string">severity:S2</data> <data name="products/0" xsi:type="string">catalogProductSimple::default</data> <data name="checkoutMethod" xsi:type="string">guest</data> From 9a44da1e9b910d8c1c06f4af9e02b8db91e9ea7a Mon Sep 17 00:00:00 2001 From: Aliaksei Yakimovich2 <aliaksei_yakimovich2@epam.com> Date: Tue, 16 Jul 2019 13:01:45 +0300 Subject: [PATCH 122/230] MC-17218: php bin/magento catalog:image:resize error if image is missing - Fixed unit test; --- .../Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php b/app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php index 7fccfa04f86d..d612fb9e3b67 100644 --- a/app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php +++ b/app/code/Magento/MediaStorage/Test/Unit/Service/ImageResizeTest.php @@ -248,7 +248,7 @@ function () { $this->mediaDirectoryMock->expects($this->any()) ->method('isFile') ->with($this->testfilepath) - ->will($this->returnValue(false)); + ->will($this->returnValue(true)); $this->databaseMock->expects($this->once()) ->method('saveFileToFilesystem') From 2ebddee571bd221c5cbc4d5fc86ff772e013a959 Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@gmail.com> Date: Tue, 16 Jul 2019 13:07:06 +0300 Subject: [PATCH 123/230] MC-16289: Buttons for Credentials don't show correctly for PayPal --- .../backend/Magento_Paypal/web/css/source/_module.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less index 26af8e829715..365bb3e412ae 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less @@ -4,8 +4,8 @@ // */ a { - &[data-paypal-button=true] { - display: inline-block; - margin: .6rem 0; - } + &[data-paypal-button=true] { + display: inline-block; + margin: .6rem 0; + } } From f653ac894e3479188f354ce5a7e932f8694ad88d Mon Sep 17 00:00:00 2001 From: Vinai Kopp <vinai@netzarbeiter.com> Date: Tue, 16 Jul 2019 18:24:33 +0200 Subject: [PATCH 124/230] Declare @doc and @resolver directive These declarations remove a lot of warnings from the PHPStorm GraphQl plugin while editing schema.graphqls files. --- app/code/Magento/GraphQl/etc/schema.graphqls | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls index a3211c44a2ef..ab9b163a2165 100644 --- a/app/code/Magento/GraphQl/etc/schema.graphqls +++ b/app/code/Magento/GraphQl/etc/schema.graphqls @@ -1,6 +1,42 @@ # Copyright © Magento, Inc. All rights reserved. # See COPYING.txt for license details. +directive @doc(description: String="") on QUERY + | MUTATION + | FIELD + | FRAGMENT_DEFINITION + | FRAGMENT_SPREAD + | INLINE_FRAGMENT + | SCHEMA + | SCALAR + | OBJECT + | FIELD_DEFINITION + | ARGUMENT_DEFINITION + | INTERFACE + | UNION + | ENUM + | ENUM_VALUE + | INPUT_OBJECT + | INPUT_FIELD_DEFINITION + +directive @resolver(class: String="") on QUERY + | MUTATION + | FIELD + | FRAGMENT_DEFINITION + | FRAGMENT_SPREAD + | INLINE_FRAGMENT + | SCHEMA + | SCALAR + | OBJECT + | FIELD_DEFINITION + | ARGUMENT_DEFINITION + | INTERFACE + | UNION + | ENUM + | ENUM_VALUE + | INPUT_OBJECT + | INPUT_FIELD_DEFINITION + type Query { } From bcb41060be2738362def00dba9c76f4690b6199f Mon Sep 17 00:00:00 2001 From: Ievgenii Gryshkun <i.gryshkun@gmail.com> Date: Wed, 17 Jul 2019 10:29:08 +0300 Subject: [PATCH 125/230] customizable_options.values contains everything but value(s) --- app/code/Magento/QuoteGraphQl/etc/schema.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls index 0720e64c3d90..432afdc1250f 100644 --- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls +++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls @@ -314,7 +314,7 @@ type SelectedCustomizableOption { type SelectedCustomizableOptionValue { id: Int! label: String! - value: String @deprecated (reason: "The value field is deprecated. It was moved to CartItemSelectedOptionValuePrice.") + value: String! price: CartItemSelectedOptionValuePrice! } From a3c5c84b30dea65a9c2c325f23b04e9c722fb648 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Wed, 17 Jul 2019 10:40:25 +0300 Subject: [PATCH 126/230] graphQl-167: store config resolver test unmarked --- .../SetOfflineShippingMethodsOnCartTest.php | 4 +++- .../GraphQl/Store/StoreConfigResolverTest.php | 1 - ...able_offline_shipping_methods_rollback.php | 19 ------------------- 3 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods_rollback.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php index c6c4a18bce4a..153bfde158b5 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php @@ -43,8 +43,10 @@ protected function setUp() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php * @magentoApiDataFixture Magento/OfflineShipping/_files/tablerates_weight.php + * @@magentoConfigFixture carriers/flatrate/active 1 + * @@magentoConfigFixture carriers/tablerate/active 1 + * @@magentoConfigFixture carriers/freeshipping/active 1 * * @param string $carrierCode * @param string $methodCode diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php index a536022e3163..4657a1e763ae 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Store/StoreConfigResolverTest.php @@ -25,7 +25,6 @@ class StoreConfigResolverTest extends GraphQlAbstract protected function setUp() { - $this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/167'); $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); } diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods_rollback.php deleted file mode 100644 index 384ffbdf51f3..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods_rollback.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->create(WriterInterface::class); - -$configWriter->delete('carriers/flatrate/active'); -$configWriter->delete('carriers/tablerate/active'); -$configWriter->delete('carriers/freeshipping/active'); From f25f779c4a08b28c3ecdc5fdc197fc24ce206c8c Mon Sep 17 00:00:00 2001 From: Vinai Kopp <Vinai@users.noreply.github.com> Date: Wed, 17 Jul 2019 11:07:57 +0200 Subject: [PATCH 127/230] Add declaration for @typeResolver directive --- app/code/Magento/GraphQl/etc/schema.graphqls | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls index ab9b163a2165..c7f92a755144 100644 --- a/app/code/Magento/GraphQl/etc/schema.graphqls +++ b/app/code/Magento/GraphQl/etc/schema.graphqls @@ -36,6 +36,8 @@ directive @resolver(class: String="") on QUERY | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION + +directive @typeResolver(class: String="") on INTERFACE type Query { } From 301ebe7fa82fa6f3def30379dc18752b73158dcf Mon Sep 17 00:00:00 2001 From: Vinai Kopp <Vinai@users.noreply.github.com> Date: Wed, 17 Jul 2019 11:59:25 +0200 Subject: [PATCH 128/230] Work around bug in graphql-php The class `\GraphQL\Language\Parser` from the webonyx/graphql-php package throws an `Syntax Error: Unexpected Name "INTERFACE"` exception when the token `INTERFACE` comes last in the `DirectiveLocations` part of a directive declaration. Adding `OBJECT` as the last item removes the error. --- app/code/Magento/GraphQl/etc/schema.graphqls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls index c7f92a755144..2614f5c94b5f 100644 --- a/app/code/Magento/GraphQl/etc/schema.graphqls +++ b/app/code/Magento/GraphQl/etc/schema.graphqls @@ -37,7 +37,7 @@ directive @resolver(class: String="") on QUERY | INPUT_OBJECT | INPUT_FIELD_DEFINITION -directive @typeResolver(class: String="") on INTERFACE +directive @typeResolver(class: String="") on INTERFACE | OBJECT type Query { } From d72fde8288b2eacfc006bb3b8f1c1037e0d7af89 Mon Sep 17 00:00:00 2001 From: roettigl <l.roettig@techdivision.com> Date: Wed, 17 Jul 2019 10:13:34 +0200 Subject: [PATCH 129/230] MC-16192: Fixes for static test --- app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php | 1 + lib/internal/Magento/Framework/Session/SessionManager.php | 1 + 2 files changed, 2 insertions(+) diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index a070a8e66ee6..255f114b4666 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -22,6 +22,7 @@ * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) + * phpcs:disable Magento2.Exceptions.ThrowCatch - @todo MC-18221 need to fix check false positive * * @api * @since 100.0.2 diff --git a/lib/internal/Magento/Framework/Session/SessionManager.php b/lib/internal/Magento/Framework/Session/SessionManager.php index b96925facf52..1607eff64305 100644 --- a/lib/internal/Magento/Framework/Session/SessionManager.php +++ b/lib/internal/Magento/Framework/Session/SessionManager.php @@ -13,6 +13,7 @@ * Session Manager * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) + * phpcs:disable Magento2.Exceptions.ThrowCatch - @todo MC-18221 need to fix check false positive */ class SessionManager implements SessionManagerInterface { From 952a8268a4c79ec32d30085e41dbff12e845b3d7 Mon Sep 17 00:00:00 2001 From: roettigl <l.roettig@techdivision.com> Date: Wed, 17 Jul 2019 11:02:19 +0200 Subject: [PATCH 130/230] MC-18133: Zend Framework Update --- lib/internal/Magento/Framework/composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/composer.json b/lib/internal/Magento/Framework/composer.json index fcedfaf076aa..ed7e9f1cd1a1 100644 --- a/lib/internal/Magento/Framework/composer.json +++ b/lib/internal/Magento/Framework/composer.json @@ -24,7 +24,7 @@ "lib-libxml": "*", "colinmollenhour/php-redis-session-abstract": "~1.4.0", "composer/composer": "^1.6", - "magento/zendframework1": "~1.14.0", + "magento/zendframework1": "~1.14.2", "monolog/monolog": "^1.17", "wikimedia/less.php": "~1.8.0", "symfony/console": "~4.1.0", @@ -34,7 +34,7 @@ "zendframework/zend-crypt": "^2.6.0", "zendframework/zend-http": "^2.6.0", "zendframework/zend-mvc": "~2.7.0", - "zendframework/zend-stdlib": "^2.7.7", + "zendframework/zend-stdlib": "^3.2.1", "zendframework/zend-uri": "^2.5.1", "zendframework/zend-validator": "^2.6.0", "guzzlehttp/guzzle": "^6.3.3" From 46bcbc98faab64e47f4a5c4cc46f811e0408c35a Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@gmail.com> Date: Wed, 17 Jul 2019 15:23:10 +0300 Subject: [PATCH 131/230] MC-16289: Buttons for Credentials don't show correctly for PayPal --- .../Magento_Paypal/web/css/source/_module.less | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less index 365bb3e412ae..30f0bf00f429 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less @@ -3,9 +3,15 @@ // * See COPYING.txt for license details. // */ -a { - &[data-paypal-button=true] { - display: inline-block; - margin: .6rem 0; +.pp-buttons-container { + & > div { + margin-top: -2.2rem; + + a { + &[data-paypal-button=true] { + margin-top: 2.2rem; + display: inline-block; + } + } } } From 7fd9b523eb22babf898c0b8afd32b69492ec3dec Mon Sep 17 00:00:00 2001 From: OlgaVasyltsun <olga.vasyltsun@gmail.com> Date: Wed, 17 Jul 2019 15:58:49 +0300 Subject: [PATCH 132/230] MC-16289: Buttons for Credentials don't show correctly for PayPal --- .../Magento/backend/Magento_Paypal/web/css/source/_module.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less index 30f0bf00f429..b08edb89f466 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less +++ b/app/design/adminhtml/Magento/backend/Magento_Paypal/web/css/source/_module.less @@ -9,8 +9,8 @@ a { &[data-paypal-button=true] { - margin-top: 2.2rem; display: inline-block; + margin-top: 2.2rem; } } } From ea0a500426824537658c61d3cdbf8a77eeeb43bc Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi <v.vygovskyi@atwix.com> Date: Wed, 17 Jul 2019 16:16:31 +0300 Subject: [PATCH 133/230] graphQl-702 Added test coverage for Customer Downloadable Products --- .../CustomerDownloadableProductsTest.php | 153 ++++++++++++++++++ .../Catalog/_files/downloadable_product.php | 72 +++++++++ .../_files/downloadable_product_rollback.php | 31 ++++ .../Quote/_files/add_downloadable_product.php | 28 ++++ 4 files changed, 284 insertions(+) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_downloadable_product.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php new file mode 100644 index 000000000000..cdc7fd7b104b --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php @@ -0,0 +1,153 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\Downloadable; + +use Magento\Integration\Api\CustomerTokenServiceInterface; +use Magento\Quote\Api\CartManagementInterface; +use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\GraphQlAbstract; +use Magento\Quote\Model\QuoteFactory; + +/** + * Test retrieving of customer download products + */ +class CustomerDownloadableProductsTest extends GraphQlAbstract +{ + /** + * @var QuoteFactory + */ + protected $quoteFactory; + + /** + * @var QuoteResource + */ + protected $quoteResource; + + /** + * @var CustomerTokenServiceInterface + */ + private $customerTokenService; + + /** + * @var CartManagementInterface + */ + private $cartManagement; + + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/downloadable_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_downloadable_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php + */ + public function testCustomerDownloadableProducts() + { + $quote = $this->quoteFactory->create(); + $this->quoteResource->load($quote, 'test_quote', 'reserved_order_id'); + $this->cartManagement->placeOrder($quote->getId()); + + $query = $this->getQuery(); + $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap()); + + self::assertArrayHasKey('items', $response['customerDownloadableProducts']); + self::assertCount(1, $response['customerDownloadableProducts']['items']); + + self::assertArrayHasKey('date', $response['customerDownloadableProducts']['items'][0]); + self::assertNotEmpty($response['customerDownloadableProducts']['items'][0]['date']); + + self::assertArrayHasKey('download_url', $response['customerDownloadableProducts']['items'][0]); + self::assertNotEmpty($response['customerDownloadableProducts']['items'][0]['download_url']); + + self::assertArrayHasKey('order_increment_id', $response['customerDownloadableProducts']['items'][0]); + self::assertNotEmpty($response['customerDownloadableProducts']['items'][0]['order_increment_id']); + + self::assertArrayHasKey('remaining_downloads', $response['customerDownloadableProducts']['items'][0]); + self::assertNotEmpty($response['customerDownloadableProducts']['items'][0]['remaining_downloads']); + + self::assertArrayHasKey('status', $response['customerDownloadableProducts']['items'][0]); + self::assertNotEmpty($response['customerDownloadableProducts']['items'][0]['status']); + } + + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + */ + public function testCustomerHasNoOrders() + { + $query = $this->getQuery(); + $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap()); + + self::assertArrayHasKey('items', $response['customerDownloadableProducts']); + self::assertCount(0, $response['customerDownloadableProducts']['items']); + } + + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php + */ + public function testCustomerHasNoDownloadableProducts() + { + $query = $this->getQuery(); + $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap()); + + self::assertArrayHasKey('items', $response['customerDownloadableProducts']); + self::assertCount(0, $response['customerDownloadableProducts']['items']); + } + + /** + * @inheritdoc + */ + protected function setUp() + { + $objectManager = Bootstrap::getObjectManager(); + $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class); + $this->quoteFactory = $objectManager->get(QuoteFactory::class); + $this->quoteResource = $objectManager->get(QuoteResource::class); + $this->cartManagement = $objectManager->get(CartManagementInterface::class); + } + + /** + * @return string + */ + private function getQuery(): string + { + return <<<QUERY +{ + customerDownloadableProducts { + items { + date + download_url + order_increment_id + remaining_downloads + status + } + } +} +QUERY; + } + + /** + * @param string $username + * @param string $password + * @return array + * @throws \Magento\Framework\Exception\AuthenticationException + */ + private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array + { + $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password); + $headerMap = ['Authorization' => 'Bearer ' . $customerToken]; + return $headerMap; + } +} diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php new file mode 100644 index 000000000000..62667959cd11 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php @@ -0,0 +1,72 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\Data\ProductInterfaceFactory; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Downloadable\Model\Product\Type; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Framework\Api\DataObjectHelper; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Downloadable\Api\Data\LinkInterfaceFactory; +use Magento\Downloadable\Api\Data\LinkInterface; +use Magento\Downloadable\Model\Link; +use Magento\Downloadable\Helper\Download; +use Magento\Framework\Api\ExtensionAttributesFactory; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductInterfaceFactory $productFactory */ +$productFactory = $objectManager->get(ProductInterfaceFactory::class); +/** @var DataObjectHelper $dataObjectHelper */ +$dataObjectHelper = Bootstrap::getObjectManager()->get(DataObjectHelper::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var LinkInterfaceFactory $linkFactory */ +$linkFactory = $objectManager->get(LinkInterfaceFactory::class); +/** @var ExtensionAttributesFactory $extensionAttributesFactory */ +$extensionAttributesFactory = $objectManager->get(ExtensionAttributesFactory::class); + +$link = $linkFactory->create(); +$linkData = [ + LINK::KEY_TITLE => 'Downloadable Product Link', + LINK::KEY_LINK_TYPE => Download::LINK_TYPE_URL, + LINK::KEY_IS_SHAREABLE => Link::LINK_SHAREABLE_CONFIG, + LINK::KEY_LINK_URL => 'http://example.com/downloadable.txt', + LINK::KEY_PRICE => 0, + LINK::KEY_NUMBER_OF_DOWNLOADS => 0, + LINK::KEY_SORT_ORDER => 1, +]; + +$dataObjectHelper->populateWithArray($link, $linkData, LinkInterface::class); +$extensionAttributes = $extensionAttributesFactory->create(ProductInterface::class); +$extensionAttributes->setDownloadableProductLinks([$link]); + +$product = $productFactory->create(); +$productData = [ + ProductInterface::TYPE_ID => Type::TYPE_DOWNLOADABLE, + ProductInterface::ATTRIBUTE_SET_ID => 4, + ProductInterface::SKU => 'downloadable_product', + ProductInterface::NAME => 'Downloadable Product', + ProductInterface::PRICE => 10, + ProductInterface::VISIBILITY => Visibility::VISIBILITY_BOTH, + ProductInterface::STATUS => Status::STATUS_ENABLED, + ProductInterface::EXTENSION_ATTRIBUTES_KEY => $extensionAttributes +]; + +$dataObjectHelper->populateWithArray($product, $productData, ProductInterface::class); +/** Out of interface */ +$product + ->setWebsiteIds([1]) + ->setStockData([ + 'qty' => 85.5, + 'is_in_stock' => true, + 'manage_stock' => true, + 'is_qty_decimal' => true + ]); + +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product_rollback.php new file mode 100644 index 000000000000..ddb897340b34 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product_rollback.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); + +$currentArea = $registry->registry('isSecureArea'); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +try { + $productRepository->deleteById('downloadable_product'); +} catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + /** + * Tests which are wrapped with MySQL transaction clear all data by transaction rollback. + */ +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', $currentArea); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_downloadable_product.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_downloadable_product.php new file mode 100644 index 000000000000..9e18720424f5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_downloadable_product.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Quote\Api\CartRepositoryInterface; +use Magento\Quote\Model\QuoteFactory; +use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; +use Magento\TestFramework\Helper\Bootstrap; + +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); +/** @var QuoteFactory $quoteFactory */ +$quoteFactory = Bootstrap::getObjectManager()->get(QuoteFactory::class); +/** @var QuoteResource $quoteResource */ +$quoteResource = Bootstrap::getObjectManager()->get(QuoteResource::class); +/** @var CartRepositoryInterface $cartRepository */ +$cartRepository = Bootstrap::getObjectManager()->get(CartRepositoryInterface::class); + +$product = $productRepository->get('downloadable_product'); + +$quote = $quoteFactory->create(); +$quoteResource->load($quote, 'test_quote', 'reserved_order_id'); +$quote->addProduct($product, 1); +$cartRepository->save($quote); From fdf6de7d9864797c56f91a6ac8bd690a1742c33f Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Wed, 17 Jul 2019 16:26:20 +0300 Subject: [PATCH 134/230] MC-18227: [FT] [MFTF] CheckProductPriceInCatalogAfterSortingTest fails because of bad design --- .../Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml | 3 +++ ...gNewOptionsWithImagesAndPricesToConfigurableProductTest.xml | 1 + .../Test/Mftf/Test/AdminConfigurableProductCreateTest.xml | 1 + .../Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml | 1 + .../Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml | 1 + 5 files changed, 7 insertions(+) diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml index 5efc6e5601b5..5e222d511234 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminConfigurableProductActionGroup.xml @@ -79,6 +79,7 @@ <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> <fillField userInput="{{colorProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> @@ -133,6 +134,7 @@ <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> <fillField userInput="{{firstOptionName}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> @@ -213,6 +215,7 @@ <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateFirstNewValue"/> <fillField userInput="{{firstOption.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewFirstOption"/> <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml index 52443a17dfe6..a9d2f1c3379d 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAddingNewOptionsWithImagesAndPricesToConfigurableProductTest.xml @@ -46,6 +46,7 @@ <seeElement selector="{{AdminProductFormConfigurationsSection.attributeEntityByName($$createConfigProductAttributeCreateConfigurableProduct.default_frontend_label$$)}}" stepKey="seeAttribute"/> <!--Create one color option via "Create New Value" link--> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue"/> <fillField userInput="{{colorDefaultProductAttribute1.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute"/> <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml index 2af85e1bac04..9021bf981ac1 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml @@ -104,6 +104,7 @@ <click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> <click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> <fillField userInput="{{colorProductAttribute2.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml index 001d4d17ec21..00ffe70380d1 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateAttributeTest.xml @@ -239,6 +239,7 @@ <click stepKey="clickEditConfig" selector="{{AdminProductFormConfigurationsSection.createConfigurations}}"/> <waitForPageLoad stepKey="waitForEditConfig"/> <click stepKey="clickNextWizard" selector="{{AdminCreateProductConfigurationsPanel.next}}"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> <click stepKey="createNewValue" selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}"/> <fillField stepKey="fillNewAttribute" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" userInput="simple"/> <click stepKey="confirmNewAttribute" selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml index 1791fc002ab9..3a6a20de3ed9 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductUpdateTest.xml @@ -343,6 +343,7 @@ <!-- Add a configuration option to the configurable product --> <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickEditConfigurations"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> + <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="waitCreateNewValueAppears"/> <click selector="{{AdminCreateProductConfigurationsPanel.createNewValue}}" stepKey="clickOnCreateNewValue1"/> <fillField userInput="{{colorProductAttribute4.name}}" selector="{{AdminCreateProductConfigurationsPanel.attributeName}}" stepKey="fillFieldForNewAttribute1"/> <click selector="{{AdminCreateProductConfigurationsPanel.saveAttribute}}" stepKey="clickOnSaveNewAttribute1"/> From e5e6b48d9955a5487b7f5d0d2f0b4eb5640d8683 Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Wed, 17 Jul 2019 15:49:27 +0200 Subject: [PATCH 135/230] MC-16192: Fixes for static test --- app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php | 5 ++++- lib/internal/Magento/Framework/Session/SessionManager.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index 255f114b4666..5da21e8a59e8 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -22,7 +22,6 @@ * @SuppressWarnings(PHPMD.TooManyFields) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) - * phpcs:disable Magento2.Exceptions.ThrowCatch - @todo MC-18221 need to fix check false positive * * @api * @since 100.0.2 @@ -448,6 +447,8 @@ public function createDirectory($name, $path) 'id' => $this->_cmsWysiwygImages->convertPathToId($newPath), ]; return $result; + // @todo MC-18221 need to fix check false positive + // phpcs:ignore Magento2.Exceptions.ThrowCatch } catch (\Magento\Framework\Exception\FileSystemException $e) { throw new \Magento\Framework\Exception\LocalizedException(__('We cannot create a new directory.')); } @@ -469,6 +470,8 @@ public function deleteDirectory($path) $this->_deleteByPath($path); $path = $this->getThumbnailRoot() . $this->_getRelativePathToRoot($path); $this->_deleteByPath($path); + // @todo MC-18221 need to fix check false positive + // phpcs:ignore Magento2.Exceptions.ThrowCatch } catch (\Magento\Framework\Exception\FileSystemException $e) { throw new \Magento\Framework\Exception\LocalizedException(__('We cannot delete directory %1.', $path)); } diff --git a/lib/internal/Magento/Framework/Session/SessionManager.php b/lib/internal/Magento/Framework/Session/SessionManager.php index 1607eff64305..a6f8d7b86bf9 100644 --- a/lib/internal/Magento/Framework/Session/SessionManager.php +++ b/lib/internal/Magento/Framework/Session/SessionManager.php @@ -13,7 +13,6 @@ * Session Manager * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.CookieAndSessionMisuse) - * phpcs:disable Magento2.Exceptions.ThrowCatch - @todo MC-18221 need to fix check false positive */ class SessionManager implements SessionManagerInterface { @@ -184,6 +183,8 @@ public function start() try { $this->appState->getAreaCode(); + // @todo MC-18221 need to fix check false positive + // phpcs:ignore Magento2.Exceptions.ThrowCatch } catch (\Magento\Framework\Exception\LocalizedException $e) { throw new \Magento\Framework\Exception\SessionException( new \Magento\Framework\Phrase( From f3c387f8448351943584115ff62d9dd992bf16fd Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi <v.vygovskyi@atwix.com> Date: Wed, 17 Jul 2019 17:34:06 +0300 Subject: [PATCH 136/230] Fixed static tests warning --- .../Magento/GraphQl/Catalog/_files/downloadable_product.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php index 62667959cd11..e18a19c423ab 100644 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php @@ -62,11 +62,13 @@ /** Out of interface */ $product ->setWebsiteIds([1]) - ->setStockData([ + ->setStockData( + [ 'qty' => 85.5, 'is_in_stock' => true, 'manage_stock' => true, 'is_qty_decimal' => true - ]); + ] + ); $productRepository->save($product); From 02eeee25f6898cc0fa24b7fb762bbab4cdf769c6 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Wed, 17 Jul 2019 17:41:59 +0300 Subject: [PATCH 137/230] graphQl-167: removed all TODO's, implemented deleting configs from the database --- .../Annotation/ApiConfigFixture.php | 165 ++++++++++++++++++ .../Bootstrap/WebapiDocBlock.php | 11 +- .../GraphQl/Catalog/StoreConfigTest.php | 25 ++- .../CatalogInventory/AddProductToCartTest.php | 4 +- .../GetCheckoutAgreementsTest.php | 90 +--------- .../ConfigurableProductStockStatusTest.php | 2 - .../GetAvailablePaymentMethodsTest.php | 4 +- .../GetAvailableShippingMethodsTest.php | 4 +- .../Customer/GetSelectedPaymentMethodTest.php | 18 +- .../GraphQl/Quote/Customer/PlaceOrderTest.php | 42 ++++- .../SetOfflinePaymentMethodsOnCartTest.php | 12 +- .../SetOfflineShippingMethodsOnCartTest.php | 6 +- .../Customer/SetPaymentMethodOnCartTest.php | 6 +- ...etPurchaseOrderPaymentMethodOnCartTest.php | 12 +- .../Customer/SetShippingMethodsOnCartTest.php | 8 +- .../Guest/AllowGuestCheckoutOptionTest.php | 17 +- .../Guest/GetAvailablePaymentMethodsTest.php | 4 +- .../Guest/GetAvailableShippingMethodsTest.php | 4 +- .../Guest/GetSelectedPaymentMethodTest.php | 18 +- .../GraphQl/Quote/Guest/PlaceOrderTest.php | 42 ++++- .../SetOfflinePaymentMethodsOnCartTest.php | 12 +- .../SetOfflineShippingMethodsOnCartTest.php | 4 +- .../SetPaymentMethodAndPlaceOrderTest.php | 10 +- .../Guest/SetPaymentMethodOnCartTest.php | 6 +- ...etPurchaseOrderPaymentMethodOnCartTest.php | 12 +- .../Guest/SetShippingMethodsOnCartTest.php | 8 +- .../GraphQl/SendFriend/SendFriendTest.php | 20 +-- .../Ups/SetUpsShippingMethodsOnCartTest.php | 6 +- .../enable_customer_account_confirmation.php | 22 --- ...customer_account_confirmation_rollback.php | 17 -- .../disable_all_active_payment_methods.php | 35 ---- ...le_all_active_payment_methods_rollback.php | 34 ---- .../Quote/_files/disable_guest_checkout.php | 21 --- .../disable_guest_checkout_rollback.php | 17 -- .../disable_offline_shipping_methods.php | 23 --- ...able_offline_shipping_methods_rollback.php | 19 -- .../_files/enable_offline_payment_methods.php | 25 --- ...nable_offline_payment_methods_rollback.php | 21 --- .../enable_offline_shipping_methods.php | 23 --- .../_files/disable_send_friend_guest.php | 21 --- .../_files/enable_send_friend_guest.php | 21 --- .../Ups/_files/enable_ups_shipping_method.php | 22 --- .../enable_ups_shipping_method_rollback.php | 18 -- 43 files changed, 405 insertions(+), 506 deletions(-) create mode 100644 dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Customer/_files/enable_customer_account_confirmation.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Customer/_files/enable_customer_account_confirmation_rollback.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods_rollback.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout_rollback.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods_rollback.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods_rollback.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/SendFriend/_files/disable_send_friend_guest.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/SendFriend/_files/enable_send_friend_guest.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method_rollback.php diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php new file mode 100644 index 000000000000..9c5b52ed181b --- /dev/null +++ b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php @@ -0,0 +1,165 @@ +<?php +/** + * Copyright (c) 2019 TechDivision GmbH + * All rights reserved + * + * This product includes proprietary software developed at TechDivision GmbH, Germany + * For more information see https://www.techdivision.com/ + * + * To obtain a valid license for using this software please contact us at + * license@techdivision.com + */ +declare(strict_types=1); + +namespace Magento\TestFramework\Annotation; + +use Magento\Config\Model\Config; +use Magento\Config\Model\ResourceModel\Config as ConfigResource; +use Magento\Config\Model\ResourceModel\Config\Data\CollectionFactory; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Store\Model\StoreManagerInterface; +use PHPUnit\Framework\TestCase; + +/** + * @inheritDoc + */ +class ApiConfigFixture extends ConfigFixture +{ + /** + * Original values for global configuration options that need to be restored + * + * @var array + */ + private $_globalConfigValues = []; + + /** + * Original values for store-scoped configuration options that need to be restored + * + * @var array + */ + private $_storeConfigValues = []; + + /** + * Values need to be deleted form the database + * + * @var array + */ + private $_valuesToDeleteFromDatabase = []; + + /** + * Assign required config values and save original ones + * + * @param TestCase $test + * @SuppressWarnings(PHPMD.UnusedLocalVariable) + */ + protected function _assignConfigData(TestCase $test) + { + $annotations = $test->getAnnotations(); + if (!isset($annotations['method'][$this->annotation])) { + return; + } + foreach ($annotations['method'][$this->annotation] as $configPathAndValue) { + if (preg_match('/^.+?(?=_store\s)/', $configPathAndValue, $matches)) { + /* Store-scoped config value */ + $storeCode = $matches[0] != 'current' ? $matches[0] : null; + $parts = preg_split('/\s+/', $configPathAndValue, 3); + list($configScope, $configPath, $requiredValue) = $parts + ['', '', '']; + $originalValue = $this->_getConfigValue($configPath, $storeCode); + $this->_storeConfigValues[$storeCode][$configPath] = $originalValue; + if ($this->checkIfValueExist($configPath, $storeCode)) { + $this->_valuesToDeleteFromDatabase[$storeCode][$configPath] = $requiredValue; + } + $this->_setConfigValue($configPath, $requiredValue, $storeCode); + } else { + /* Global config value */ + list($configPath, $requiredValue) = preg_split('/\s+/', $configPathAndValue, 2); + + $originalValue = $this->_getConfigValue($configPath); + $this->_globalConfigValues[$configPath] = $originalValue; + if ($this->checkIfValueExist($configPath)) { + $this->_valuesToDeleteFromDatabase['global'][$configPath] = $requiredValue; + } + + $this->_setConfigValue($configPath, $requiredValue); + } + } + } + + /** + * Restore original values for changed config options + */ + protected function _restoreConfigData() + { + $configResource = Bootstrap::getObjectManager()->get(ConfigResource::class); + + /* Restore global values */ + foreach ($this->_globalConfigValues as $configPath => $originalValue) { + if (isset($this->_valuesToDeleteFromDatabase['global'][$configPath])) { + $configResource->deleteConfig($configPath); + } else { + $this->_setConfigValue($configPath, $originalValue); + } + } + $this->_globalConfigValues = []; + + /* Restore store-scoped values */ + foreach ($this->_storeConfigValues as $storeCode => $originalData) { + foreach ($originalData as $configPath => $originalValue) { + if (empty($storeCode)) { + $storeCode = null; + } + if (isset($this->_valuesToDeleteFromDatabase[$storeCode][$configPath])) { + $scopeId = $this->getStoreIdByCode($storeCode); + $configResource->deleteConfig($configPath, 'stores', $scopeId); + } else { + $this->_setConfigValue($configPath, $originalValue, $storeCode); + } + } + } + $this->_storeConfigValues = []; + } + + /** + * Load configs by path and scope + * + * @param string $configPath + * @param string $storeCode + * @return Config[] + */ + private function loadConfigs(string $configPath, string $storeCode = null): array + { + $configCollectionFactory = Bootstrap::getObjectManager()->get(CollectionFactory::class); + $collection = $configCollectionFactory->create(); + $scope = $storeCode ? 'stores' : 'default'; + $scopeId = $storeCode ? $this->getStoreIdByCode($storeCode) : 0; + + $collection->addScopeFilter($scope, $scopeId, $configPath); + return $collection->getItems(); + } + + /** + * Check if config exist in the database + * + * @param string $configPath + * @param $originalValue + * @param string|null $storeCode + */ + private function checkIfValueExist(string $configPath, string $storeCode = null): bool + { + $configs = $this->loadConfigs($configPath, $storeCode); + + return !(bool)$configs; + } + + /** + * Returns the store ID by the store code + * @param string $storeCode + * @return int + */ + private function getStoreIdByCode(string $storeCode): int + { + $storeManager = Bootstrap::getObjectManager()->get(StoreManagerInterface::class); + $store = $storeManager->getStore($storeCode); + return (int)$store->getId(); + } +} diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php b/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php index bd26c1e640e9..a3a013ae812a 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php @@ -7,6 +7,7 @@ */ namespace Magento\TestFramework\Bootstrap; +use Magento\TestFramework\Annotation\ApiConfigFixture; use Magento\TestFramework\Annotation\ConfigFixture; /** @@ -17,7 +18,7 @@ class WebapiDocBlock extends \Magento\TestFramework\Bootstrap\DocBlock /** * Get list of subscribers. * - * In addition, register magentoApiDataFixture and magentoApiConfigFixture + * In addition, register magentoApiDataFixture and magentoConfigFixture * annotation processors * * @param \Magento\TestFramework\Application $application @@ -26,8 +27,14 @@ class WebapiDocBlock extends \Magento\TestFramework\Bootstrap\DocBlock protected function _getSubscribers(\Magento\TestFramework\Application $application) { $subscribers = parent::_getSubscribers($application); + foreach ($subscribers as $key => $subscriber) { + if (get_class($subscriber) == ConfigFixture::class) { + unset($subscribers[$key]); + } + } $subscribers[] = new \Magento\TestFramework\Annotation\ApiDataFixture($this->_fixturesBaseDir); - $subscribers[] = new ConfigFixture(); + $subscribers[] = new ApiConfigFixture(); + return $subscribers; } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php index 2672431dbb56..02e53d141108 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php @@ -14,13 +14,17 @@ */ class StoreConfigTest extends GraphQlAbstract { - protected function setUp() - { - $this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/167'); - } - /** * @magentoApiDataFixture Magento/Store/_files/store.php + * @magentoConfigFixture default_store catalog/seo/product_url_suffix test_product_suffix + * @magentoConfigFixture default_store catalog/seo/category_url_suffix test_category_suffix + * @magentoConfigFixture default_store catalog/seo/title_separator ___ + * @magentoConfigFixture default_store catalog/frontend/list_mode 2 + * @magentoConfigFixture default_store catalog/frontend/grid_per_page_values 16 + * @magentoConfigFixture default_store catalog/frontend/list_per_page_values 8 + * @magentoConfigFixture default_store catalog/frontend/grid_per_page 16 + * @magentoConfigFixture default_store catalog/frontend/list_per_page 8 + * @magentoConfigFixture default_store catalog/frontend/default_sort_by asc */ public function testGetStoreConfig() { @@ -43,6 +47,15 @@ public function testGetStoreConfig() $response = $this->graphQlQuery($query); $this->assertArrayHasKey('storeConfig', $response); - //TODO: provide assertions after unmarking test as incomplete + $this->assertEquals('test_product_suffix', $response['storeConfig']['product_url_suffix']); + $this->assertEquals('test_category_suffix', $response['storeConfig']['category_url_suffix']); + $this->assertEquals('___', $response['storeConfig']['title_separator']); + $this->assertEquals('2', $response['storeConfig']['list_mode']); + $this->assertEquals('16', $response['storeConfig']['grid_per_page_values']); + $this->assertEquals(16, $response['storeConfig']['grid_per_page']); + $this->assertEquals('8', $response['storeConfig']['list_per_page_values']); + $this->assertEquals(8, $response['storeConfig']['list_per_page']); + $this->assertEquals('asc', $response['storeConfig']['catalog_default_sort_by']); } } + diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php index 6ed0f6ef7a13..f71ec9ad8521 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php @@ -49,14 +49,12 @@ public function testAddProductIfQuantityIsNotAvailable() /** * @magentoApiDataFixture Magento/Catalog/_files/products.php * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php - * @magentoConfigFixture default cataloginventory/item_options/max_sale_qty 5 + * @magentoConfigFixture default_store cataloginventory/item_options/max_sale_qty 5 * @expectedException \Exception * @expectedExceptionMessage The most you may purchase is 5. */ public function testAddMoreProductsThatAllowed() { - $this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/167'); - $sku = 'custom-design-simple-product'; $quantity = 7; $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1'); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CheckoutAgreements/GetCheckoutAgreementsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CheckoutAgreements/GetCheckoutAgreementsTest.php index 3aa01d799422..fd5b84fd294e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CheckoutAgreements/GetCheckoutAgreementsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CheckoutAgreements/GetCheckoutAgreementsTest.php @@ -11,13 +11,8 @@ use Magento\CheckoutAgreements\Model\Agreement as AgreementModel; use Magento\CheckoutAgreements\Model\AgreementFactory; use Magento\CheckoutAgreements\Model\ResourceModel\Agreement; -use Magento\Config\Model\ResourceModel\Config; -use Magento\Framework\App\Config\ReinitableConfigInterface; -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\ObjectManagerInterface; -use Magento\Store\Api\Data\StoreInterface; +use Magento\Framework\App\ObjectManager; use Magento\Store\Model\StoreManagerInterface; -use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; /** @@ -25,35 +20,10 @@ */ class GetCheckoutAgreementsTest extends GraphQlAbstract { - /** - * @var string - */ - private $agreementsXmlConfigPath = 'checkout/options/enable_agreements'; - - /** - * @var ObjectManagerInterface - */ - private $objectManager; - - /** - * @var Config - */ - private $config; - - protected function setUp() - { - parent::setUp(); - - $this->objectManager = Bootstrap::getObjectManager(); - - // TODO: remove usage of the Config, use ConfigFixture instead https://github.com/magento/graphql-ce/issues/167 - $this->config = $this->objectManager->get(Config::class); - $this->saveAgreementConfig(1); - } - /** * @magentoApiDataFixture Magento/CheckoutAgreements/_files/agreement_active_with_html_content.php * @magentoApiDataFixture Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content.php + * @magentoConfigFixture default_store checkout/options/enable_agreements 1 */ public function testGetActiveAgreement() { @@ -76,6 +46,7 @@ public function testGetActiveAgreement() * @magentoApiDataFixture Magento/CheckoutAgreements/_files/agreement_active_with_html_content.php * @magentoApiDataFixture Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content.php * @magentoApiDataFixture Magento/Store/_files/second_store.php + * @magentoConfigFixture fixture_second_store_store checkout/options/enable_agreements 1 */ public function testGetActiveAgreementOnSecondStore() { @@ -103,6 +74,7 @@ public function testGetActiveAgreementOnSecondStore() * @magentoApiDataFixture Magento/CheckoutAgreements/_files/agreement_active_with_html_content.php * @magentoApiDataFixture Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content.php * @magentoApiDataFixture Magento/Store/_files/second_store.php + * @magentoConfigFixture fixture_second_store_store checkout/options/enable_agreements 1 */ public function testGetActiveAgreementFromSecondStoreOnDefaultStore() { @@ -133,11 +105,11 @@ public function testGetAgreementNotSet() /** * @magentoApiDataFixture Magento/CheckoutAgreements/_files/agreement_active_with_html_content.php * @magentoApiDataFixture Magento/CheckoutAgreements/_files/agreement_inactive_with_text_content.php + * @magentoConfigFixture default_store checkout/options/enable_agreements 0 */ public function testDisabledAgreements() { $query = $this->getQuery(); - $this->saveAgreementConfig(0); $response = $this->graphQlQuery($query); @@ -174,11 +146,11 @@ private function getQuery(): string */ private function assignAgreementsToStore(string $storeCode, string $agreementsName): void { - $agreementsFactory = $this->objectManager->get(AgreementFactory::class); + $agreementsFactory = ObjectManager::getInstance()->get(AgreementFactory::class); /** @var Agreement $agreementsResource */ - $agreementsResource = $this->objectManager->get(Agreement::class); + $agreementsResource = ObjectManager::getInstance()->get(Agreement::class); /** @var StoreManagerInterface $storeManager */ - $storeManager = $this->objectManager->get(StoreManagerInterface::class); + $storeManager = ObjectManager::getInstance()->get(StoreManagerInterface::class); $store = $storeManager->getStore($storeCode); /** @var AgreementModel $agreements */ $agreements = $agreementsFactory->create(); @@ -186,50 +158,4 @@ private function assignAgreementsToStore(string $storeCode, string $agreementsNa $agreements->setData('stores', [$store->getId()]); $agreementsResource->save($agreements); } - - protected function tearDown() - { - parent::tearDown(); - - $this->deleteAgreementConfig(); - } - - /** - * @param int $value - * @param StoreInterface $store - */ - private function saveAgreementConfig(int $value): void - { - $this->config->saveConfig( - $this->agreementsXmlConfigPath, - $value, - ScopeConfigInterface::SCOPE_TYPE_DEFAULT, - 0 - ); - - $this->reinitConfig(); - } - - /** - * Delete config - * - * @return void - */ - private function deleteAgreementConfig(): void - { - $this->config->deleteConfig( - $this->agreementsXmlConfigPath, - ScopeConfigInterface::SCOPE_TYPE_DEFAULT, - 0 - ); - - $this->reinitConfig(); - } - - private function reinitConfig(): void - { - /** @var ReinitableConfigInterface $config */ - $config = $this->objectManager->get(ReinitableConfigInterface::class); - $config->reinit(); - } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductStockStatusTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductStockStatusTest.php index 2826d61022c7..f37de6e8bb91 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductStockStatusTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductStockStatusTest.php @@ -35,7 +35,6 @@ protected function setUp() */ public function testConfigurableProductShowOutOfStock() { - $this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/167'); $parentSku = 'configurable'; $childSkuOutOfStock = 'simple_1010'; $stockItem = $this->stockRegistry->getStockItemBySku($childSkuOutOfStock); @@ -55,7 +54,6 @@ public function testConfigurableProductShowOutOfStock() */ public function testConfigurableProductDoNotShowOutOfStock() { - $this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/167'); $parentSku = 'configurable'; $childSkuOutOfStock = 'simple_1010'; $stockItem = $this->stockRegistry->getStockItemBySku($childSkuOutOfStock); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailablePaymentMethodsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailablePaymentMethodsTest.php index 673d49630266..9baa3543b6a3 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailablePaymentMethodsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailablePaymentMethodsTest.php @@ -101,7 +101,9 @@ public function testGetAvailablePaymentMethodsFromAnotherCustomerCart() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php + * @magentoConfigFixture default_store payment/paypal_billing_agreement/active 0 + * @magentoConfigFixture default_store payment/checkmo/active 0 + * @magentoConfigFixture default_store payment/free/active 0 */ public function testGetAvailablePaymentMethodsIfPaymentsAreNotPresent() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailableShippingMethodsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailableShippingMethodsTest.php index b01921ae67ed..02c22a0e902b 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailableShippingMethodsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailableShippingMethodsTest.php @@ -134,7 +134,9 @@ public function testGetAvailableShippingMethodsFromAnotherCustomerCart() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 0 + * @magentoConfigFixture default_store carriers/tablerate/active 0 + * @magentoConfigFixture default_store carriers/freeshipping/active 0 */ public function testGetAvailableShippingMethodsIfShippingMethodsAreNotPresent() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedPaymentMethodTest.php index 4432a233e96e..74a311932991 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetSelectedPaymentMethodTest.php @@ -30,7 +30,11 @@ class GetSelectedPaymentMethodTest extends GraphQlAbstract /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php @@ -52,7 +56,11 @@ public function testGetSelectedPaymentMethod() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php @@ -91,7 +99,11 @@ public function testGetSelectedPaymentMethodFromNonExistentCart() * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php index 591bac1c35ba..cb471d8f0f93 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/PlaceOrderTest.php @@ -62,8 +62,14 @@ protected function setUp() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php @@ -174,7 +180,9 @@ public function testPlaceOrderWithNoShippingMethod() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php @@ -195,7 +203,9 @@ public function testPlaceOrderWithNoBillingAddress() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php @@ -215,7 +225,9 @@ public function testPlaceOrderWithNoPaymentMethod() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php @@ -237,8 +249,14 @@ public function testPlaceOrderWithOutOfStockProduct() * _security * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php @@ -260,8 +278,14 @@ public function testPlaceOrderOfGuestCart() * _security * @magentoApiDataFixture Magento/Customer/_files/three_customers.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflinePaymentMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflinePaymentMethodsOnCartTest.php index 0fe7aec2d634..138d27ef2648 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflinePaymentMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflinePaymentMethodsOnCartTest.php @@ -47,7 +47,11 @@ protected function setUp() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * * @param string $methodCode * @param string $methodTitle @@ -90,7 +94,11 @@ public function offlinePaymentMethodDataProvider(): array * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 */ public function testSetPurchaseOrderPaymentMethod() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php index 153bfde158b5..dcb5539fb3d4 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php @@ -44,9 +44,9 @@ protected function setUp() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php * @magentoApiDataFixture Magento/OfflineShipping/_files/tablerates_weight.php - * @@magentoConfigFixture carriers/flatrate/active 1 - * @@magentoConfigFixture carriers/tablerate/active 1 - * @@magentoConfigFixture carriers/freeshipping/active 1 + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * * @param string $carrierCode * @param string $methodCode diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php index 7a1cd9edf78d..efda719ca153 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php @@ -251,7 +251,11 @@ public function dataProviderSetPaymentMethodWithoutRequiredParameters(): array /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPurchaseOrderPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPurchaseOrderPaymentMethodOnCartTest.php index bff66ece59b9..6b9e46fd153e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPurchaseOrderPaymentMethodOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPurchaseOrderPaymentMethodOnCartTest.php @@ -45,7 +45,11 @@ protected function setUp() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 */ public function testSetPurchaseOrderPaymentMethodOnCartWithSimpleProduct() { @@ -89,7 +93,11 @@ public function testSetPurchaseOrderPaymentMethodOnCartWithSimpleProduct() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * * @expectedException Exception * @expectedExceptionMessage Purchase order number is a required field. diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php index 9ddedbfc4654..8197db7e7fef 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php @@ -97,7 +97,9 @@ public function testSetShippingMethodOnCartWithSimpleProduct() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php @@ -249,7 +251,9 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array /** * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AllowGuestCheckoutOptionTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AllowGuestCheckoutOptionTest.php index 1501a9420236..16f291be9107 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AllowGuestCheckoutOptionTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AllowGuestCheckoutOptionTest.php @@ -60,7 +60,6 @@ protected function setUp() } /** - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_guest_checkout.php * @magentoConfigFixture default_store checkout/options/guest_checkout 0 */ public function testCreateEmptyCartIfGuestCheckoutIsDisabled() @@ -84,7 +83,6 @@ public function testCreateEmptyCartIfGuestCheckoutIsDisabled() /** * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_guest_checkout.php * @magentoConfigFixture default_store checkout/options/guest_checkout 0 * * @expectedException \Exception @@ -129,7 +127,6 @@ public function testSetBillingAddressToGuestCustomerCart() /** * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_guest_checkout.php * @magentoConfigFixture default_store checkout/options/guest_checkout 0 * * @expectedException \Exception @@ -160,7 +157,6 @@ public function testSetGuestEmailOnCartWithGuestCheckoutDisabled() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_guest_checkout.php * @magentoConfigFixture default_store checkout/options/guest_checkout 0 * * @expectedException \Exception @@ -199,7 +195,6 @@ public function testSetPaymentOnCartWithGuestCheckoutDisabled() * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_guest_checkout.php * @magentoConfigFixture default_store checkout/options/guest_checkout 0 * * @expectedException \Exception @@ -248,7 +243,6 @@ public function testSetNewShippingAddressOnCartWithGuestCheckoutDisabled() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_guest_checkout.php * @magentoConfigFixture default_store checkout/options/guest_checkout 0 * * @expectedException \Exception @@ -285,8 +279,14 @@ public function testSetShippingMethodOnCartWithGuestCheckoutDisabled() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php @@ -294,7 +294,6 @@ public function testSetShippingMethodOnCartWithGuestCheckoutDisabled() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_guest_checkout.php * @magentoConfigFixture default_store checkout/options/guest_checkout 0 * * @expectedException \Exception diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php index af1f72fe7162..3634403e0b23 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php @@ -73,7 +73,9 @@ public function testGetAvailablePaymentMethodsFromCustomerCart() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php + * @magentoConfigFixture default_store payment/paypal_billing_agreement/active 0 + * @magentoConfigFixture default_store payment/checkmo/active 0 + * @magentoConfigFixture default_store payment/free/active 0 */ public function testGetAvailablePaymentMethodsIfPaymentsAreNotPresent() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailableShippingMethodsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailableShippingMethodsTest.php index 8703a690c62e..5d90d26d4983 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailableShippingMethodsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailableShippingMethodsTest.php @@ -103,7 +103,9 @@ public function testGetAvailableShippingMethodsFromCustomerCart() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 0 + * @magentoConfigFixture default_store carriers/tablerate/active 0 + * @magentoConfigFixture default_store carriers/freeshipping/active 0 */ public function testGetAvailableShippingMethodsIfShippingMethodsAreNotPresent() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedPaymentMethodTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedPaymentMethodTest.php index a918279bada6..9536f078402a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedPaymentMethodTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetSelectedPaymentMethodTest.php @@ -30,7 +30,11 @@ protected function setUp() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php @@ -52,7 +56,11 @@ public function testGetSelectedPaymentMethod() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php */ @@ -88,7 +96,11 @@ public function testGetSelectedPaymentMethodFromNonExistentCart() * _security * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php index cbfad81b130a..2dc5b53b31c7 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/PlaceOrderTest.php @@ -54,8 +54,14 @@ protected function setUp() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php @@ -110,8 +116,14 @@ public function testPlaceOrderIfCartIdIsMissed() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php @@ -187,7 +199,9 @@ public function testPlaceOrderWithNoShippingMethod() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php @@ -208,7 +222,9 @@ public function testPlaceOrderWithNoBillingAddress() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php @@ -228,7 +244,9 @@ public function testPlaceOrderWithNoPaymentMethod() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php @@ -251,8 +269,14 @@ public function testPlaceOrderWithOutOfStockProduct() * _security * @magentoApiDataFixture Magento/Customer/_files/three_customers.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflinePaymentMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflinePaymentMethodsOnCartTest.php index 7ec3148ea85a..6c45227c4774 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflinePaymentMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflinePaymentMethodsOnCartTest.php @@ -39,7 +39,11 @@ protected function setUp() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * * @param string $methodCode * @param string $methodTitle @@ -81,7 +85,11 @@ public function offlinePaymentMethodDataProvider(): array * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 */ public function testSetPurchaseOrderPaymentMethod() { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php index ff2c5f2e6b52..bf3abe557ef8 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php @@ -35,7 +35,9 @@ protected function setUp() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/OfflineShipping/_files/tablerates_weight.php * * @param string $carrierCode diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodAndPlaceOrderTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodAndPlaceOrderTest.php index 5a063fcb2e43..50fd9647d7c5 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodAndPlaceOrderTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodAndPlaceOrderTest.php @@ -148,8 +148,14 @@ public function testSetPaymentOnNonExistentCart() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php index c3de80d08f0b..fdec9a1dd985 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPaymentMethodOnCartTest.php @@ -200,7 +200,11 @@ public function dataProviderSetPaymentMethodWithoutRequiredParameters(): array /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPurchaseOrderPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPurchaseOrderPaymentMethodOnCartTest.php index 9dd0382a5dbe..8b6317bd76c3 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPurchaseOrderPaymentMethodOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetPurchaseOrderPaymentMethodOnCartTest.php @@ -37,7 +37,11 @@ protected function setUp() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 */ public function testSetPurchaseOrderPaymentMethodOnCartWithSimpleProduct() { @@ -80,7 +84,11 @@ public function testSetPurchaseOrderPaymentMethodOnCartWithSimpleProduct() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoConfigFixture default_store payment/banktransfer/active 1 + * @magentoConfigFixture default_store payment/cashondelivery/active 1 + * @magentoConfigFixture default_store payment/checkmo/active 1 + * @magentoConfigFixture default_store payment/purchaseorder/active 1 + * @magentoConfigFixture default_store payment/authorizenet_acceptjs/active 1 * * @expectedException Exception * @expectedExceptionMessage Purchase order number is a required field. diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php index 60c8bee75e2a..946c66a80938 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php @@ -115,7 +115,9 @@ public function testSetShippingMethodOnCartWithSimpleProductAndWithoutAddress() } /** - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php @@ -265,7 +267,9 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array } /** - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoConfigFixture default_store carriers/flatrate/active 1 + * @magentoConfigFixture default_store carriers/tablerate/active 1 + * @magentoConfigFixture default_store carriers/freeshipping/active 1 * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/SendFriend/SendFriendTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/SendFriend/SendFriendTest.php index 200bae76e0ae..e01e07490051 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/SendFriend/SendFriendTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/SendFriend/SendFriendTest.php @@ -45,7 +45,7 @@ protected function setUp() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/SendFriend/_files/enable_send_friend_guest.php + * @magentoConfigFixture default_store sendfriend/email/allow_guest 1 */ public function testSendFriendGuestEnable() { @@ -66,7 +66,7 @@ public function testSendFriendGuestEnable() /** * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/SendFriend/_files/disable_send_friend_guest.php + * @magentoConfigFixture default_store sendfriend/email/allow_guest 0 * @expectedException \Exception * @expectedExceptionMessage The current customer isn't authorized. */ @@ -90,7 +90,7 @@ public function testSendFriendGuestDisableAsGuest() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/SendFriend/_files/disable_send_friend_guest.php + * @magentoConfigFixture default_store sendfriend/email/allow_guest 0 */ public function testSendFriendGuestDisableAsCustomer() { @@ -210,15 +210,11 @@ public function testErrors(string $input, string $errorMessage) /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * TODO: use magentoApiConfigFixture (to be merged https://github.com/magento/graphql-ce/pull/351) + * @magentoConfigFixture default_store sendfriend/email/max_per_hour 1 * @magentoApiDataFixture Magento/SendFriend/Fixtures/sendfriend_configuration.php */ public function testLimitMessagesPerHour() { - - /** @var SendFriend $sendFriend */ - $sendFriend = $this->sendFriendFactory->create(); - $productId = (int)$this->productRepository->get('simple_product')->getId(); $recipients = '{ name: "Recipient Name 1" @@ -232,13 +228,11 @@ public function testLimitMessagesPerHour() $this->expectException(\Exception::class); $this->expectExceptionMessage( - "You can't send messages more than {$sendFriend->getMaxSendsToFriend()} times an hour." + "You can't send messages more than 1 times an hour." ); - $maxSendToFriends = $sendFriend->getMaxSendsToFriend(); - for ($i = 0; $i <= $maxSendToFriends + 1; $i++) { - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - } + $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Ups/SetUpsShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Ups/SetUpsShippingMethodsOnCartTest.php index 7de689a6ad0f..e4343596d4e5 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Ups/SetUpsShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Ups/SetUpsShippingMethodsOnCartTest.php @@ -83,7 +83,8 @@ protected function setUp() * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php + * @magentoConfigFixture default_store carriers/ups/active 1 + * @magentoConfigFixture default_store carriers/ups/type UPS * * @dataProvider dataProviderShippingMethods * @param string $methodCode @@ -139,7 +140,8 @@ public function dataProviderShippingMethods(): array * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_canada_address.php - * @magentoApiDataFixture Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php + * @magentoConfigFixture default_store carriers/ups/active 1 + * @magentoConfigFixture default_store carriers/ups/type UPS * * @dataProvider dataProviderShippingMethodsBasedOnCanadaAddress * @param string $methodCode diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Customer/_files/enable_customer_account_confirmation.php b/dev/tests/integration/testsuite/Magento/GraphQl/Customer/_files/enable_customer_account_confirmation.php deleted file mode 100644 index 41f2b210b32b..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Customer/_files/enable_customer_account_confirmation.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Customer\Model\AccountConfirmation; -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\App\Config\ScopeConfigInterface; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->get(WriterInterface::class); - -$configWriter->save(AccountConfirmation::XML_PATH_IS_CONFIRM, 1); - -$scopeConfig = $objectManager->get(ScopeConfigInterface::class); -$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Customer/_files/enable_customer_account_confirmation_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Customer/_files/enable_customer_account_confirmation_rollback.php deleted file mode 100644 index 72db06406b4a..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Customer/_files/enable_customer_account_confirmation_rollback.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->create(WriterInterface::class); - -$configWriter->delete('customer/create_account/confirm'); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php deleted file mode 100644 index 8e6d4b8f74b8..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Config\Model\Config; -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Store\Model\Store; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -$paymentMethodList = $objectManager->get(\Magento\Payment\Api\PaymentMethodListInterface::class); -$rollbackConfigKey = 'test/payment/disabled_payment_methods'; -$configData = []; -$disabledPaymentMethods = []; - -// Get all active Payment Methods -foreach ($paymentMethodList->getActiveList(Store::DEFAULT_STORE_ID) as $paymentMethod) { - $configData['payment/' . $paymentMethod->getCode() . '/active'] = 0; - $disabledPaymentMethods[] = $paymentMethod->getCode(); -} -// Remember all manually disabled Payment Methods for rollback -$configData[$rollbackConfigKey] = implode(',', $disabledPaymentMethods); - -/** @var Config $defConfig */ -$defConfig = $objectManager->create(Config::class); -$defConfig->setScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT); - -foreach ($configData as $key => $value) { - $defConfig->setDataByPath($key, $value); - $defConfig->save(); -} diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods_rollback.php deleted file mode 100644 index 092826d1fd3f..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods_rollback.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\ScopeConfigInterface; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -$rollbackConfigKey = 'test/payment/disabled_payment_methods'; - -$configWriter = $objectManager->create(WriterInterface::class); -$rollbackConfigValue = $objectManager->get(\Magento\Store\Model\StoreManagerInterface::class) - ->getStore(\Magento\Store\Model\Store::DEFAULT_STORE_ID) - ->getConfig($rollbackConfigKey); - -$disabledPaymentMethods = []; -if (!empty($rollbackConfigValue)) { - $disabledPaymentMethods = explode(',', $rollbackConfigValue); -} - -if (count($disabledPaymentMethods)) { - foreach ($disabledPaymentMethods as $keyToRemove) { - $configWriter->delete(sprintf('payment/%s/active', $keyToRemove)); - } -} -$configWriter->delete($rollbackConfigKey); - -$scopeConfig = $objectManager->get(ScopeConfigInterface::class); -$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout.php deleted file mode 100644 index 957c8831a3cb..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\App\Config\ScopeConfigInterface; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->get(WriterInterface::class); - -$configWriter->save('checkout/options/guest_checkout', 0); - -$scopeConfig = $objectManager->get(ScopeConfigInterface::class); -$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout_rollback.php deleted file mode 100644 index ed7941435ddd..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout_rollback.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->create(WriterInterface::class); - -$configWriter->delete('checkout/options/guest_checkout'); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php deleted file mode 100644 index c5d0468dbfac..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\App\Config\ScopeConfigInterface; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->get(WriterInterface::class); - -$configWriter->save('carriers/flatrate/active', 0); -$configWriter->save('carriers/tablerate/active', 0); -$configWriter->save('carriers/freeshipping/active', 0); - -$scopeConfig = $objectManager->get(ScopeConfigInterface::class); -$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods_rollback.php deleted file mode 100644 index 384ffbdf51f3..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods_rollback.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->create(WriterInterface::class); - -$configWriter->delete('carriers/flatrate/active'); -$configWriter->delete('carriers/tablerate/active'); -$configWriter->delete('carriers/freeshipping/active'); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php deleted file mode 100644 index 79d61cf32b9f..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\App\Config\ScopeConfigInterface; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->get(WriterInterface::class); - -$configWriter->save('payment/banktransfer/active', 1); -$configWriter->save('payment/cashondelivery/active', 1); -$configWriter->save('payment/checkmo/active', 1); -$configWriter->save('payment/purchaseorder/active', 1); -$configWriter->save('payment/authorizenet_acceptjs/active', 1); - -$scopeConfig = $objectManager->get(ScopeConfigInterface::class); -$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods_rollback.php deleted file mode 100644 index 6c41e3ebabf0..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods_rollback.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->create(WriterInterface::class); - -$configWriter->delete('payment/banktransfer/active'); -$configWriter->delete('payment/cashondelivery/active'); -$configWriter->delete('payment/checkmo/active'); -$configWriter->delete('payment/purchaseorder/active'); -$configWriter->delete('payment/authorizenet_acceptjs/active'); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php deleted file mode 100644 index ebc41da9b1b3..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\App\Config\ScopeConfigInterface; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->get(WriterInterface::class); - -$configWriter->save('carriers/flatrate/active', 1); -$configWriter->save('carriers/tablerate/active', 1); -$configWriter->save('carriers/freeshipping/active', 1); - -$scopeConfig = $objectManager->get(ScopeConfigInterface::class); -$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/SendFriend/_files/disable_send_friend_guest.php b/dev/tests/integration/testsuite/Magento/GraphQl/SendFriend/_files/disable_send_friend_guest.php deleted file mode 100644 index 80fcc2079a01..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/SendFriend/_files/disable_send_friend_guest.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\App\Config\ScopeConfigInterface; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->get(WriterInterface::class); - -$configWriter->save('sendfriend/email/allow_guest', '0'); - -$scopeConfig = $objectManager->get(ScopeConfigInterface::class); -$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/SendFriend/_files/enable_send_friend_guest.php b/dev/tests/integration/testsuite/Magento/GraphQl/SendFriend/_files/enable_send_friend_guest.php deleted file mode 100644 index aaf9a447aeaa..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/SendFriend/_files/enable_send_friend_guest.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\App\Config\ScopeConfigInterface; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->get(WriterInterface::class); - -$configWriter->save('sendfriend/email/allow_guest', '1'); - -$scopeConfig = $objectManager->get(ScopeConfigInterface::class); -$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php b/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php deleted file mode 100644 index 42931db75a43..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Framework\App\Config\ScopeConfigInterface; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->get(WriterInterface::class); - -$configWriter->save('carriers/ups/active', 1); -$configWriter->save('carriers/ups/type', "UPS"); - -$scopeConfig = $objectManager->get(ScopeConfigInterface::class); -$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method_rollback.php deleted file mode 100644 index cf6dc08dd91a..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method_rollback.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 -declare(strict_types=1); - -use Magento\Framework\App\Config\Storage\Writer; -use Magento\Framework\App\Config\Storage\WriterInterface; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -/** @var Writer $configWriter */ -$configWriter = $objectManager->create(WriterInterface::class); - -$configWriter->delete('carriers/ups/active'); -$configWriter->delete('carriers/ups/type'); From ffe625ed5fde14218b5b4cda993161b38bc810aa Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Wed, 17 Jul 2019 17:55:24 +0300 Subject: [PATCH 138/230] graphQl-167: removed wrong copyrights --- .../TestFramework/Annotation/ApiConfigFixture.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php index 9c5b52ed181b..cbcd0b597f16 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php @@ -1,13 +1,7 @@ <?php /** - * Copyright (c) 2019 TechDivision GmbH - * All rights reserved - * - * This product includes proprietary software developed at TechDivision GmbH, Germany - * For more information see https://www.techdivision.com/ - * - * To obtain a valid license for using this software please contact us at - * license@techdivision.com + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. */ declare(strict_types=1); From e9a3a09639349b63911da09a4f1b8771e4cb2abf Mon Sep 17 00:00:00 2001 From: Alex Taranovsky <firster@atwix.com> Date: Wed, 17 Jul 2019 18:21:56 +0300 Subject: [PATCH 139/230] magento/graphql-ce# Editorial. Fix countries name in the CountryCodeEnum --- app/code/Magento/CustomerGraphQl/etc/schema.graphqls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls index 123818407505..1e280993125e 100644 --- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls @@ -185,8 +185,8 @@ enum CountryCodeEnum @doc(description: "The list of countries codes") { CC @doc(description: "Cocos (Keeling) Islands") CO @doc(description: "Colombia") KM @doc(description: "Comoros") - CG @doc(description: "Congo -Brazzaville") - CD @doc(description: "Congo - Kinshasa") + CG @doc(description: "Congo-Brazzaville") + CD @doc(description: "Congo-Kinshasa") CK @doc(description: "Cook Islands") CR @doc(description: "Costa Rica") CI @doc(description: "Côte d’Ivoire") From 8bd4141b97ab001b0099b89c8692655f4fcae9ea Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 17 Jul 2019 10:44:21 -0500 Subject: [PATCH 140/230] MAGETWO-99439: Exteremly slow removing from memory tables in GaleraDb --- .../Patch/Schema/ChangeTmpTablesEngine.php | 62 +++++++++++++++++ .../Patch/Schema/ChangeTmpTablesEngine.php | 68 +++++++++++++++++++ .../Patch/Schema/ChangeTmpTablesEngine.php | 55 +++++++++++++++ .../Patch/Schema/ChangeTmpTablesEngine.php | 55 +++++++++++++++ 4 files changed, 240 insertions(+) create mode 100644 app/code/Magento/Bundle/Setup/Patch/Schema/ChangeTmpTablesEngine.php create mode 100644 app/code/Magento/Catalog/Setup/Patch/Schema/ChangeTmpTablesEngine.php create mode 100644 app/code/Magento/CatalogInventory/Setup/Patch/Schema/ChangeTmpTablesEngine.php create mode 100644 app/code/Magento/Downloadable/Setup/Patch/Schema/ChangeTmpTablesEngine.php diff --git a/app/code/Magento/Bundle/Setup/Patch/Schema/ChangeTmpTablesEngine.php b/app/code/Magento/Bundle/Setup/Patch/Schema/ChangeTmpTablesEngine.php new file mode 100644 index 000000000000..87ff3d8966f8 --- /dev/null +++ b/app/code/Magento/Bundle/Setup/Patch/Schema/ChangeTmpTablesEngine.php @@ -0,0 +1,62 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Bundle\Setup\Patch\Schema; + +use Magento\Framework\Setup\Patch\SchemaPatchInterface; +use Magento\Framework\Setup\SchemaSetupInterface; + +class ChangeTmpTablesEngine implements SchemaPatchInterface +{ + /** + * @var SchemaSetupInterface + */ + private $schemaSetup; + + /** + * @param SchemaSetupInterface $schemaSetup + */ + public function __construct(SchemaSetupInterface $schemaSetup) + { + $this->schemaSetup = $schemaSetup; + } + + /** + * @inheritdoc + */ + public function apply() + { + $this->schemaSetup->startSetup(); + + $tables = [ + 'catalog_product_index_price_bundle_tmp', + 'catalog_product_index_price_bundle_sel_tmp', + 'catalog_product_index_price_bundle_opt_tmp', + ]; + foreach ($tables as $table) { + $this->schemaSetup->getConnection()->changeTableEngine($table, 'InnoDB'); + } + + $this->schemaSetup->endSetup(); + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return []; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Catalog/Setup/Patch/Schema/ChangeTmpTablesEngine.php b/app/code/Magento/Catalog/Setup/Patch/Schema/ChangeTmpTablesEngine.php new file mode 100644 index 000000000000..a9ec22ab664a --- /dev/null +++ b/app/code/Magento/Catalog/Setup/Patch/Schema/ChangeTmpTablesEngine.php @@ -0,0 +1,68 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Setup\Patch\Schema; + +use Magento\Framework\Setup\Patch\SchemaPatchInterface; +use Magento\Framework\Setup\SchemaSetupInterface; + +class ChangeTmpTablesEngine implements SchemaPatchInterface +{ + /** + * @var SchemaSetupInterface + */ + private $schemaSetup; + + /** + * @param SchemaSetupInterface $schemaSetup + */ + public function __construct(SchemaSetupInterface $schemaSetup) + { + $this->schemaSetup = $schemaSetup; + } + + /** + * @inheritdoc + */ + public function apply() + { + $this->schemaSetup->startSetup(); + + $tables = [ + 'catalog_product_index_price_cfg_opt_agr_tmp', + 'catalog_product_index_price_cfg_opt_tmp', + 'catalog_product_index_price_final_tmp', + 'catalog_product_index_price_opt_tmp', + 'catalog_product_index_price_opt_agr_tmp', + 'catalog_product_index_eav_tmp', + 'catalog_product_index_eav_decimal_tmp', + 'catalog_product_index_price_tmp', + 'catalog_category_product_index_tmp', + ]; + foreach ($tables as $table) { + $this->schemaSetup->getConnection()->changeTableEngine($table, 'InnoDB'); + } + + $this->schemaSetup->endSetup(); + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return []; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/CatalogInventory/Setup/Patch/Schema/ChangeTmpTablesEngine.php b/app/code/Magento/CatalogInventory/Setup/Patch/Schema/ChangeTmpTablesEngine.php new file mode 100644 index 000000000000..fbeba9f483b1 --- /dev/null +++ b/app/code/Magento/CatalogInventory/Setup/Patch/Schema/ChangeTmpTablesEngine.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogInventory\Setup\Patch\Schema; + +use Magento\Framework\Setup\Patch\SchemaPatchInterface; +use Magento\Framework\Setup\SchemaSetupInterface; + +class ChangeTmpTablesEngine implements SchemaPatchInterface +{ + /** + * @var SchemaSetupInterface + */ + private $schemaSetup; + + /** + * @param SchemaSetupInterface $schemaSetup + */ + public function __construct(SchemaSetupInterface $schemaSetup) + { + $this->schemaSetup = $schemaSetup; + } + + /** + * @inheritdoc + */ + public function apply() + { + $this->schemaSetup->startSetup(); + + $this->schemaSetup->getConnection()->changeTableEngine('cataloginventory_stock_status_tmp', 'InnoDB'); + + $this->schemaSetup->endSetup(); + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return []; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} diff --git a/app/code/Magento/Downloadable/Setup/Patch/Schema/ChangeTmpTablesEngine.php b/app/code/Magento/Downloadable/Setup/Patch/Schema/ChangeTmpTablesEngine.php new file mode 100644 index 000000000000..90e1ddf87f8a --- /dev/null +++ b/app/code/Magento/Downloadable/Setup/Patch/Schema/ChangeTmpTablesEngine.php @@ -0,0 +1,55 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Downloadable\Setup\Patch\Schema; + +use Magento\Framework\Setup\Patch\SchemaPatchInterface; +use Magento\Framework\Setup\SchemaSetupInterface; + +class ChangeTmpTablesEngine implements SchemaPatchInterface +{ + /** + * @var SchemaSetupInterface + */ + private $schemaSetup; + + /** + * @param SchemaSetupInterface $schemaSetup + */ + public function __construct(SchemaSetupInterface $schemaSetup) + { + $this->schemaSetup = $schemaSetup; + } + + /** + * @inheritdoc + */ + public function apply() + { + $this->schemaSetup->startSetup(); + + $this->schemaSetup->getConnection()->changeTableEngine('catalog_product_index_price_downlod_tmp', 'InnoDB'); + + $this->schemaSetup->endSetup(); + } + + /** + * @inheritdoc + */ + public static function getDependencies() + { + return []; + } + + /** + * @inheritdoc + */ + public function getAliases() + { + return []; + } +} From ad61ec2b044a9f84c77650b4aa96577072c3578f Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Wed, 17 Jul 2019 11:26:00 -0500 Subject: [PATCH 141/230] MAGETWO-99439: Exteremly slow removing from memory tables in GaleraDb --- .../Bundle/Setup/Patch/Schema/ChangeTmpTablesEngine.php | 3 +++ .../Catalog/Setup/Patch/Schema/ChangeTmpTablesEngine.php | 3 +++ .../Setup/Patch/Schema/ChangeTmpTablesEngine.php | 3 +++ .../Downloadable/Setup/Patch/Schema/ChangeTmpTablesEngine.php | 3 +++ 4 files changed, 12 insertions(+) diff --git a/app/code/Magento/Bundle/Setup/Patch/Schema/ChangeTmpTablesEngine.php b/app/code/Magento/Bundle/Setup/Patch/Schema/ChangeTmpTablesEngine.php index 87ff3d8966f8..adb178796f88 100644 --- a/app/code/Magento/Bundle/Setup/Patch/Schema/ChangeTmpTablesEngine.php +++ b/app/code/Magento/Bundle/Setup/Patch/Schema/ChangeTmpTablesEngine.php @@ -10,6 +10,9 @@ use Magento\Framework\Setup\Patch\SchemaPatchInterface; use Magento\Framework\Setup\SchemaSetupInterface; +/** + * Change engine for temporary tables to InnoDB. + */ class ChangeTmpTablesEngine implements SchemaPatchInterface { /** diff --git a/app/code/Magento/Catalog/Setup/Patch/Schema/ChangeTmpTablesEngine.php b/app/code/Magento/Catalog/Setup/Patch/Schema/ChangeTmpTablesEngine.php index a9ec22ab664a..39e2e0cb0963 100644 --- a/app/code/Magento/Catalog/Setup/Patch/Schema/ChangeTmpTablesEngine.php +++ b/app/code/Magento/Catalog/Setup/Patch/Schema/ChangeTmpTablesEngine.php @@ -10,6 +10,9 @@ use Magento\Framework\Setup\Patch\SchemaPatchInterface; use Magento\Framework\Setup\SchemaSetupInterface; +/** + * Change engine for temporary tables to InnoDB. + */ class ChangeTmpTablesEngine implements SchemaPatchInterface { /** diff --git a/app/code/Magento/CatalogInventory/Setup/Patch/Schema/ChangeTmpTablesEngine.php b/app/code/Magento/CatalogInventory/Setup/Patch/Schema/ChangeTmpTablesEngine.php index fbeba9f483b1..27a70d0c908f 100644 --- a/app/code/Magento/CatalogInventory/Setup/Patch/Schema/ChangeTmpTablesEngine.php +++ b/app/code/Magento/CatalogInventory/Setup/Patch/Schema/ChangeTmpTablesEngine.php @@ -10,6 +10,9 @@ use Magento\Framework\Setup\Patch\SchemaPatchInterface; use Magento\Framework\Setup\SchemaSetupInterface; +/** + * Change engine for temporary tables to InnoDB. + */ class ChangeTmpTablesEngine implements SchemaPatchInterface { /** diff --git a/app/code/Magento/Downloadable/Setup/Patch/Schema/ChangeTmpTablesEngine.php b/app/code/Magento/Downloadable/Setup/Patch/Schema/ChangeTmpTablesEngine.php index 90e1ddf87f8a..37c6a96542e2 100644 --- a/app/code/Magento/Downloadable/Setup/Patch/Schema/ChangeTmpTablesEngine.php +++ b/app/code/Magento/Downloadable/Setup/Patch/Schema/ChangeTmpTablesEngine.php @@ -10,6 +10,9 @@ use Magento\Framework\Setup\Patch\SchemaPatchInterface; use Magento\Framework\Setup\SchemaSetupInterface; +/** + * Change engine for temporary tables to InnoDB. + */ class ChangeTmpTablesEngine implements SchemaPatchInterface { /** From 5223ed0226c2f176e6ffe81f039e94ef54910390 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 18 Jul 2019 09:38:49 +0300 Subject: [PATCH 142/230] MC-17201: Delegated account creation fails with custom attributes present in customer address --- .../Customer/Model/Delegation/Storage.php | 16 +++++++++++++++- .../Api/OrderCustomerDelegateInterfaceTest.php | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Model/Delegation/Storage.php b/app/code/Magento/Customer/Model/Delegation/Storage.php index 71a61d59057c..ba1c62de1ac8 100644 --- a/app/code/Magento/Customer/Model/Delegation/Storage.php +++ b/app/code/Magento/Customer/Model/Delegation/Storage.php @@ -19,6 +19,7 @@ use Magento\Customer\Model\Delegation\Data\NewOperationFactory; use Magento\Customer\Api\Data\CustomerInterfaceFactory; use Magento\Customer\Api\Data\AddressInterfaceFactory; +use Magento\Framework\Api\CustomAttributesDataInterface; use Psr\Log\LoggerInterface; /** @@ -134,9 +135,22 @@ public function consumeNewOperation() ); $addressData['region'] = $region; } - $addresses[] = $this->addressFactory->create( + + $customAttributes = []; + if (!empty($addressData[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES])) { + $customAttributes = $addressData[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES]; + unset($addressData[CustomAttributesDataInterface::CUSTOM_ATTRIBUTES]); + } + + $address = $this->addressFactory->create( ['data' => $addressData] ); + + foreach ($customAttributes as $attributeCode => $attributeValue) { + $address->setCustomAttribute($attributeCode, $attributeValue); + } + + $addresses[] = $address; } $customerData = $serialized['customer']; $customerData['addresses'] = $addresses; diff --git a/dev/tests/integration/testsuite/Magento/Sales/Api/OrderCustomerDelegateInterfaceTest.php b/dev/tests/integration/testsuite/Magento/Sales/Api/OrderCustomerDelegateInterfaceTest.php index cb6f4aaac07d..d955874309af 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Api/OrderCustomerDelegateInterfaceTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Api/OrderCustomerDelegateInterfaceTest.php @@ -11,6 +11,7 @@ use Magento\Customer\Api\Data\AddressInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Api\Data\CustomerInterfaceFactory; +use Magento\Framework\Api\AttributeInterface; use Magento\Sales\Api\Data\OrderAddressInterface; use Magento\Sales\Model\Order; use Magento\Sales\Model\OrderFactory; @@ -126,6 +127,7 @@ private function compareAddresses( /** * @magentoDbIsolation enabled * @magentoAppIsolation enabled + * @magentoDataFixture Magento/Customer/_files/attribute_user_defined_address.php * @magentoDataFixture Magento/Sales/_files/order.php * @return void */ From 460adb0e5fefe3320fa2cd40b5444c12382a91da Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Thu, 18 Jul 2019 09:39:21 +0300 Subject: [PATCH 143/230] graphQl-167: fixed static issuess --- .../Magento/TestFramework/Annotation/ApiConfigFixture.php | 8 ++++---- .../testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php | 1 - .../CatalogInventory/ProductOnlyXLeftInStockTest.php | 3 +++ .../GraphQl/CatalogInventory/ProductStockStatusTest.php | 3 +++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php index cbcd0b597f16..22e63dbb66d8 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php @@ -134,9 +134,8 @@ private function loadConfigs(string $configPath, string $storeCode = null): arra /** * Check if config exist in the database * - * @param string $configPath - * @param $originalValue - * @param string|null $storeCode + * @param string $configPath + * @param string|null $storeCode */ private function checkIfValueExist(string $configPath, string $storeCode = null): bool { @@ -147,7 +146,8 @@ private function checkIfValueExist(string $configPath, string $storeCode = null) /** * Returns the store ID by the store code - * @param string $storeCode + * + * @param string $storeCode * @return int */ private function getStoreIdByCode(string $storeCode): int diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php index 02e53d141108..21e608da4800 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/StoreConfigTest.php @@ -58,4 +58,3 @@ public function testGetStoreConfig() $this->assertEquals('asc', $response['storeConfig']['catalog_default_sort_by']); } } - diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductOnlyXLeftInStockTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductOnlyXLeftInStockTest.php index 3c18892df3c2..2e4851767b06 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductOnlyXLeftInStockTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductOnlyXLeftInStockTest.php @@ -9,6 +9,9 @@ use Magento\TestFramework\TestCase\GraphQlAbstract; +/** + * Test for the product only x left in stock + */ class ProductOnlyXLeftInStockTest extends GraphQlAbstract { /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductStockStatusTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductStockStatusTest.php index a383e18b40ae..a27926569b28 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductStockStatusTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/ProductStockStatusTest.php @@ -12,6 +12,9 @@ use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; +/** + * Test for product status + */ class ProductStockStatusTest extends GraphQlAbstract { /** From 52d678676ad85c09584e913cb90362b10707905f Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Thu, 18 Jul 2019 10:54:48 +0300 Subject: [PATCH 144/230] MC-17201: Delegated account creation fails with custom attributes present in customer address --- .../Customer/Model/Delegation/Storage.php | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/code/Magento/Customer/Model/Delegation/Storage.php b/app/code/Magento/Customer/Model/Delegation/Storage.php index ba1c62de1ac8..d1eae3f56001 100644 --- a/app/code/Magento/Customer/Model/Delegation/Storage.php +++ b/app/code/Magento/Customer/Model/Delegation/Storage.php @@ -101,11 +101,13 @@ public function storeNewOperation(CustomerInterface $customer, array $delegatedD } } $this->session->setCustomerFormData($customerData); - $this->session->setDelegatedNewCustomerData([ - 'customer' => $customerData, - 'addresses' => $addressesData, - 'delegated_data' => $delegatedData, - ]); + $this->session->setDelegatedNewCustomerData( + [ + 'customer' => $customerData, + 'addresses' => $addressesData, + 'delegated_data' => $delegatedData, + ] + ); } /** @@ -155,11 +157,11 @@ public function consumeNewOperation() $customerData = $serialized['customer']; $customerData['addresses'] = $addresses; - return $this->newFactory->create([ - 'customer' => $this->customerFactory->create( - ['data' => $customerData] - ), - 'additionalData' => $serialized['delegated_data'], - ]); + return $this->newFactory->create( + [ + 'customer' => $this->customerFactory->create(['data' => $customerData]), + 'additionalData' => $serialized['delegated_data'], + ] + ); } } From 24da88ee7eb6f13b7a028b6ae5e64964c24603d9 Mon Sep 17 00:00:00 2001 From: Vinai Kopp <Vinai@users.noreply.github.com> Date: Thu, 18 Jul 2019 11:57:17 +0200 Subject: [PATCH 145/230] Add declaration for @cache directive The `@cache` directive is available since 2.3.2. --- app/code/Magento/GraphQl/etc/schema.graphqls | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/GraphQl/etc/schema.graphqls b/app/code/Magento/GraphQl/etc/schema.graphqls index 2614f5c94b5f..eb6a88a4d487 100644 --- a/app/code/Magento/GraphQl/etc/schema.graphqls +++ b/app/code/Magento/GraphQl/etc/schema.graphqls @@ -39,6 +39,8 @@ directive @resolver(class: String="") on QUERY directive @typeResolver(class: String="") on INTERFACE | OBJECT +directive @cache(cacheIdentity: String="" cachable: Boolean=true) on QUERY + type Query { } From 8dca0add00a3737fb4e54e969bf996443c2e6927 Mon Sep 17 00:00:00 2001 From: Myroslav Dobra <dmaraptor@gmail.com> Date: Thu, 18 Jul 2019 17:29:54 +0300 Subject: [PATCH 146/230] MC-15163: No redirects after Oauth Handshake for 3rd party integration --- .../Magento/Integration/view/adminhtml/web/js/integration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Integration/view/adminhtml/web/js/integration.js b/app/code/Magento/Integration/view/adminhtml/web/js/integration.js index a2acc40c6b86..d5830a442987 100644 --- a/app/code/Magento/Integration/view/adminhtml/web/js/integration.js +++ b/app/code/Magento/Integration/view/adminhtml/web/js/integration.js @@ -204,7 +204,7 @@ define([ clearInterval(IdentityLogin.checker); $('body').trigger('processStart'); //Check for window closed - window.location.reload(); + window.location.href = url.grid; IdentityLogin.jqInfoDialog.modal('closeModal'); } } catch (e) { From 9d6c358c8020e9fbf224f981aad3b81239d78d2a Mon Sep 17 00:00:00 2001 From: Dmytro Horytskyi <horytsky@adobe.com> Date: Thu, 18 Jul 2019 14:05:34 -0500 Subject: [PATCH 147/230] MC-18195: Order Products Report Interval Date incorrect --- .../Magento/Reports/Block/Adminhtml/Grid.php | 5 +- .../Model/ResourceModel/Report/Collection.php | 18 +++---- .../ResourceModel/Report/CollectionTest.php | 47 +++++++++---------- 3 files changed, 31 insertions(+), 39 deletions(-) diff --git a/app/code/Magento/Reports/Block/Adminhtml/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Grid.php index 32073cf0b7a0..8885c94c6989 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Grid.php @@ -170,9 +170,8 @@ protected function _prepareCollection() * Validate from and to date */ try { - $from = $this->_localeDate->date($this->getFilter('report_from'), null, false, false); - $to = $this->_localeDate->date($this->getFilter('report_to'), null, false, false); - + $from = $this->_localeDate->date($this->getFilter('report_from'), null, true, false); + $to = $this->_localeDate->date($this->getFilter('report_to'), null, true, false); $collection->setInterval($from, $to); } catch (\Exception $e) { $this->_errors[] = __('Invalid date specified'); diff --git a/app/code/Magento/Reports/Model/ResourceModel/Report/Collection.php b/app/code/Magento/Reports/Model/ResourceModel/Report/Collection.php index f2a761dbd508..b987e09194b3 100644 --- a/app/code/Magento/Reports/Model/ResourceModel/Report/Collection.php +++ b/app/code/Magento/Reports/Model/ResourceModel/Report/Collection.php @@ -22,14 +22,14 @@ class Collection extends \Magento\Framework\Data\Collection /** * From value * - * @var \DateTime + * @var \DateTimeInterface */ protected $_from; /** * To value * - * @var \DateTime + * @var \DateTimeInterface */ protected $_to; @@ -125,8 +125,8 @@ public function setPeriod($period) */ public function setInterval(\DateTimeInterface $fromDate, \DateTimeInterface $toDate) { - $this->_from = new \DateTime($fromDate->format('Y-m-d'), $fromDate->getTimezone()); - $this->_to = new \DateTime($toDate->format('Y-m-d'), $toDate->getTimezone()); + $this->_from = $fromDate; + $this->_to = $toDate; return $this; } @@ -143,8 +143,8 @@ protected function _getIntervals() if (!$this->_from && !$this->_to) { return $this->_intervals; } - $dateStart = $this->_from; - $dateEnd = $this->_to; + $dateStart = new \DateTime($this->_from->format('Y-m-d'), $this->_from->getTimezone()); + $dateEnd = new \DateTime($this->_to->format('Y-m-d'), $this->_to->getTimezone()); $firstInterval = true; while ($dateStart <= $dateEnd) { @@ -179,11 +179,7 @@ protected function _getIntervals() protected function _getDayInterval(\DateTime $dateStart) { $interval = [ - 'period' => $this->_localeDate->formatDateTime( - $dateStart, - \IntlDateFormatter::SHORT, - \IntlDateFormatter::NONE - ), + 'period' => $this->_localeDate->formatDate($dateStart, \IntlDateFormatter::SHORT), 'start' => $this->_localeDate->convertConfigTimeToUtc($dateStart->format('Y-m-d 00:00:00')), 'end' => $this->_localeDate->convertConfigTimeToUtc($dateStart->format('Y-m-d 23:59:59')), ]; diff --git a/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Report/CollectionTest.php b/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Report/CollectionTest.php index 51d890dd56df..41b474559457 100644 --- a/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Report/CollectionTest.php +++ b/app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Report/CollectionTest.php @@ -6,49 +6,49 @@ namespace Magento\Reports\Test\Unit\Model\ResourceModel\Report; +use Magento\Framework\Data\Collection\EntityFactory; +use Magento\Framework\Stdlib\DateTime\TimezoneInterface; use Magento\Reports\Model\ResourceModel\Report\Collection; +use Magento\Reports\Model\ResourceModel\Report\Collection\Factory as ReportCollectionFactory; +/** + * Class CollectionTest + * + * @covers \Magento\Reports\Model\ResourceModel\Report\Collection + */ class CollectionTest extends \PHPUnit\Framework\TestCase { /** - * @var \Magento\Reports\Model\ResourceModel\Report\Collection + * @var Collection */ protected $collection; /** - * @var \Magento\Framework\Data\Collection\EntityFactory|\PHPUnit_Framework_MockObject_MockObject + * @var EntityFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $entityFactoryMock; /** - * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject + * @var TimezoneInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $timezoneMock; /** - * @var \Magento\Reports\Model\ResourceModel\Report\Collection\Factory|\PHPUnit_Framework_MockObject_MockObject + * @var ReportCollectionFactory|\PHPUnit_Framework_MockObject_MockObject */ protected $factoryMock; /** - * {@inheritDoc} + * @inheritDoc */ protected function setUp() { - $this->entityFactoryMock = $this->getMockBuilder(\Magento\Framework\Data\Collection\EntityFactory::class) - ->disableOriginalConstructor() - ->getMock(); - $this->timezoneMock = $this->getMockBuilder(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::class) - ->getMock(); - $this->factoryMock = $this->getMockBuilder( - \Magento\Reports\Model\ResourceModel\Report\Collection\Factory::class - )->disableOriginalConstructor() - ->getMock(); - - $this->timezoneMock - ->expects($this->any()) - ->method('formatDateTime') - ->will($this->returnCallback([$this, 'formatDateTime'])); + $this->entityFactoryMock = $this->createMock(EntityFactory::class); + $this->timezoneMock = $this->createMock(TimezoneInterface::class); + $this->factoryMock = $this->createMock(ReportCollectionFactory::class); + + $this->timezoneMock->method('formatDate') + ->will($this->returnCallback([$this, 'formatDate'])); $this->collection = new Collection( $this->entityFactoryMock, @@ -131,7 +131,7 @@ public function testGetReports($period, $fromDate, $toDate, $size) public function testLoadData() { $this->assertInstanceOf( - \Magento\Reports\Model\ResourceModel\Report\Collection::class, + Collection::class, $this->collection->loadData() ); } @@ -182,14 +182,11 @@ public function intervalsDataProvider() } /** + * @param \DateTimeInterface $dateStart * @return string */ - public function formatDateTime() + public function formatDate(\DateTimeInterface $dateStart): string { - $args = func_get_args(); - - $dateStart = $args[0]; - $formatter = new \IntlDateFormatter( "en_US", \IntlDateFormatter::SHORT, From 626fab70c34e56d3d20f0a0824186735efc4e2ce Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Thu, 18 Jul 2019 16:44:53 -0500 Subject: [PATCH 148/230] Test improvements: - added testCaseId and Severity --- .../Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml index e1bff8654274..63751ad697ed 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontOnePageCheckoutJsValidationTest.xml @@ -13,8 +13,10 @@ <features value="Checkout"/> <title value="Js validation error messages must be absent for required fields after checkout start."/> <description value="Js validation error messages must be absent for required fields after checkout start."/> - <group value="shoppingCart"/> - <group value="mtf_migrated"/> + <severity value="MAJOR" /> + <testCaseId value="MC-18312" /> + <group value="shoppingCart" /> + <group value="mtf_migrated" /> </annotations> <before> <createData entity="_defaultCategory" stepKey="createCategory"/> From e8c14d20f418fa4e4b57d1fecb09a47ac7aa8d62 Mon Sep 17 00:00:00 2001 From: Graham Wharton <graham@gwharton.me.uk> Date: Fri, 19 Jul 2019 10:23:40 +0100 Subject: [PATCH 149/230] Updated AbstractPdf insertLogo function to be Database Media Storage aware. --- .../Sales/Model/Order/Pdf/AbstractPdf.php | 18 ++- .../Test/Unit/Model/Order/Pdf/InvoiceTest.php | 138 +++++++++++++++++- 2 files changed, 151 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php index 723940a5f67c..ba82478c9cea 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php @@ -7,6 +7,7 @@ namespace Magento\Sales\Model\Order\Pdf; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\MediaStorage\Helper\File\Storage\Database; /** * Sales Order PDF abstract model @@ -15,6 +16,7 @@ * @api * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.TooManyFields) * @since 100.0.2 */ abstract class AbstractPdf extends \Magento\Framework\DataObject @@ -122,6 +124,11 @@ abstract public function getPdf(); */ private $pageSettings; + /** + * @var Database + */ + private $fileStorageDatabase; + /** * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Framework\Stdlib\StringUtils $string @@ -134,6 +141,7 @@ abstract public function getPdf(); * @param \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation * @param \Magento\Sales\Model\Order\Address\Renderer $addressRenderer * @param array $data + * @param Database $fileStorageDatabase * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -147,7 +155,8 @@ public function __construct( \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Framework\Translate\Inline\StateInterface $inlineTranslation, \Magento\Sales\Model\Order\Address\Renderer $addressRenderer, - array $data = [] + array $data = [], + Database $fileStorageDatabase = null ) { $this->addressRenderer = $addressRenderer; $this->_paymentData = $paymentData; @@ -160,6 +169,8 @@ public function __construct( $this->_pdfTotalFactory = $pdfTotalFactory; $this->_pdfItemsFactory = $pdfItemsFactory; $this->inlineTranslation = $inlineTranslation; + $this->fileStorageDatabase = $fileStorageDatabase ?: + \Magento\Framework\App\ObjectManager::getInstance()->get(Database::class); parent::__construct($data); } @@ -254,6 +265,11 @@ protected function insertLogo(&$page, $store = null) ); if ($image) { $imagePath = '/sales/store/logo/' . $image; + if ($this->fileStorageDatabase->checkDbUsage() && + !$this->_mediaDirectory->isFile($imagePath) + ) { + $this->fileStorageDatabase->saveFileToFilesystem($imagePath); + } if ($this->_mediaDirectory->isFile($imagePath)) { $image = \Zend_Pdf_Image::imageWithPath($this->_mediaDirectory->getAbsolutePath($imagePath)); $top = 830; diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/InvoiceTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/InvoiceTest.php index ae196c1cb5ad..a30d0a8327d0 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/InvoiceTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Pdf/InvoiceTest.php @@ -5,6 +5,18 @@ */ namespace Magento\Sales\Test\Unit\Model\Order\Pdf; +use Magento\MediaStorage\Helper\File\Storage\Database; +use Magento\Sales\Model\Order\Invoice; +use Magento\Sales\Model\Order; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Sales\Model\Order\Address; +use Magento\Sales\Model\Order\Address\Renderer; + +/** + * Class InvoiceTest + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class InvoiceTest extends \PHPUnit\Framework\TestCase { /** @@ -17,13 +29,38 @@ class InvoiceTest extends \PHPUnit\Framework\TestCase */ protected $_pdfConfigMock; + /** + * @var Database|\PHPUnit_Framework_MockObject_MockObject + */ + protected $databaseMock; + + /** + * @var ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $scopeConfigMock; + + /** + * @var \Magento\Framework\Filesystem\Directory\Write|\PHPUnit_Framework_MockObject_MockObject + */ + protected $directoryMock; + + /** + * @var Renderer|\PHPUnit_Framework_MockObject_MockObject + */ + protected $addressRendererMock; + + /** + * @var \Magento\Payment\Helper\Data|\PHPUnit_Framework_MockObject_MockObject + */ + protected $paymentDataMock; + protected function setUp() { $this->_pdfConfigMock = $this->getMockBuilder(\Magento\Sales\Model\Order\Pdf\Config::class) ->disableOriginalConstructor() ->getMock(); - $directoryMock = $this->createMock(\Magento\Framework\Filesystem\Directory\Write::class); - $directoryMock->expects($this->any())->method('getAbsolutePath')->will( + $this->directoryMock = $this->createMock(\Magento\Framework\Filesystem\Directory\Write::class); + $this->directoryMock->expects($this->any())->method('getAbsolutePath')->will( $this->returnCallback( function ($argument) { return BP . '/' . $argument; @@ -31,8 +68,17 @@ function ($argument) { ) ); $filesystemMock = $this->createMock(\Magento\Framework\Filesystem::class); - $filesystemMock->expects($this->any())->method('getDirectoryRead')->will($this->returnValue($directoryMock)); - $filesystemMock->expects($this->any())->method('getDirectoryWrite')->will($this->returnValue($directoryMock)); + $filesystemMock->expects($this->any()) + ->method('getDirectoryRead') + ->will($this->returnValue($this->directoryMock)); + $filesystemMock->expects($this->any()) + ->method('getDirectoryWrite') + ->will($this->returnValue($this->directoryMock)); + + $this->databaseMock = $this->createMock(Database::class); + $this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class); + $this->addressRendererMock = $this->createMock(Renderer::class); + $this->paymentDataMock = $this->createMock(\Magento\Payment\Helper\Data::class); $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->_model = $helper->getObject( @@ -40,6 +86,11 @@ function ($argument) { [ 'filesystem' => $filesystemMock, 'pdfConfig' => $this->_pdfConfigMock, + 'fileStorageDatabase' => $this->databaseMock, + 'scopeConfig' => $this->scopeConfigMock, + 'addressRenderer' => $this->addressRendererMock, + 'string' => new \Magento\Framework\Stdlib\StringUtils(), + 'paymentData' => $this->paymentDataMock ] ); } @@ -72,4 +123,83 @@ public function testGetPdfInitRenderer() $renderers->getValue($this->_model) ); } + + public function testInsertLogoDatabaseMediaStorage() + { + $filename = 'image.jpg'; + $path = '/sales/store/logo/'; + + $this->_pdfConfigMock->expects($this->once()) + ->method('getRenderersPerProduct') + ->with('invoice') + ->will($this->returnValue(['product_type_one' => 'Renderer_Type_One_Product_One'])); + $this->_pdfConfigMock->expects($this->any()) + ->method('getTotals') + ->will($this->returnValue([])); + + $block = $this->getMockBuilder(\Magento\Framework\View\Element\Template::class) + ->disableOriginalConstructor() + ->setMethods(['setIsSecureMode','toPdf']) + ->getMock(); + $block->expects($this->any()) + ->method('setIsSecureMode') + ->willReturn($block); + $block->expects($this->any()) + ->method('toPdf') + ->will($this->returnValue('')); + $this->paymentDataMock->expects($this->any()) + ->method('getInfoBlock') + ->willReturn($block); + + $this->addressRendererMock->expects($this->any()) + ->method('format') + ->will($this->returnValue('')); + + $this->databaseMock->expects($this->any()) + ->method('checkDbUsage') + ->will($this->returnValue(true)); + + $invoiceMock = $this->createMock(Invoice::class); + $orderMock = $this->createMock(Order::class); + $addressMock = $this->createMock(Address::class); + $orderMock->expects($this->any()) + ->method('getBillingAddress') + ->willReturn($addressMock); + $orderMock->expects($this->any()) + ->method('getIsVirtual') + ->will($this->returnValue(true)); + $infoMock = $this->createMock(\Magento\Payment\Model\InfoInterface::class); + $orderMock->expects($this->any()) + ->method('getPayment') + ->willReturn($infoMock); + $invoiceMock->expects($this->any()) + ->method('getOrder') + ->willReturn($orderMock); + $invoiceMock->expects($this->any()) + ->method('getAllItems') + ->willReturn([]); + + $this->scopeConfigMock->expects($this->at(0)) + ->method('getValue') + ->with('sales/identity/logo', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null) + ->will($this->returnValue($filename)); + $this->scopeConfigMock->expects($this->at(1)) + ->method('getValue') + ->with('sales/identity/address', \Magento\Store\Model\ScopeInterface::SCOPE_STORE, null) + ->will($this->returnValue('')); + + $this->directoryMock->expects($this->any()) + ->method('isFile') + ->with($path . $filename) + ->willReturnOnConsecutiveCalls( + $this->returnValue(false), + $this->returnValue(false) + ); + + $this->databaseMock->expects($this->once()) + ->method('saveFileToFilesystem') + ->with($path . $filename); + + $this->_model->getPdf([$invoiceMock]); + } } From e164c89687e92e33cdc413ff19d34656b9fe311b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Niederges=C3=A4=C3=9F?= <dng-dev@users.noreply.github.com> Date: Fri, 19 Jul 2019 12:49:19 +0200 Subject: [PATCH 150/230] Fix for PHP_CodeSniffer error after app:config:dump --- .../Framework/App/DeploymentConfig/Writer/PhpFormatter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php index d5a89c56b689..9677cebfc6f9 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php @@ -80,7 +80,9 @@ private function formatData($data, $comments = [], $prefix = ' ') */ private function varExportShort($var, int $depth = 0) { - if (!is_array($var)) { + if(null === $var){ + return 'null'; + }elseif (!is_array($var)) { return var_export($var, true); } From 77fbbe2a1b8aa56282a0b7f35dab9eb1fc5abec3 Mon Sep 17 00:00:00 2001 From: Nikita Fomin <nikita.fomin@transoftgroup.com> Date: Fri, 19 Jul 2019 14:06:19 +0300 Subject: [PATCH 151/230] MC-10812: Random B2B test fail: Magento\FunctionalTestingFramework.functional.AdminSettingCustomerPhoneNumberTest --- ...hDefaultAddressWithoutPhoneActionGroup.xml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithDefaultAddressWithoutPhoneActionGroup.xml diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithDefaultAddressWithoutPhoneActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithDefaultAddressWithoutPhoneActionGroup.xml new file mode 100644 index 000000000000..ff6512ba5fc0 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithDefaultAddressWithoutPhoneActionGroup.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCreateCustomerWithDefaultAddressWithoutPhoneActionGroup"> + <arguments> + <argument name="customer" defaultValue="Simple_US_Customer"/> + <argument name="address" defaultValue="US_Address_NY"/> + </arguments> + <amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/> + <click selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}" stepKey="addNewCustomer"/> + <fillField selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/> + <fillField selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/> + <fillField selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customer.email}}" stepKey="fillEmail"/> + <click selector="{{AdminMainActionsSection.saveAndContinue}}" stepKey="clickSaveAndContinue"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the customer." stepKey="seeSuccessMessage"/> + <click selector="{{AdminCustomerAccountInformationSection.addressesButton}}" stepKey="goToAddresses"/> + <waitForPageLoad stepKey="waitForAddresses"/> + <click selector="{{AdminCustomerAddressesSection.addNewAddress}}" stepKey="clickOnAddNewAddress"/> + <waitForPageLoad stepKey="waitForAddressFieldsLoad"/> + <click selector="{{AdminCustomerAddressesSection.defaultBillingAddress}}" stepKey="defaultBillingAddressSetYes"/> + <click selector="{{AdminCustomerAddressesSection.defaultShippingAddress}}" stepKey="defaultShippingAddressSetYes"/> + <fillField selector="{{AdminCustomerAddressesSection.firstNameForAddress}}" userInput="{{address.firstname}}" stepKey="fillFirstNameForAddress"/> + <fillField selector="{{AdminCustomerAddressesSection.lastNameForAddress}}" userInput="{{address.lastname}}" stepKey="fillLastNameForAddress"/> + <fillField selector="{{AdminCustomerAddressesSection.streetAddress}}" userInput="{{address.street[0]}}" stepKey="fillStreetAddress"/> + <fillField selector="{{AdminCustomerAddressesSection.city}}" userInput="{{address.city}}" stepKey="fillCity"/> + <selectOption selector="{{AdminCustomerAddressesSection.country}}" userInput="{{address.country}}" stepKey="selectCountry"/> + <selectOption selector="{{AdminCustomerAddressesSection.state}}" userInput="{{address.state}}" stepKey="selectState"/> + <fillField selector="{{AdminCustomerAddressesSection.zip}}" userInput="{{address.postcode}}" stepKey="fillZip"/> + <click selector="{{AdminSlideOutDialogSection.saveButton}}" stepKey="saveAddress"/> + <dontSee selector="{{AdminCustomerAddressesSection.phoneNumberRequiredMessage}}" stepKey="dontSeePhoneErrorMessage"/> + <click selector="{{AdminMainActionsSection.save}}" stepKey="save"/> + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessfullyCreatedMessage"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the customer." stepKey="seeSuccessMessageAgain"/> + </actionGroup> +</actionGroups> From d64b7c554cfac07038d663f6c28a8a34da108e34 Mon Sep 17 00:00:00 2001 From: roettigl <l.roettig@techdivision.com> Date: Fri, 19 Jul 2019 13:20:59 +0200 Subject: [PATCH 152/230] MC-16192: Change for better BC --- app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index 5da21e8a59e8..51ad1c25e148 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -191,13 +191,13 @@ public function __construct( \Magento\MediaStorage\Model\File\Storage\DatabaseFactory $storageDatabaseFactory, \Magento\MediaStorage\Model\File\Storage\Directory\DatabaseFactory $directoryDatabaseFactory, \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory, - \Psr\Log\LoggerInterface $logger = null, array $resizeParameters = [], array $extensions = [], array $dirs = [], array $data = [], \Magento\Framework\Filesystem\DriverInterface $file = null, - \Magento\Framework\Filesystem\Io\File $ioFile = null + \Magento\Framework\Filesystem\Io\File $ioFile = null, + \Psr\Log\LoggerInterface $logger = null ) { $this->_session = $session; $this->_backendUrl = $backendUrl; From 180568a922cefe631b74d47d7966e6bd3cb07448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Niederges=C3=A4=C3=9F?= <dng-dev@users.noreply.github.com> Date: Fri, 19 Jul 2019 14:03:37 +0200 Subject: [PATCH 153/230] Updated code Formatting --- .../Framework/App/DeploymentConfig/Writer/PhpFormatter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php index 9677cebfc6f9..f9a4067e8b75 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php @@ -80,9 +80,9 @@ private function formatData($data, $comments = [], $prefix = ' ') */ private function varExportShort($var, int $depth = 0) { - if(null === $var){ + if (null === $var) { return 'null'; - }elseif (!is_array($var)) { + } elseif (!is_array($var)) { return var_export($var, true); } From a99014e3ef132ecf8f7949b6411760c07678f9cc Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Fri, 19 Jul 2019 16:09:09 +0300 Subject: [PATCH 154/230] magento/magento2#23789: CommentLevelsSniff works incorrect with @magento_import statement. --- .../Sniffs/Less/CommentLevelsSniff.php | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/dev/tests/static/framework/Magento/Sniffs/Less/CommentLevelsSniff.php b/dev/tests/static/framework/Magento/Sniffs/Less/CommentLevelsSniff.php index 41c970d4cb49..6ce6b2a5c0f6 100644 --- a/dev/tests/static/framework/Magento/Sniffs/Less/CommentLevelsSniff.php +++ b/dev/tests/static/framework/Magento/Sniffs/Less/CommentLevelsSniff.php @@ -5,8 +5,8 @@ */ namespace Magento\Sniffs\Less; -use PHP_CodeSniffer\Sniffs\Sniff; use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Sniffs\Sniff; /** * Class CommentLevelsSniff @@ -72,14 +72,7 @@ public function process(File $phpcsFile, $stackPtr) return; } - // validation of levels comments - if (!in_array($tokens[$stackPtr + 1]['content'], [ - TokenizerSymbolsInterface::DOUBLE_WHITESPACE, - TokenizerSymbolsInterface::NEW_LINE, - ]) - ) { - $phpcsFile->addError('Level\'s comment does not have 2 spaces after "//"', $stackPtr, 'SpacesMissed'); - } + $this->validateCommentLevel($phpcsFile, $stackPtr, $tokens); if (!$this->isNthLevelComment($phpcsFile, $stackPtr, $tokens)) { return; @@ -195,4 +188,27 @@ private function checkNthLevelComment(File $phpcsFile, $stackPtr, array $tokens) return $correct; } + + /** + * Validation of comment level. + * + * @param File $phpcsFile + * @param int $stackPtr + * @param array $tokens + */ + private function validateCommentLevel(File $phpcsFile, int $stackPtr, array $tokens): void + { + if ($tokens[$stackPtr + 2]['content'] !== 'magento_import' && + !in_array( + $tokens[$stackPtr + 1]['content'], + [ + TokenizerSymbolsInterface::DOUBLE_WHITESPACE, + TokenizerSymbolsInterface::NEW_LINE, + ], + true + ) + ) { + $phpcsFile->addError('Level\'s comment does not have 2 spaces after "//"', $stackPtr, 'SpacesMissed'); + } + } } From 4a612c0aaaf6a68f69148c05b59461f8fa873e4b Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Fri, 19 Jul 2019 16:49:03 +0200 Subject: [PATCH 155/230] MC-16192: Fixes for static test --- app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index 51ad1c25e148..571443fd1e3d 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -167,13 +167,13 @@ class Storage extends \Magento\Framework\DataObject * @param \Magento\MediaStorage\Model\File\Storage\DatabaseFactory $storageDatabaseFactory * @param \Magento\MediaStorage\Model\File\Storage\Directory\DatabaseFactory $directoryDatabaseFactory * @param \Magento\MediaStorage\Model\File\UploaderFactory $uploaderFactory - * @param \Psr\Log\LoggerInterface|null $logger * @param array $resizeParameters * @param array $extensions * @param array $dirs * @param array $data * @param \Magento\Framework\Filesystem\DriverInterface $file * @param \Magento\Framework\Filesystem\Io\File|null $ioFile + * @param \Psr\Log\LoggerInterface|null $logger * * @throws \Magento\Framework\Exception\FileSystemException * @SuppressWarnings(PHPMD.ExcessiveParameterList) From f02f393f47748f2e621b08b0a081249cb3ea61cc Mon Sep 17 00:00:00 2001 From: vital_pantsialeyeu <vital_pantsialeyeu@epam.com> Date: Fri, 19 Jul 2019 19:14:10 +0300 Subject: [PATCH 156/230] MC-17387: Fatal error appears when adding bundle product to Cart from Wish list page - Added stories for test annotations --- .../Test/AdminAddBundleProductToCartFromWishListPageTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml index 76a2c4c739e0..2a4b119a5cab 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddBundleProductToCartFromWishListPageTest.xml @@ -10,6 +10,7 @@ <test name="AdminAddBundleProductToCartFromWishListPageTest"> <annotations> <features value="Catalog"/> + <stories value="Add bundle product to Cart"/> <title value="Add bundle product to Cart from Wish list page"/> <description value="Add bundle product to Cart from Wish list page"/> <severity value="MAJOR"/> From 5f5ac27de933691d42f57c694262edeabc5df396 Mon Sep 17 00:00:00 2001 From: Andrii Dimov <adimov@adobe.com> Date: Fri, 19 Jul 2019 11:21:36 -0500 Subject: [PATCH 157/230] MC-18321: Remove usage of page_cache/block/render controller in performance test --- setup/performance-toolkit/benchmark.jmx | 69 ------------------------- 1 file changed, 69 deletions(-) diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx index e92c0bd73812..1fa61c21d800 100644 --- a/setup/performance-toolkit/benchmark.jmx +++ b/setup/performance-toolkit/benchmark.jmx @@ -2478,75 +2478,6 @@ if (props.get("cms_pages") == null) { <stringProp name="HTTPSampler.embedded_url_re"/> <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/warmup_add_to_cart.jmx</stringProp></HTTPSamplerProxy> <hashTree/> - - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="SetUp - Ajax Load Login Form" enabled="true"> - <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true"> - <collectionProp name="Arguments.arguments"> - <elementProp name="blocks" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">["customer_form_login"]</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">blocks</stringProp> - </elementProp> - <elementProp name="handles" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">["default","customer_account_login"]</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">handles</stringProp> - </elementProp> - <elementProp name="originalRequest" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">{"route":"customer","controller":"account","action":"login","uri":"/customer/account/login/"}</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">originalRequest</stringProp> - </elementProp> - <elementProp name="ajax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">ajax</stringProp> - </elementProp> - <elementProp name="isAjax" elementType="HTTPArgument"> - <boolProp name="HTTPArgument.always_encode">true</boolProp> - <stringProp name="Argument.value">true</stringProp> - <stringProp name="Argument.metadata">=</stringProp> - <boolProp name="HTTPArgument.use_equals">true</boolProp> - <stringProp name="Argument.name">isAjax</stringProp> - </elementProp> - </collectionProp> - </elementProp> - <stringProp name="HTTPSampler.domain"/> - <stringProp name="HTTPSampler.port"/> - <stringProp name="HTTPSampler.connect_timeout">60000</stringProp> - <stringProp name="HTTPSampler.response_timeout">200000</stringProp> - <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> - <stringProp name="HTTPSampler.contentEncoding"/> - <stringProp name="HTTPSampler.path">${base_path}page_cache/block/render/</stringProp> - <stringProp name="HTTPSampler.method">GET</stringProp> - <boolProp name="HTTPSampler.follow_redirects">true</boolProp> - <boolProp name="HTTPSampler.auto_redirects">false</boolProp> - <boolProp name="HTTPSampler.use_keepalive">true</boolProp> - <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> - <boolProp name="HTTPSampler.monitor">false</boolProp> - <stringProp name="HTTPSampler.embedded_url_re"/> - <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/setup/ajax_load_login_form.jmx</stringProp></HTTPSamplerProxy> - <hashTree> - <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true"> - <collectionProp name="Asserion.test_strings"> - <stringProp name="940598773">"customer_form_login"</stringProp> - <stringProp name="1951684663">Registered Customers</stringProp> - <stringProp name="474011748">form_key</stringProp> - </collectionProp> - <stringProp name="Assertion.test_field">Assertion.response_data</stringProp> - <boolProp name="Assertion.assume_success">false</boolProp> - <intProp name="Assertion.test_type">2</intProp> - </ResponseAssertion> - <hashTree/> - </hashTree> </hashTree> <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Frontend Pool" enabled="true"> From fb7d3aeec66ef78767bd1faf48d57711f62ec593 Mon Sep 17 00:00:00 2001 From: Andrea Parmeggiani <info@textarea.it> Date: Fri, 19 Jul 2019 18:21:50 +0200 Subject: [PATCH 158/230] Moved "Zero Subtotal Checkout" translation to Payment Module --- app/code/Magento/OfflinePayments/i18n/en_US.csv | 1 - app/code/Magento/Payment/i18n/en_US.csv | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/OfflinePayments/i18n/en_US.csv b/app/code/Magento/OfflinePayments/i18n/en_US.csv index 5a180f7af494..c5e503f4f9b6 100644 --- a/app/code/Magento/OfflinePayments/i18n/en_US.csv +++ b/app/code/Magento/OfflinePayments/i18n/en_US.csv @@ -21,5 +21,4 @@ Title,Title "Bank Transfer Payment","Bank Transfer Payment" Instructions,Instructions "Cash On Delivery Payment","Cash On Delivery Payment" -"Zero Subtotal Checkout","Zero Subtotal Checkout" "Automatically Invoice All Items","Automatically Invoice All Items" diff --git a/app/code/Magento/Payment/i18n/en_US.csv b/app/code/Magento/Payment/i18n/en_US.csv index d5a79becec22..939215e995d8 100644 --- a/app/code/Magento/Payment/i18n/en_US.csv +++ b/app/code/Magento/Payment/i18n/en_US.csv @@ -58,3 +58,4 @@ No,No "Payment Methods Section","Payment Methods Section" "Payment Services","Payment Services" "Payment Methods","Payment Methods" +"Zero Subtotal Checkout","Zero Subtotal Checkout" From 1d419dc795b4105e6a35434873ab2efce0b7072b Mon Sep 17 00:00:00 2001 From: Gabriel Fernandes <gfernandes410@gmail.com> Date: Fri, 19 Jul 2019 13:46:29 -0300 Subject: [PATCH 159/230] Remove duplicate declaration On line 33 and 37 there is a duplicate declaration of $this->formKey. --- app/code/Magento/Backend/Block/Page/RequireJs.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Backend/Block/Page/RequireJs.php b/app/code/Magento/Backend/Block/Page/RequireJs.php index 0a8e9c11ec69..7fac44068a3f 100644 --- a/app/code/Magento/Backend/Block/Page/RequireJs.php +++ b/app/code/Magento/Backend/Block/Page/RequireJs.php @@ -29,7 +29,6 @@ public function __construct( \Magento\Framework\Data\Form\FormKey $formKey, array $data = [] ) { - $this->formKey = $formKey; parent::__construct( $context, $data From 145c7b24634c235a1489739426d1dc828e4892c7 Mon Sep 17 00:00:00 2001 From: Roman Lytvynenko <lytvynen@adobe.com> Date: Fri, 19 Jul 2019 12:18:51 -0500 Subject: [PATCH 160/230] MC-18094: Full page cache issue with non-default store view --- .../Magento/Store/App/Action/Plugin/Context.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Store/App/Action/Plugin/Context.php b/app/code/Magento/Store/App/Action/Plugin/Context.php index 0d34179d3c63..5d324c4b468f 100644 --- a/app/code/Magento/Store/App/Action/Plugin/Context.php +++ b/app/code/Magento/Store/App/Action/Plugin/Context.php @@ -11,6 +11,7 @@ use Magento\Framework\Exception\NotFoundException; use Magento\Store\Api\Data\StoreInterface; use Magento\Store\Api\StoreCookieManagerInterface; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\Framework\App\Action\AbstractAction; use Magento\Framework\App\RequestInterface; @@ -127,14 +128,19 @@ private function processInvalidStoreRequested( * * @param StoreInterface $store * @return void + * @throws \Magento\Framework\Exception\LocalizedException */ private function updateContext(StoreInterface $store) { - $this->httpContext->setValue( - StoreManagerInterface::CONTEXT_STORE, - $store->getCode(), - $this->storeManager->getDefaultStoreView()->getCode() - ); + if (!$store->getConfig(Store::XML_PATH_STORE_IN_URL) || + $store->getId() == $this->storeManager->getDefaultStoreView()->getId() + ) { + $this->httpContext->setValue( + StoreManagerInterface::CONTEXT_STORE, + $store->getCode(), + $this->storeManager->getDefaultStoreView()->getCode() + ); + } /** @var StoreInterface $defaultStore */ $defaultStore = $this->storeManager->getWebsite()->getDefaultStore(); From edc1f335f85d94a106736570ed5fd360631709ce Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Fri, 19 Jul 2019 14:33:05 -0500 Subject: [PATCH 161/230] MC-18191: Customer cart section on reloads each web transaction --- .../Magento/Checkout/view/frontend/web/js/view/minicart.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js b/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js index 5e29fa209a64..d152f9439773 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js @@ -102,8 +102,9 @@ define([ self.isLoading(true); }); - if (cartData().website_id !== window.checkout.websiteId || - cartData().store_id !== window.checkout.storeId + if ( + cartData().website_id !== window.checkout.websiteId && + cartData().website_id !== undefined ) { customerData.reload(['cart'], false); } From 43a7392f5f449f5f62b072041b09d6fb09e2a81d Mon Sep 17 00:00:00 2001 From: Daniel Renaud <drenaud@magento.com> Date: Fri, 19 Jul 2019 14:52:10 -0500 Subject: [PATCH 162/230] MC-17015: [GraphQL] Product Categories query doesn't return all categories where product is visible --- .../Model/Resolver/Categories.php | 77 +++++++++------ .../Resolver/Product/ProductCategories.php | 97 +++++++++++++++++++ 2 files changed, 146 insertions(+), 28 deletions(-) create mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductCategories.php diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Categories.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Categories.php index cb392a7b2295..535fe3a80cd2 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Categories.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Categories.php @@ -7,6 +7,7 @@ namespace Magento\CatalogGraphQl\Model\Resolver; +use Magento\CatalogGraphQl\Model\Resolver\Product\ProductCategories; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\GraphQl\Schema\Type\ResolveInfo; use Magento\Catalog\Api\Data\CategoryInterface; @@ -18,6 +19,7 @@ use Magento\Framework\GraphQl\Query\ResolverInterface; use Magento\Framework\GraphQl\Query\Resolver\ValueFactory; use Magento\CatalogGraphQl\Model\Category\Hydrator as CategoryHydrator; +use Magento\Store\Model\StoreManagerInterface; /** * Resolver for category objects the product is assigned to. @@ -56,25 +58,41 @@ class Categories implements ResolverInterface */ private $categoryHydrator; + /** + * @var ProductCategories + */ + private $productCategories; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + /** * @param CollectionFactory $collectionFactory * @param AttributesJoiner $attributesJoiner * @param CustomAttributesFlattener $customAttributesFlattener * @param ValueFactory $valueFactory * @param CategoryHydrator $categoryHydrator + * @param ProductCategories $productCategories + * @param StoreManagerInterface $storeManager */ public function __construct( CollectionFactory $collectionFactory, AttributesJoiner $attributesJoiner, CustomAttributesFlattener $customAttributesFlattener, ValueFactory $valueFactory, - CategoryHydrator $categoryHydrator + CategoryHydrator $categoryHydrator, + ProductCategories $productCategories, + StoreManagerInterface $storeManager ) { $this->collection = $collectionFactory->create(); $this->attributesJoiner = $attributesJoiner; $this->customAttributesFlattener = $customAttributesFlattener; $this->valueFactory = $valueFactory; $this->categoryHydrator = $categoryHydrator; + $this->productCategories = $productCategories; + $this->storeManager = $storeManager; } /** @@ -90,39 +108,42 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value /** @var \Magento\Catalog\Model\Product $product */ $product = $value['model']; - $categoryIds = $product->getCategoryIds(); + $storeId = $this->storeManager->getStore()->getId(); + $categoryIds = $this->productCategories->getCategoryIdsByProduct((int)$product->getId(), (int)$storeId); $this->categoryIds = array_merge($this->categoryIds, $categoryIds); $that = $this; - return $this->valueFactory->create(function () use ($that, $categoryIds, $info) { - $categories = []; - if (empty($that->categoryIds)) { - return []; - } + return $this->valueFactory->create( + function () use ($that, $categoryIds, $info) { + $categories = []; + if (empty($that->categoryIds)) { + return []; + } - if (!$this->collection->isLoaded()) { - $that->attributesJoiner->join($info->fieldNodes[0], $this->collection); - $this->collection->addIdFilter($this->categoryIds); - } - /** @var CategoryInterface | \Magento\Catalog\Model\Category $item */ - foreach ($this->collection as $item) { - if (in_array($item->getId(), $categoryIds)) { - // Try to extract all requested fields from the loaded collection data - $categories[$item->getId()] = $this->categoryHydrator->hydrateCategory($item, true); - $categories[$item->getId()]['model'] = $item; - $requestedFields = $that->attributesJoiner->getQueryFields($info->fieldNodes[0]); - $extractedFields = array_keys($categories[$item->getId()]); - $foundFields = array_intersect($requestedFields, $extractedFields); - if (count($requestedFields) === count($foundFields)) { - continue; - } + if (!$this->collection->isLoaded()) { + $that->attributesJoiner->join($info->fieldNodes[0], $this->collection); + $this->collection->addIdFilter($this->categoryIds); + } + /** @var CategoryInterface | \Magento\Catalog\Model\Category $item */ + foreach ($this->collection as $item) { + if (in_array($item->getId(), $categoryIds)) { + // Try to extract all requested fields from the loaded collection data + $categories[$item->getId()] = $this->categoryHydrator->hydrateCategory($item, true); + $categories[$item->getId()]['model'] = $item; + $requestedFields = $that->attributesJoiner->getQueryFields($info->fieldNodes[0]); + $extractedFields = array_keys($categories[$item->getId()]); + $foundFields = array_intersect($requestedFields, $extractedFields); + if (count($requestedFields) === count($foundFields)) { + continue; + } - // If not all requested fields were extracted from the collection, start more complex extraction - $categories[$item->getId()] = $this->categoryHydrator->hydrateCategory($item); + // If not all requested fields were extracted from the collection, start more complex extraction + $categories[$item->getId()] = $this->categoryHydrator->hydrateCategory($item); + } } - } - return $categories; - }); + return $categories; + } + ); } } diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductCategories.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductCategories.php new file mode 100644 index 000000000000..736f2a8c8e40 --- /dev/null +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductCategories.php @@ -0,0 +1,97 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\CatalogGraphQl\Model\Resolver\Product; + +use Magento\Catalog\Model\Indexer\Category\Product\AbstractAction; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\Indexer\DimensionFactory; +use Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver; +use Magento\Store\Model\Group; +use Magento\Store\Model\Store; + +/** + * Get all categories where product is visible + */ +class ProductCategories +{ + /** + * @var IndexScopeResolver + */ + private $tableResolver; + + /** + * @var ResourceConnection + */ + private $resourceConnection; + + /** + * @var DimensionFactory + */ + private $dimensionFactory; + + /** + * @param IndexScopeResolver $tableResolver + * @param ResourceConnection $resourceConnection + * @param DimensionFactory $dimensionFactory + */ + public function __construct( + IndexScopeResolver $tableResolver, + ResourceConnection $resourceConnection, + DimensionFactory $dimensionFactory + ) { + $this->tableResolver = $tableResolver; + $this->resourceConnection = $resourceConnection; + $this->dimensionFactory = $dimensionFactory; + } + + /** + * Get category ids for product + * + * @param int $productId + * @param int $storeId + * @return array + */ + public function getCategoryIdsByProduct(int $productId, int $storeId) + { + $connection = $this->resourceConnection->getConnection(); + $categoryProductTable = $this->getCatalogCategoryProductTableName($storeId); + $storeTable = $this->resourceConnection->getTableName(Store::ENTITY); + $storeGroupTable = $this->resourceConnection->getTableName(Group::ENTITY); + + $select = $connection->select() + ->from(['cat_index' => $categoryProductTable], ['category_id']) + ->joinInner(['store' => $storeTable], $connection->quoteInto('store.store_id = ?', $storeId), []) + ->joinInner( + ['store_group' => $storeGroupTable], + 'store.group_id = store_group.group_id AND cat_index.category_id != store_group.root_category_id', + [] + ) + ->where('product_id = ?', $productId); + + $categoryIds = $connection->fetchCol($select); + + return $categoryIds; + } + + /** + * Get catalog_product_category table name + * + * @param int $storeId + * @return string + */ + private function getCatalogCategoryProductTableName(int $storeId) + { + $dimension = $this->dimensionFactory->create(Store::ENTITY, (string)$storeId); + $tableName = $this->tableResolver->resolve( + AbstractAction::MAIN_INDEX_TABLE, + [$dimension] + ); + + return $tableName; + } +} From 5edb053e1b8a68866102d856336f823e475b57d1 Mon Sep 17 00:00:00 2001 From: Roman Lytvynenko <lytvynen@adobe.com> Date: Fri, 19 Jul 2019 17:03:52 -0500 Subject: [PATCH 163/230] MC-18094: Full page cache issue with non-default store view --- .../Store/App/Action/Plugin/Context.php | 2 +- .../ContextNonDefaultStoreDirectLinkTest.php | 155 ++++++++++++++++++ 2 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php diff --git a/app/code/Magento/Store/App/Action/Plugin/Context.php b/app/code/Magento/Store/App/Action/Plugin/Context.php index 5d324c4b468f..44f6f681fbf0 100644 --- a/app/code/Magento/Store/App/Action/Plugin/Context.php +++ b/app/code/Magento/Store/App/Action/Plugin/Context.php @@ -133,7 +133,7 @@ private function processInvalidStoreRequested( private function updateContext(StoreInterface $store) { if (!$store->getConfig(Store::XML_PATH_STORE_IN_URL) || - $store->getId() == $this->storeManager->getDefaultStoreView()->getId() + $store->getCode() == $this->storeManager->getDefaultStoreView()->getCode() ) { $this->httpContext->setValue( StoreManagerInterface::CONTEXT_STORE, diff --git a/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php b/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php new file mode 100644 index 000000000000..422aa7d2de67 --- /dev/null +++ b/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php @@ -0,0 +1,155 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Store\Test\Unit\App\Action\Plugin; + +use Magento\Framework\App\Action\AbstractAction; +use Magento\Framework\App\Http\Context; +use Magento\Framework\App\Http\Context as HttpContext; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\Session\Generic; +use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\Store\Api\StoreCookieManagerInterface; +use Magento\Store\Model\Store; +use Magento\Store\Model\StoreManagerInterface; +use Magento\Store\Model\Website; +use PHPUnit\Framework\TestCase; + +/** + * Class ContextNonDefaultStoreDirectLinkTest + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class ContextNonDefaultStoreDirectLinkTest extends TestCase +{ + const CURRENCY_SESSION = 'CNY'; + const CURRENCY_DEFAULT = 'USD'; + const CURRENCY_CURRENT_STORE = 'UAH'; + + /** + * @dataProvider cacheHitOnDirectLinkToNonDefaultStoreView + * @param $customStore + * @param $defaultStore + * @param $setValueNumberOfTimes + * @param $xmlPathStoreInUrl + * @return void + */ + public function testCacheHitOnDirectLinkToNonDefaultStoreView( + $customStore, + $defaultStore, + $setValueNumberOfTimes, + $xmlPathStoreInUrl + ) { + $sessionMock = $this->createPartialMock(Generic::class, ['getCurrencyCode']); + $httpContextMock = $this->createMock(HttpContext::class); + $storeManager = $this->createMock(StoreManagerInterface::class); + $storeCookieManager = $this->createMock(StoreCookieManagerInterface::class); + $storeMock = $this->createMock(Store::class); + $currentStoreMock = $this->createMock(Store::class); + $requestMock = $this->getMockBuilder(RequestInterface::class)->getMockForAbstractClass(); + $subjectMock = $this->getMockBuilder(AbstractAction::class) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $httpContextMock->expects($this->once()) + ->method('getValue') + ->with(StoreManagerInterface::CONTEXT_STORE) + ->willReturn(null); + $websiteMock = $this->createPartialMock( + Website::class, + ['getDefaultStore', '__wakeup'] + ); + + $plugin = (new ObjectManager($this))->getObject( + \Magento\Store\App\Action\Plugin\Context::class, + [ + 'session' => $sessionMock, + 'httpContext' => $httpContextMock, + 'storeManager' => $storeManager, + 'storeCookieManager' => $storeCookieManager, + ] + ); + + $storeManager->method('getDefaultStoreView') + ->willReturn($storeMock); + + $storeCookieManager->expects($this->once()) + ->method('getStoreCodeFromCookie') + ->willReturn('storeCookie'); + + $currentStoreMock->expects($this->any()) + ->method('getDefaultCurrencyCode') + ->willReturn(self::CURRENCY_CURRENT_STORE); + + $currentStoreMock->expects($this->any()) + ->method('getConfig') + ->willReturn($xmlPathStoreInUrl); + + $currentStoreMock->expects($this->any()) + ->method('getCode') + ->willReturn($customStore); + + $storeManager->expects($this->any()) + ->method('getWebsite') + ->willReturn($websiteMock); + + $websiteMock->expects($this->any()) + ->method('getDefaultStore') + ->willReturn($storeMock); + + $storeMock->expects($this->any()) + ->method('getDefaultCurrencyCode') + ->willReturn(self::CURRENCY_DEFAULT); + + $storeMock->expects($this->any()) + ->method('getCode') + ->willReturn($defaultStore); + + $requestMock->expects($this->any()) + ->method('getParam') + ->with($this->equalTo('___store')) + ->willReturn($defaultStore); + + $storeManager->method('getStore') + ->with($defaultStore) + ->willReturn($currentStoreMock); + + $sessionMock->expects($this->any()) + ->method('getCurrencyCode') + ->willReturn(self::CURRENCY_SESSION); + + $httpContextMock->expects($this->exactly($setValueNumberOfTimes)) + ->method('setValue'); + + $plugin->beforeDispatch( + $subjectMock, + $requestMock + ); + } + + public function cacheHitOnDirectLinkToNonDefaultStoreView() + { + return [ + [ + 'custom_store', + 'default', + 1, + 1 + ], + [ + 'default', + 'default', + 2, + 0 + ], + [ + 'default', + 'default', + 2, + 1 + ], + ]; + } +} From 4954bd1f9f80fe0d725569602a40ba5f250a4dae Mon Sep 17 00:00:00 2001 From: Eden <quocviet312@gmail.com> Date: Sat, 20 Jul 2019 07:59:59 +0700 Subject: [PATCH 164/230] Resolve "Discount Amount" field is validated after the page load without any action from user in Create New Catalog Rule form issue23777 --- .../view/adminhtml/ui_component/catalog_rule_form.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml index 8174434a06c4..c114f6b1d77c 100644 --- a/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml +++ b/app/code/Magento/CatalogRule/view/adminhtml/ui_component/catalog_rule_form.xml @@ -307,6 +307,7 @@ <settings> <validation> <rule name="required-entry" xsi:type="boolean">true</rule> + <rule name="validate-number-range" xsi:type="string">0.00-100.00</rule> </validation> <dataType>text</dataType> <label translate="true">Discount Amount</label> From d56257230757b56120ea07bfce51d0a4a94b3afb Mon Sep 17 00:00:00 2001 From: Eden <quocviet312@gmail.com> Date: Sat, 20 Jul 2019 22:23:06 +0700 Subject: [PATCH 165/230] Resolve Toggle icon not working in create configuration Product creation Page issue 22702 --- .../web/css/source/module/main/_collapsible-blocks.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less index bdc986e918c2..51a939cae1a5 100644 --- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less +++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less @@ -122,6 +122,11 @@ &:before { content: @icon-expand-close__content; } + &.active { + &:before { + content: @icon-expand-open__content; + } + } } } From 055dcf68d6d75361dc2aba2fdc59c5f0d06b8be2 Mon Sep 17 00:00:00 2001 From: DmytroPaidych <dimonovp@gmail.com> Date: Mon, 22 Jul 2019 11:26:01 +0300 Subject: [PATCH 166/230] MC-3085: Customer can change product options using swatches --- .../StorefrontProductInfoMainSection.xml | 1 + ...ithSwatchAttributeToTheCartActionGroup.xml | 35 ++++++++++++ .../StorefrontProductInfoMainSection.xml | 1 + ...nChangeProductOptionsUsingSwatchesTest.xml | 53 +++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml create mode 100644 app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontProductInfoMainSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontProductInfoMainSection.xml index 95929401620b..29a1b72947c0 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontProductInfoMainSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontProductInfoMainSection.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="StorefrontProductInfoMainSection"> <element name="AddToCart" type="button" selector="#product-addtocart-button"/> + <element name="updateCart" type="button" selector="#product-updatecart-button" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml new file mode 100644 index 000000000000..9bd58bff69e5 --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchAttributeToTheCartActionGroup.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <!-- Add Configurable Product with Swatch attribute to the cart --> + <actionGroup name="StorefrontAddProductWithSwatchesToTheCartActionGroup" extends="StorefrontAddProductToCartWithQtyActionGroup"> + <arguments> + <argument name="product"/> + <argument name="productOption" type="string"/> + </arguments> + <remove keyForRemoval="seeSuccessSaveMessage"/> + <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" after="waitForStorefrontProductPageLoad" stepKey="clickSelectOption"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." after="waitForSuccessMessage" stepKey="seeAddToCartSuccessMessage"/> + </actionGroup> + + <!-- Update Configurable Product with Swatch attribute in the cart --> + <actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatches"> + <arguments> + <argument name="product"/> + <argument name="productOption" type="string"/> + </arguments> + <click selector="{{CheckoutCartProductSection.nthEditButton('1')}}" stepKey="clickEditConfigurableProductButton"/> + <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> + <click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" stepKey="changeSwatchAttributeOption"/> + <click selector="{{StorefrontProductInfoMainSection.updateCart}}" stepKey="clickUpdateCartButton"/> + <waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> + <see selector="{{StorefrontMessagesSection.success}}" userInput="{{product.name}} was updated in your shopping cart." stepKey="assertSuccessMessage"/> + </actionGroup> +</actionGroups> \ No newline at end of file diff --git a/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml b/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml index 4290ddbbd8dd..6fdf2276f39d 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml @@ -15,5 +15,6 @@ <element name="swatchAttributeOptions" type="text" selector="div.swatch-attribute-options"/> <element name="nthSwatchOptionText" type="button" selector="div.swatch-option.text:nth-of-type({{n}})" parameterized="true"/> <element name="productSwatch" type="button" selector="//div[@class='swatch-option'][@aria-label='{{var1}}']" parameterized="true"/> + <element name="visualSwatchOption" type="button" selector=".swatch-option[option-tooltip-value='#{{visualSwatchOption}}']" parameterized="true"/> </section> </sections> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml new file mode 100644 index 000000000000..f5bcccd4aa9b --- /dev/null +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest.xml @@ -0,0 +1,53 @@ +<?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="StorefrontCustomerCanChangeProductOptionsUsingSwatchesTest" extends="AdminCreateVisualSwatchTest"> + <annotations> + <features value="Swatches"/> + <stories value="Swatches"/> + <title value="Customer can change product options using swatches"/> + <description value="Customer can change product options using swatches"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-3085"/> + <group value="swatches"/> + </annotations> + <before> + <createData entity="Simple_US_Customer" after="createCategory" stepKey="createCustomer"/> + </before> + <after> + <deleteData createDataKey="createCustomer" before="goToProductAttributes" stepKey="deleteCustomer"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" after="deleteCustomer" stepKey="logoutFromCustomer"/> + </after> + + <!-- Remove steps that are not used for this test --> + <remove keyForRemoval="assertSwatch4"/> + <remove keyForRemoval="assertSwatch5"/> + <remove keyForRemoval="assertSwatch6"/> + + <!-- Login to storefront from customer --> + <actionGroup ref="LoginToStorefrontActionGroup" before="amOnProductPage" stepKey="loginCustomer"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <!-- Add configurable product with swatch attribute to the cart --> + <actionGroup ref="StorefrontAddProductWithSwatchesToTheCartActionGroup" stepKey="addConfigurableProductToTheCart"> + <argument name="productQty" value="1"/> + <argument name="product" value="_defaultProduct"/> + <argument name="productOption" value="3498db"/> + </actionGroup> + + <!-- Go to shopping cart and update option of configurable product --> + <amOnPage url="{{CheckoutCartPage.url}}" stepKey="openShoppingCartPage"/> + <actionGroup ref="StorefrontUpdateCartConfigurableProductWithSwatches" stepKey="updateConfigurableProductInTheCart"> + <argument name="product" value="_defaultProduct"/> + <argument name="productOption" value="e74d3c"/> + </actionGroup> + </test> +</tests> From b2836aacf67d704a0eea8368cedc09aad37f353d Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Mon, 22 Jul 2019 15:24:58 +0300 Subject: [PATCH 167/230] MC-18250: "Phone Number" field is not marked as required --- app/code/Magento/Customer/Block/Address/Edit.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Customer/Block/Address/Edit.php b/app/code/Magento/Customer/Block/Address/Edit.php index afefb1138dea..ef9937a0cde8 100644 --- a/app/code/Magento/Customer/Block/Address/Edit.php +++ b/app/code/Magento/Customer/Block/Address/Edit.php @@ -5,7 +5,8 @@ */ namespace Magento\Customer\Block\Address; -use Magento\Framework\Exception\LocalizedException; +use Magento\Customer\Api\AddressMetadataInterface; +use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\NoSuchEntityException; /** @@ -48,7 +49,7 @@ class Edit extends \Magento\Directory\Block\Data protected $dataObjectHelper; /** - * @var \Magento\Customer\Api\AddressMetadataInterface + * @var AddressMetadataInterface */ private $addressMetadata; @@ -67,7 +68,7 @@ class Edit extends \Magento\Directory\Block\Data * @param \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer * @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper * @param array $data - * @param \Magento\Customer\Api\AddressMetadataInterface|null $addressMetadata + * @param AddressMetadataInterface|null $addressMetadata * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ @@ -84,14 +85,14 @@ public function __construct( \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer, \Magento\Framework\Api\DataObjectHelper $dataObjectHelper, array $data = [], - \Magento\Customer\Api\AddressMetadataInterface $addressMetadata = null + AddressMetadataInterface $addressMetadata = null ) { $this->_customerSession = $customerSession; $this->_addressRepository = $addressRepository; $this->addressDataFactory = $addressDataFactory; $this->currentCustomer = $currentCustomer; $this->dataObjectHelper = $dataObjectHelper; - $this->addressMetadata = $addressMetadata; + $this->addressMetadata = $addressMetadata ?: ObjectManager::getInstance()->get(AddressMetadataInterface::class); parent::__construct( $context, $directoryHelper, From d60a29b85b890fadcfd10ceed05537d66b7dcd70 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <engcom-vendorworker-foxtrot@adobe.com> Date: Mon, 22 Jul 2019 15:48:02 +0300 Subject: [PATCH 168/230] magento/magento2#23787: Static tests fix. --- .../Framework/App/DeploymentConfig/Writer/PhpFormatter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php index f9a4067e8b75..4ae1bca2fefb 100644 --- a/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php +++ b/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php @@ -18,10 +18,11 @@ class PhpFormatter implements FormatterInterface /** * Format deployment configuration. + * * If $comments is present, each item will be added * as comment to the corresponding section * - * {@inheritdoc} + * @inheritdoc */ public function format($data, array $comments = []) { @@ -71,6 +72,8 @@ private function formatData($data, $comments = [], $prefix = ' ') } /** + * Format generated config files using the short array syntax. + * * If variable to export is an array, format with the php >= 5.4 short array syntax. Otherwise use * default var_export functionality. * From ef1690b7fa0fbda12d1d0576b94889750bb9a0ae Mon Sep 17 00:00:00 2001 From: Roman Lytvynenko <lytvynen@adobe.com> Date: Mon, 22 Jul 2019 08:17:50 -0500 Subject: [PATCH 169/230] MC-18094: Full page cache issue with non-default store view --- .../Plugin/ContextNonDefaultStoreDirectLinkTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php b/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php index 422aa7d2de67..13f5adf1687f 100644 --- a/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php +++ b/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php @@ -3,15 +3,18 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +declare(strict_types=1); + namespace Magento\Store\Test\Unit\App\Action\Plugin; use Magento\Framework\App\Action\AbstractAction; -use Magento\Framework\App\Http\Context; use Magento\Framework\App\Http\Context as HttpContext; use Magento\Framework\App\RequestInterface; use Magento\Framework\Session\Generic; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Store\Api\StoreCookieManagerInterface; +use Magento\Store\App\Action\Plugin\Context; use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\Store\Model\Website; @@ -29,6 +32,8 @@ class ContextNonDefaultStoreDirectLinkTest extends TestCase const CURRENCY_CURRENT_STORE = 'UAH'; /** + * Test for full page cache hits from new http clients if store context was specified in the URL + * * @dataProvider cacheHitOnDirectLinkToNonDefaultStoreView * @param $customStore * @param $defaultStore @@ -57,13 +62,14 @@ public function testCacheHitOnDirectLinkToNonDefaultStoreView( ->method('getValue') ->with(StoreManagerInterface::CONTEXT_STORE) ->willReturn(null); + $websiteMock = $this->createPartialMock( Website::class, ['getDefaultStore', '__wakeup'] ); $plugin = (new ObjectManager($this))->getObject( - \Magento\Store\App\Action\Plugin\Context::class, + Context::class, [ 'session' => $sessionMock, 'httpContext' => $httpContextMock, From c612af71cc48402d570079b255a45370e18d1b3c Mon Sep 17 00:00:00 2001 From: roettigl <l.roettig@techdivision.com> Date: Mon, 22 Jul 2019 17:24:48 +0200 Subject: [PATCH 170/230] MC-18133: Fix for BC Changes --- .../Form/Modifier/AbstractModifier.php | 3 + app/code/Magento/Theme/Helper/Storage.php | 2 +- .../Test/Unit/Model/Wysiwyg/StorageTest.php | 572 ------------------ 3 files changed, 4 insertions(+), 573 deletions(-) delete mode 100644 app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php index b9a959f88584..8338e898b763 100644 --- a/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php +++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AbstractModifier.php @@ -11,6 +11,9 @@ /** * Class AbstractModifier * + * phpcs:disable Magento2.Classes.AbstractApi + * @api + * * @SuppressWarnings(PHPMD.NumberOfChildren) * @since 101.0.0 */ diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index 81e34e986dee..e41bc8b145e3 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -96,7 +96,7 @@ class Storage extends \Magento\Framework\App\Helper\AbstractHelper /** * @var \Magento\Framework\Filesystem\Io\File */ - protected $file; + private $file; /** * @param \Magento\Framework\App\Helper\Context $context diff --git a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php deleted file mode 100644 index 6bc855275613..000000000000 --- a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php +++ /dev/null @@ -1,572 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * Storage model test - */ -namespace Magento\Theme\Test\Unit\Model\Wysiwyg; - -/** - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class StorageTest extends \PHPUnit\Framework\TestCase -{ - /** - * @var string - */ - protected $_storageRoot; - - /** - * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_filesystem; - - /** - * @var \Magento\Theme\Helper\Storage|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_helperStorage; - - /** - * @var \Magento\Framework\ObjectManagerInterface - */ - protected $_objectManager; - - /** - * @var null|\Magento\Theme\Model\Wysiwyg\Storage - */ - protected $_storageModel; - - /** - * @var \Magento\Framework\Image\AdapterFactory|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_imageFactory; - - /** - * @var \Magento\Framework\Filesystem\Directory\Write|\PHPUnit_Framework_MockObject_MockObject - */ - protected $directoryWrite; - - /** - * @var \Magento\Framework\Url\EncoderInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $urlEncoder; - - /** - * @var \Magento\Framework\Url\DecoderInterface|\PHPUnit_Framework_MockObject_MockObject - */ - protected $urlDecoder; - - protected function setUp() - { - $this->_filesystem = $this->createMock(\Magento\Framework\Filesystem::class); - - $file = $this->createPartialMock(\Magento\Framework\Filesystem\Io\File::class, ['getPathInfo']); - - $file->expects($this->any()) - ->method('getPathInfo') - ->will( - $this->returnCallback( - function ($path) { - return pathinfo($path); - } - ) - ); - - $this->_helperStorage = $this->createPartialMock( - \Magento\Theme\Helper\Storage::class, - [ - 'urlEncode', - 'getStorageType', - 'getCurrentPath', - 'getStorageRoot', - 'getShortFilename', - 'getSession', - 'convertPathToId', - 'getRequestParams' - ] - ); - - $reflection = new \ReflectionClass($this->_helperStorage); - $reflection_property = $reflection->getProperty('file'); - $reflection_property->setAccessible(true); - $reflection_property->setValue($this->_helperStorage, $file); - - $this->_objectManager = $this->createMock(\Magento\Framework\ObjectManagerInterface::class); - $this->_imageFactory = $this->createMock(\Magento\Framework\Image\AdapterFactory::class); - $this->directoryWrite = $this->createMock(\Magento\Framework\Filesystem\Directory\Write::class); - $this->urlEncoder = $this->createPartialMock(\Magento\Framework\Url\EncoderInterface::class, ['encode']); - $this->urlDecoder = $this->createPartialMock(\Magento\Framework\Url\DecoderInterface::class, ['decode']); - - $this->_filesystem->expects( - $this->once() - )->method( - 'getDirectoryWrite' - )->will( - $this->returnValue($this->directoryWrite) - ); - - $this->_storageModel = new \Magento\Theme\Model\Wysiwyg\Storage( - $this->_filesystem, - $this->_helperStorage, - $this->_objectManager, - $this->_imageFactory, - $this->urlEncoder, - $this->urlDecoder - ); - - $this->_storageRoot = '/root'; - } - - protected function tearDown() - { - $this->_filesystem = null; - $this->_helperStorage = null; - $this->_objectManager = null; - $this->_storageModel = null; - $this->_storageRoot = null; - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::_createThumbnail - * cover \Magento\Theme\Model\Wysiwyg\Storage::uploadFile - */ - public function testUploadFile() - { - $uploader = $this->_prepareUploader(); - - $uploader->expects($this->once())->method('save')->will($this->returnValue(['not_empty', 'path' => 'absPath'])); - - $this->_helperStorage->expects( - $this->any() - )->method( - 'getStorageType' - )->will( - $this->returnValue(\Magento\Theme\Model\Wysiwyg\Storage::TYPE_IMAGE) - ); - - /** Prepare filesystem */ - - $this->directoryWrite->expects($this->any())->method('isFile')->will($this->returnValue(true)); - - $this->directoryWrite->expects($this->once())->method('isReadable')->will($this->returnValue(true)); - - /** Prepare image */ - - $image = $this->createMock(\Magento\Framework\Image\Adapter\Gd2::class); - - $image->expects($this->once())->method('open')->will($this->returnValue(true)); - - $image->expects($this->once())->method('keepAspectRatio')->will($this->returnValue(true)); - - $image->expects($this->once())->method('resize')->will($this->returnValue(true)); - - $image->expects($this->once())->method('save')->will($this->returnValue(true)); - - $this->_imageFactory->expects($this->at(0))->method('create')->will($this->returnValue($image)); - - /** Prepare session */ - - $session = $this->createMock(\Magento\Backend\Model\Session::class); - - $this->_helperStorage->expects($this->any())->method('getSession')->will($this->returnValue($session)); - - $expectedResult = [ - 'not_empty' - ]; - - $this->assertEquals($expectedResult, $this->_storageModel->uploadFile($this->_storageRoot)); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::uploadFile - * @expectedException \Magento\Framework\Exception\LocalizedException - */ - public function testUploadInvalidFile() - { - $uploader = $this->_prepareUploader(); - - $uploader->expects($this->once())->method('save')->will($this->returnValue(null)); - - $this->_storageModel->uploadFile($this->_storageRoot); - } - - /** - * @return \PHPUnit_Framework_MockObject_MockObject - */ - protected function _prepareUploader() - { - $uploader = $this->createMock(\Magento\MediaStorage\Model\File\Uploader::class); - - $this->_objectManager->expects($this->once())->method('create')->will($this->returnValue($uploader)); - - $uploader->expects($this->once())->method('setAllowedExtensions')->will($this->returnValue($uploader)); - - $uploader->expects($this->once())->method('setAllowRenameFiles')->will($this->returnValue($uploader)); - - $uploader->expects($this->once())->method('setFilesDispersion')->will($this->returnValue($uploader)); - - return $uploader; - } - - /** - * @dataProvider booleanCasesDataProvider - * cover \Magento\Theme\Model\Wysiwyg\Storage::createFolder - */ - public function testCreateFolder($isWritable) - { - $newDirectoryName = 'dir1'; - $fullNewPath = $this->_storageRoot . '/' . $newDirectoryName; - - $this->directoryWrite->expects( - $this->any() - )->method( - 'isWritable' - )->with( - $this->_storageRoot - )->will( - $this->returnValue($isWritable) - ); - - $this->directoryWrite->expects( - $this->once() - )->method( - 'isExist' - )->with( - $fullNewPath - )->will( - $this->returnValue(false) - ); - - $this->_helperStorage->expects( - $this->once() - )->method( - 'getShortFilename' - )->with( - $newDirectoryName - )->will( - $this->returnValue($newDirectoryName) - ); - - $this->_helperStorage->expects( - $this->once() - )->method( - 'convertPathToId' - )->with( - $fullNewPath - )->will( - $this->returnValue($newDirectoryName) - ); - - $this->_helperStorage->expects( - $this->any() - )->method( - 'getStorageRoot' - )->will( - $this->returnValue($this->_storageRoot) - ); - - $expectedResult = [ - 'name' => $newDirectoryName, - 'short_name' => $newDirectoryName, - 'path' => '/' . $newDirectoryName, - 'id' => $newDirectoryName, - ]; - - $this->assertEquals( - $expectedResult, - $this->_storageModel->createFolder($newDirectoryName, $this->_storageRoot) - ); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::createFolder - * @expectedException \Magento\Framework\Exception\LocalizedException - */ - public function testCreateFolderWithInvalidName() - { - $newDirectoryName = 'dir2!#$%^&'; - $this->_storageModel->createFolder($newDirectoryName, $this->_storageRoot); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::createFolder - * @expectedException \Magento\Framework\Exception\LocalizedException - */ - public function testCreateFolderDirectoryAlreadyExist() - { - $newDirectoryName = 'mew'; - $fullNewPath = $this->_storageRoot . '/' . $newDirectoryName; - - $this->directoryWrite->expects( - $this->any() - )->method( - 'isWritable' - )->with( - $this->_storageRoot - )->will( - $this->returnValue(true) - ); - - $this->directoryWrite->expects( - $this->once() - )->method( - 'isExist' - )->with( - $fullNewPath - )->will( - $this->returnValue(true) - ); - - $this->_storageModel->createFolder($newDirectoryName, $this->_storageRoot); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::getDirsCollection - */ - public function testGetDirsCollection() - { - $dirs = [$this->_storageRoot . '/dir1', $this->_storageRoot . '/dir2']; - - $this->directoryWrite->expects( - $this->any() - )->method( - 'isExist' - )->with( - $this->_storageRoot - )->will( - $this->returnValue(true) - ); - - $this->directoryWrite->expects($this->once())->method('search')->will($this->returnValue($dirs)); - - $this->directoryWrite->expects($this->any())->method('isDirectory')->will($this->returnValue(true)); - - $this->assertEquals($dirs, $this->_storageModel->getDirsCollection($this->_storageRoot)); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::getDirsCollection - * @expectedException \Magento\Framework\Exception\LocalizedException - */ - public function testGetDirsCollectionWrongDirName() - { - $this->directoryWrite->expects( - $this->once() - )->method( - 'isExist' - )->with( - $this->_storageRoot - )->will( - $this->returnValue(false) - ); - - $this->_storageModel->getDirsCollection($this->_storageRoot); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::getFilesCollection - */ - public function testGetFilesCollection() - { - $this->_helperStorage->expects( - $this->once() - )->method( - 'getCurrentPath' - )->will( - $this->returnValue($this->_storageRoot) - ); - - $this->_helperStorage->expects( - $this->once() - )->method( - 'getStorageType' - )->will( - $this->returnValue(\Magento\Theme\Model\Wysiwyg\Storage::TYPE_FONT) - ); - - $this->_helperStorage->expects($this->any())->method('urlEncode')->will($this->returnArgument(0)); - - $paths = [$this->_storageRoot . '/' . 'font1.ttf', $this->_storageRoot . '/' . 'font2.ttf']; - - $this->directoryWrite->expects($this->once())->method('search')->will($this->returnValue($paths)); - - $this->directoryWrite->expects($this->any())->method('isFile')->will($this->returnValue(true)); - - $result = $this->_storageModel->getFilesCollection(); - - $this->assertCount(2, $result); - $this->assertEquals('font1.ttf', $result[0]['text']); - $this->assertEquals('font2.ttf', $result[1]['text']); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::getFilesCollection - */ - public function testGetFilesCollectionImageType() - { - $this->_helperStorage->expects( - $this->once() - )->method( - 'getCurrentPath' - )->will( - $this->returnValue($this->_storageRoot) - ); - - $this->_helperStorage->expects( - $this->once() - )->method( - 'getStorageType' - )->will( - $this->returnValue(\Magento\Theme\Model\Wysiwyg\Storage::TYPE_IMAGE) - ); - - $this->_helperStorage->expects($this->any())->method('urlEncode')->will($this->returnArgument(0)); - - $paths = [$this->_storageRoot . '/picture1.jpg']; - - $this->directoryWrite->expects($this->once())->method('search')->will($this->returnValue($paths)); - - $this->directoryWrite->expects( - $this->once() - )->method( - 'isFile' - )->with( - $this->_storageRoot . '/picture1.jpg' - )->will( - $this->returnValue(true) - ); - - $result = $this->_storageModel->getFilesCollection(); - - $this->assertCount(1, $result); - $this->assertEquals('picture1.jpg', $result[0]['text']); - $this->assertEquals('picture1.jpg', $result[0]['thumbnailParams']['file']); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::getTreeArray - */ - public function testTreeArray() - { - $currentPath = $this->_storageRoot . '/dir'; - $dirs = [$currentPath . '/dir_one', $currentPath . '/dir_two']; - - $expectedResult = [ - ['text' => pathinfo($dirs[0], PATHINFO_BASENAME), 'id' => $dirs[0], 'cls' => 'folder'], - ['text' => pathinfo($dirs[1], PATHINFO_BASENAME), 'id' => $dirs[1], 'cls' => 'folder'], - ]; - - $this->directoryWrite->expects( - $this->once() - )->method( - 'isExist' - )->with( - $currentPath - )->will( - $this->returnValue(true) - ); - - $this->directoryWrite->expects($this->once())->method('search')->will($this->returnValue($dirs)); - - $this->directoryWrite->expects($this->any())->method('isDirectory')->will($this->returnValue(true)); - - $this->_helperStorage->expects( - $this->once() - )->method( - 'getCurrentPath' - )->will( - $this->returnValue($currentPath) - ); - - $this->_helperStorage->expects($this->any())->method('getShortFilename')->will($this->returnArgument(0)); - - $this->_helperStorage->expects($this->any())->method('convertPathToId')->will($this->returnArgument(0)); - - $result = $this->_storageModel->getTreeArray(); - $this->assertEquals($expectedResult, $result); - } - - /** - * @cover \Magento\Theme\Model\Wysiwyg\Storage::deleteFile - */ - public function testDeleteFile() - { - $image = 'image.jpg'; - - $this->_helperStorage->expects($this->once()) - ->method('getCurrentPath') - ->will($this->returnValue($this->_storageRoot)); - - $this->urlDecoder->expects($this->any()) - ->method('decode') - ->with($image) - ->willReturnArgument(0); - - $this->directoryWrite->expects($this->at(0)) - ->method('getRelativePath') - ->with($this->_storageRoot) - ->willReturn($this->_storageRoot); - - $this->directoryWrite->expects($this->at(1)) - ->method('getRelativePath') - ->with($this->_storageRoot . '/' . $image) - ->willReturn($this->_storageRoot . '/' . $image); - - $this->_helperStorage->expects($this->once()) - ->method('getStorageRoot') - ->willReturn('/'); - - $this->directoryWrite->expects($this->any())->method('delete'); - $this->assertInstanceOf(\Magento\Theme\Model\Wysiwyg\Storage::class, $this->_storageModel->deleteFile($image)); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::deleteDirectory - */ - public function testDeleteDirectory() - { - $directoryPath = $this->_storageRoot . '/../root'; - - $this->_helperStorage->expects( - $this->atLeastOnce() - )->method( - 'getStorageRoot' - )->will( - $this->returnValue($this->_storageRoot) - ); - - $this->directoryWrite->expects($this->once())->method('delete')->with($directoryPath); - - $this->_storageModel->deleteDirectory($directoryPath); - } - - /** - * cover \Magento\Theme\Model\Wysiwyg\Storage::deleteDirectory - * @expectedException \Magento\Framework\Exception\LocalizedException - */ - public function testDeleteRootDirectory() - { - $directoryPath = $this->_storageRoot; - - $this->_helperStorage->expects( - $this->atLeastOnce() - )->method( - 'getStorageRoot' - )->will( - $this->returnValue($this->_storageRoot) - ); - - $this->_storageModel->deleteDirectory($directoryPath); - } - - /** - * @return array - */ - public function booleanCasesDataProvider() - { - return [[true], [false]]; - } -} From c3f2a34c20cf25abdc527895941f2688d1ce9bd3 Mon Sep 17 00:00:00 2001 From: Daniel Renaud <drenaud@magento.com> Date: Mon, 22 Jul 2019 11:59:07 -0500 Subject: [PATCH 171/230] MC-17015: [GraphQL] Product Categories query doesn't return all categories where product is visible - fix functional tests --- .../GraphQl/Catalog/ProductViewTest.php | 4 ++-- .../ConfigurableProductViewTest.php | 22 ++++++++++++------- ..._configurable_with_category_and_weight.php | 11 +++++++--- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php index e517b22ad09d..aad7319a3754 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php @@ -282,11 +282,11 @@ public function testQueryAllFieldsSimpleProduct() $this->assertWebsites($product, $response['products']['items'][0]['websites']); self::assertEquals( 'Movable Position 2', - $responseObject->getData('products/items/0/categories/1/name') + $responseObject->getData('products/items/0/categories/0/name') ); self::assertEquals( 'Filter category', - $responseObject->getData('products/items/0/categories/2/name') + $responseObject->getData('products/items/0/categories/1/name') ); $storeManager = ObjectManager::getInstance()->get(\Magento\Store\Model\StoreManagerInterface::class); self::assertEquals( diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php index da5410384627..763a6d189b48 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php @@ -300,6 +300,7 @@ private function assertConfigurableVariants($actualResponse) isset($variantArray['product']['id']), 'variant product elements don\'t contain id key' ); + $variantProductId = $variantArray['product']['id']; $indexValue = $variantArray['product']['sku']; unset($variantArray['product']['id']); $this->assertTrue( @@ -310,14 +311,19 @@ private function assertConfigurableVariants($actualResponse) /** @var \Magento\Catalog\Model\Product $childProduct */ $childProduct = $productRepository->get($indexValue); - /** @var \Magento\Catalog\Api\Data\ProductLinkInterface[] */ - $links = $childProduct->getExtensionAttributes()->getCategoryLinks(); - $this->assertCount(1, $links, "Precondition failed, incorrect number of categories."); - $id =$links[0]->getCategoryId(); - - $actualValue - = $actualResponse['variants'][$variantKey]['product']['categories'][0]; - $this->assertEquals($actualValue, ['id' => $id]); + switch( $variantProductId ){ + case 10: + $this->assertEmpty( + $actualResponse['variants'][$variantKey]['product']['categories'], + 'No category is expected for product, that not visible individually' + ); + break; + case 20: + $this->assertEquals( + $actualResponse['variants'][$variantKey]['product']['categories'][0], + ['id' => 333] + ); + } unset($variantArray['product']['categories']); $mediaGalleryEntries = $childProduct->getMediaGalleryEntries(); diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_with_category_and_weight.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_with_category_and_weight.php index b8449a829a22..413fa8be5dba 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_with_category_and_weight.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_with_category_and_weight.php @@ -19,6 +19,7 @@ \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(); require __DIR__ . '/configurable_attribute.php'; +require __DIR__ . '/../../Catalog/_files/category.php'; /** @var ProductRepositoryInterface $productRepository */ $productRepository = Bootstrap::getObjectManager() @@ -36,6 +37,10 @@ $associatedProductIds = []; $productIds = [10, 20]; array_shift($options); //remove the first option which is empty +$visibility = [ + 10 => Visibility::VISIBILITY_IN_CATALOG, + 20 => Visibility::VISIBILITY_NOT_VISIBLE, +]; foreach ($options as $option) { /** @var $product Product */ @@ -49,11 +54,11 @@ ->setSku('simple_' . $productId) ->setPrice($productId) ->setTestConfigurable($option->getValue()) - ->setVisibility(Visibility::VISIBILITY_NOT_VISIBLE) + ->setVisibility($visibility[$productId]) ->setStatus(Status::STATUS_ENABLED) ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]); $eavAttributeValues = [ - 'category_ids' => [2] + 'category_ids' => [333] ]; foreach ($eavAttributeValues as $eavCategoryAttributeCode => $eavCategoryAttributeValues) { $product->setCustomAttribute($eavCategoryAttributeCode, $eavCategoryAttributeValues); @@ -210,5 +215,5 @@ $categoryLinkManagement->assignProductToCategories( $product->getSku(), - [2] + [333] ); From 01bfe6de702fdf8e26e5e4d57d35b1bec7607f95 Mon Sep 17 00:00:00 2001 From: roettigl <l.roettig@techdivision.com> Date: Mon, 22 Jul 2019 19:01:02 +0200 Subject: [PATCH 172/230] MC-18133: Fix for BC Changes --- .../Test/Unit/Model/Wysiwyg/StorageTest.php | 572 ++++++++++++++++++ 1 file changed, 572 insertions(+) create mode 100644 app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php diff --git a/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php new file mode 100644 index 000000000000..7ca25ee2ccac --- /dev/null +++ b/app/code/Magento/Theme/Test/Unit/Model/Wysiwyg/StorageTest.php @@ -0,0 +1,572 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +/** + * Storage model test + */ +namespace Magento\Theme\Test\Unit\Model\Wysiwyg; + +/** + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class StorageTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var string + */ + protected $_storageRoot; + + /** + * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject + */ + protected $_filesystem; + + /** + * @var \Magento\Theme\Helper\Storage|\PHPUnit_Framework_MockObject_MockObject + */ + protected $_helperStorage; + + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + protected $_objectManager; + + /** + * @var null|\Magento\Theme\Model\Wysiwyg\Storage + */ + protected $_storageModel; + + /** + * @var \Magento\Framework\Image\AdapterFactory|\PHPUnit_Framework_MockObject_MockObject + */ + protected $_imageFactory; + + /** + * @var \Magento\Framework\Filesystem\Directory\Write|\PHPUnit_Framework_MockObject_MockObject + */ + protected $directoryWrite; + + /** + * @var \Magento\Framework\Url\EncoderInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $urlEncoder; + + /** + * @var \Magento\Framework\Url\DecoderInterface|\PHPUnit_Framework_MockObject_MockObject + */ + protected $urlDecoder; + + protected function setUp() + { + $this->_filesystem = $this->createMock(\Magento\Framework\Filesystem::class); + + $file = $this->createPartialMock(\Magento\Framework\Filesystem\Io\File::class, ['getPathInfo']); + + $file->expects($this->any()) + ->method('getPathInfo') + ->will( + $this->returnCallback( + function ($path) { + return pathinfo($path); + } + ) + ); + + $this->_helperStorage = $this->createPartialMock( + \Magento\Theme\Helper\Storage::class, + [ + 'urlEncode', + 'getStorageType', + 'getCurrentPath', + 'getStorageRoot', + 'getShortFilename', + 'getSession', + 'convertPathToId', + 'getRequestParams' + ] + ); + + $reflection = new \ReflectionClass(\Magento\Theme\Helper\Storage::class); + $reflection_property = $reflection->getProperty('file'); + $reflection_property->setAccessible(true); + $reflection_property->setValue($this->_helperStorage, $file); + + $this->_objectManager = $this->createMock(\Magento\Framework\ObjectManagerInterface::class); + $this->_imageFactory = $this->createMock(\Magento\Framework\Image\AdapterFactory::class); + $this->directoryWrite = $this->createMock(\Magento\Framework\Filesystem\Directory\Write::class); + $this->urlEncoder = $this->createPartialMock(\Magento\Framework\Url\EncoderInterface::class, ['encode']); + $this->urlDecoder = $this->createPartialMock(\Magento\Framework\Url\DecoderInterface::class, ['decode']); + + $this->_filesystem->expects( + $this->once() + )->method( + 'getDirectoryWrite' + )->will( + $this->returnValue($this->directoryWrite) + ); + + $this->_storageModel = new \Magento\Theme\Model\Wysiwyg\Storage( + $this->_filesystem, + $this->_helperStorage, + $this->_objectManager, + $this->_imageFactory, + $this->urlEncoder, + $this->urlDecoder + ); + + $this->_storageRoot = '/root'; + } + + protected function tearDown() + { + $this->_filesystem = null; + $this->_helperStorage = null; + $this->_objectManager = null; + $this->_storageModel = null; + $this->_storageRoot = null; + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::_createThumbnail + * cover \Magento\Theme\Model\Wysiwyg\Storage::uploadFile + */ + public function testUploadFile() + { + $uploader = $this->_prepareUploader(); + + $uploader->expects($this->once())->method('save')->will($this->returnValue(['not_empty', 'path' => 'absPath'])); + + $this->_helperStorage->expects( + $this->any() + )->method( + 'getStorageType' + )->will( + $this->returnValue(\Magento\Theme\Model\Wysiwyg\Storage::TYPE_IMAGE) + ); + + /** Prepare filesystem */ + + $this->directoryWrite->expects($this->any())->method('isFile')->will($this->returnValue(true)); + + $this->directoryWrite->expects($this->once())->method('isReadable')->will($this->returnValue(true)); + + /** Prepare image */ + + $image = $this->createMock(\Magento\Framework\Image\Adapter\Gd2::class); + + $image->expects($this->once())->method('open')->will($this->returnValue(true)); + + $image->expects($this->once())->method('keepAspectRatio')->will($this->returnValue(true)); + + $image->expects($this->once())->method('resize')->will($this->returnValue(true)); + + $image->expects($this->once())->method('save')->will($this->returnValue(true)); + + $this->_imageFactory->expects($this->at(0))->method('create')->will($this->returnValue($image)); + + /** Prepare session */ + + $session = $this->createMock(\Magento\Backend\Model\Session::class); + + $this->_helperStorage->expects($this->any())->method('getSession')->will($this->returnValue($session)); + + $expectedResult = [ + 'not_empty' + ]; + + $this->assertEquals($expectedResult, $this->_storageModel->uploadFile($this->_storageRoot)); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::uploadFile + * @expectedException \Magento\Framework\Exception\LocalizedException + */ + public function testUploadInvalidFile() + { + $uploader = $this->_prepareUploader(); + + $uploader->expects($this->once())->method('save')->will($this->returnValue(null)); + + $this->_storageModel->uploadFile($this->_storageRoot); + } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject + */ + protected function _prepareUploader() + { + $uploader = $this->createMock(\Magento\MediaStorage\Model\File\Uploader::class); + + $this->_objectManager->expects($this->once())->method('create')->will($this->returnValue($uploader)); + + $uploader->expects($this->once())->method('setAllowedExtensions')->will($this->returnValue($uploader)); + + $uploader->expects($this->once())->method('setAllowRenameFiles')->will($this->returnValue($uploader)); + + $uploader->expects($this->once())->method('setFilesDispersion')->will($this->returnValue($uploader)); + + return $uploader; + } + + /** + * @dataProvider booleanCasesDataProvider + * cover \Magento\Theme\Model\Wysiwyg\Storage::createFolder + */ + public function testCreateFolder($isWritable) + { + $newDirectoryName = 'dir1'; + $fullNewPath = $this->_storageRoot . '/' . $newDirectoryName; + + $this->directoryWrite->expects( + $this->any() + )->method( + 'isWritable' + )->with( + $this->_storageRoot + )->will( + $this->returnValue($isWritable) + ); + + $this->directoryWrite->expects( + $this->once() + )->method( + 'isExist' + )->with( + $fullNewPath + )->will( + $this->returnValue(false) + ); + + $this->_helperStorage->expects( + $this->once() + )->method( + 'getShortFilename' + )->with( + $newDirectoryName + )->will( + $this->returnValue($newDirectoryName) + ); + + $this->_helperStorage->expects( + $this->once() + )->method( + 'convertPathToId' + )->with( + $fullNewPath + )->will( + $this->returnValue($newDirectoryName) + ); + + $this->_helperStorage->expects( + $this->any() + )->method( + 'getStorageRoot' + )->will( + $this->returnValue($this->_storageRoot) + ); + + $expectedResult = [ + 'name' => $newDirectoryName, + 'short_name' => $newDirectoryName, + 'path' => '/' . $newDirectoryName, + 'id' => $newDirectoryName, + ]; + + $this->assertEquals( + $expectedResult, + $this->_storageModel->createFolder($newDirectoryName, $this->_storageRoot) + ); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::createFolder + * @expectedException \Magento\Framework\Exception\LocalizedException + */ + public function testCreateFolderWithInvalidName() + { + $newDirectoryName = 'dir2!#$%^&'; + $this->_storageModel->createFolder($newDirectoryName, $this->_storageRoot); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::createFolder + * @expectedException \Magento\Framework\Exception\LocalizedException + */ + public function testCreateFolderDirectoryAlreadyExist() + { + $newDirectoryName = 'mew'; + $fullNewPath = $this->_storageRoot . '/' . $newDirectoryName; + + $this->directoryWrite->expects( + $this->any() + )->method( + 'isWritable' + )->with( + $this->_storageRoot + )->will( + $this->returnValue(true) + ); + + $this->directoryWrite->expects( + $this->once() + )->method( + 'isExist' + )->with( + $fullNewPath + )->will( + $this->returnValue(true) + ); + + $this->_storageModel->createFolder($newDirectoryName, $this->_storageRoot); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::getDirsCollection + */ + public function testGetDirsCollection() + { + $dirs = [$this->_storageRoot . '/dir1', $this->_storageRoot . '/dir2']; + + $this->directoryWrite->expects( + $this->any() + )->method( + 'isExist' + )->with( + $this->_storageRoot + )->will( + $this->returnValue(true) + ); + + $this->directoryWrite->expects($this->once())->method('search')->will($this->returnValue($dirs)); + + $this->directoryWrite->expects($this->any())->method('isDirectory')->will($this->returnValue(true)); + + $this->assertEquals($dirs, $this->_storageModel->getDirsCollection($this->_storageRoot)); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::getDirsCollection + * @expectedException \Magento\Framework\Exception\LocalizedException + */ + public function testGetDirsCollectionWrongDirName() + { + $this->directoryWrite->expects( + $this->once() + )->method( + 'isExist' + )->with( + $this->_storageRoot + )->will( + $this->returnValue(false) + ); + + $this->_storageModel->getDirsCollection($this->_storageRoot); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::getFilesCollection + */ + public function testGetFilesCollection() + { + $this->_helperStorage->expects( + $this->once() + )->method( + 'getCurrentPath' + )->will( + $this->returnValue($this->_storageRoot) + ); + + $this->_helperStorage->expects( + $this->once() + )->method( + 'getStorageType' + )->will( + $this->returnValue(\Magento\Theme\Model\Wysiwyg\Storage::TYPE_FONT) + ); + + $this->_helperStorage->expects($this->any())->method('urlEncode')->will($this->returnArgument(0)); + + $paths = [$this->_storageRoot . '/' . 'font1.ttf', $this->_storageRoot . '/' . 'font2.ttf']; + + $this->directoryWrite->expects($this->once())->method('search')->will($this->returnValue($paths)); + + $this->directoryWrite->expects($this->any())->method('isFile')->will($this->returnValue(true)); + + $result = $this->_storageModel->getFilesCollection(); + + $this->assertCount(2, $result); + $this->assertEquals('font1.ttf', $result[0]['text']); + $this->assertEquals('font2.ttf', $result[1]['text']); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::getFilesCollection + */ + public function testGetFilesCollectionImageType() + { + $this->_helperStorage->expects( + $this->once() + )->method( + 'getCurrentPath' + )->will( + $this->returnValue($this->_storageRoot) + ); + + $this->_helperStorage->expects( + $this->once() + )->method( + 'getStorageType' + )->will( + $this->returnValue(\Magento\Theme\Model\Wysiwyg\Storage::TYPE_IMAGE) + ); + + $this->_helperStorage->expects($this->any())->method('urlEncode')->will($this->returnArgument(0)); + + $paths = [$this->_storageRoot . '/picture1.jpg']; + + $this->directoryWrite->expects($this->once())->method('search')->will($this->returnValue($paths)); + + $this->directoryWrite->expects( + $this->once() + )->method( + 'isFile' + )->with( + $this->_storageRoot . '/picture1.jpg' + )->will( + $this->returnValue(true) + ); + + $result = $this->_storageModel->getFilesCollection(); + + $this->assertCount(1, $result); + $this->assertEquals('picture1.jpg', $result[0]['text']); + $this->assertEquals('picture1.jpg', $result[0]['thumbnailParams']['file']); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::getTreeArray + */ + public function testTreeArray() + { + $currentPath = $this->_storageRoot . '/dir'; + $dirs = [$currentPath . '/dir_one', $currentPath . '/dir_two']; + + $expectedResult = [ + ['text' => pathinfo($dirs[0], PATHINFO_BASENAME), 'id' => $dirs[0], 'cls' => 'folder'], + ['text' => pathinfo($dirs[1], PATHINFO_BASENAME), 'id' => $dirs[1], 'cls' => 'folder'], + ]; + + $this->directoryWrite->expects( + $this->once() + )->method( + 'isExist' + )->with( + $currentPath + )->will( + $this->returnValue(true) + ); + + $this->directoryWrite->expects($this->once())->method('search')->will($this->returnValue($dirs)); + + $this->directoryWrite->expects($this->any())->method('isDirectory')->will($this->returnValue(true)); + + $this->_helperStorage->expects( + $this->once() + )->method( + 'getCurrentPath' + )->will( + $this->returnValue($currentPath) + ); + + $this->_helperStorage->expects($this->any())->method('getShortFilename')->will($this->returnArgument(0)); + + $this->_helperStorage->expects($this->any())->method('convertPathToId')->will($this->returnArgument(0)); + + $result = $this->_storageModel->getTreeArray(); + $this->assertEquals($expectedResult, $result); + } + + /** + * @cover \Magento\Theme\Model\Wysiwyg\Storage::deleteFile + */ + public function testDeleteFile() + { + $image = 'image.jpg'; + + $this->_helperStorage->expects($this->once()) + ->method('getCurrentPath') + ->will($this->returnValue($this->_storageRoot)); + + $this->urlDecoder->expects($this->any()) + ->method('decode') + ->with($image) + ->willReturnArgument(0); + + $this->directoryWrite->expects($this->at(0)) + ->method('getRelativePath') + ->with($this->_storageRoot) + ->willReturn($this->_storageRoot); + + $this->directoryWrite->expects($this->at(1)) + ->method('getRelativePath') + ->with($this->_storageRoot . '/' . $image) + ->willReturn($this->_storageRoot . '/' . $image); + + $this->_helperStorage->expects($this->once()) + ->method('getStorageRoot') + ->willReturn('/'); + + $this->directoryWrite->expects($this->any())->method('delete'); + $this->assertInstanceOf(\Magento\Theme\Model\Wysiwyg\Storage::class, $this->_storageModel->deleteFile($image)); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::deleteDirectory + */ + public function testDeleteDirectory() + { + $directoryPath = $this->_storageRoot . '/../root'; + + $this->_helperStorage->expects( + $this->atLeastOnce() + )->method( + 'getStorageRoot' + )->will( + $this->returnValue($this->_storageRoot) + ); + + $this->directoryWrite->expects($this->once())->method('delete')->with($directoryPath); + + $this->_storageModel->deleteDirectory($directoryPath); + } + + /** + * cover \Magento\Theme\Model\Wysiwyg\Storage::deleteDirectory + * @expectedException \Magento\Framework\Exception\LocalizedException + */ + public function testDeleteRootDirectory() + { + $directoryPath = $this->_storageRoot; + + $this->_helperStorage->expects( + $this->atLeastOnce() + )->method( + 'getStorageRoot' + )->will( + $this->returnValue($this->_storageRoot) + ); + + $this->_storageModel->deleteDirectory($directoryPath); + } + + /** + * @return array + */ + public function booleanCasesDataProvider() + { + return [[true], [false]]; + } +} From 2a546dd09a8f89c1e857c705682f857ae155db1d Mon Sep 17 00:00:00 2001 From: Daniel Renaud <drenaud@magento.com> Date: Mon, 22 Jul 2019 13:23:08 -0500 Subject: [PATCH 173/230] MC-17015: [GraphQL] Product Categories query doesn't return all categories where product is visible - stabilize tests --- .../testsuite/Magento/GraphQl/Catalog/ProductViewTest.php | 3 +++ .../ConfigurableProduct/ConfigurableProductViewTest.php | 7 +++++-- .../product_configurable_with_category_and_weight.php | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php index aad7319a3754..1adca29ffb05 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php @@ -15,6 +15,9 @@ use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\GraphQlAbstract; +/** + * Test products query output + */ class ProductViewTest extends GraphQlAbstract { /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php index 763a6d189b48..4729cae92717 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductViewTest.php @@ -15,6 +15,9 @@ use Magento\TestFramework\ObjectManager; use Magento\TestFramework\TestCase\GraphQlAbstract; +/** + * Test products query for configurable products + */ class ConfigurableProductViewTest extends GraphQlAbstract { /** @@ -232,7 +235,6 @@ private function assertBaseFields($product, $actualResponse) $regularPriceAmount = $priceInfo->getPrice(RegularPrice::PRICE_CODE)->getAmount(); /** @var MetadataPool $metadataPool */ $metadataPool = ObjectManager::getInstance()->get(MetadataPool::class); - // ['product_object_field_name', 'expected_value'] $assertionMap = [ ['response_field' => 'attribute_set_id', 'expected_value' => $product->getAttributeSetId()], ['response_field' => 'created_at', 'expected_value' => $product->getCreatedAt()], @@ -311,7 +313,7 @@ private function assertConfigurableVariants($actualResponse) /** @var \Magento\Catalog\Model\Product $childProduct */ $childProduct = $productRepository->get($indexValue); - switch( $variantProductId ){ + switch ($variantProductId) { case 10: $this->assertEmpty( $actualResponse['variants'][$variantKey]['product']['categories'], @@ -323,6 +325,7 @@ private function assertConfigurableVariants($actualResponse) $actualResponse['variants'][$variantKey]['product']['categories'][0], ['id' => 333] ); + break; } unset($variantArray['product']['categories']); diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_with_category_and_weight.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_with_category_and_weight.php index 413fa8be5dba..39d43ff925a0 100644 --- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_with_category_and_weight.php +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_with_category_and_weight.php @@ -38,8 +38,8 @@ $productIds = [10, 20]; array_shift($options); //remove the first option which is empty $visibility = [ - 10 => Visibility::VISIBILITY_IN_CATALOG, - 20 => Visibility::VISIBILITY_NOT_VISIBLE, + 10 => Visibility::VISIBILITY_NOT_VISIBLE, + 20 => Visibility::VISIBILITY_IN_CATALOG ]; foreach ($options as $option) { From 586cea2dac456a7843b8ed46d646688c8116edc4 Mon Sep 17 00:00:00 2001 From: Buba Suma <soumah@adobe.com> Date: Fri, 19 Jul 2019 16:57:49 -0500 Subject: [PATCH 174/230] MC-18281: Checkout order summary has wrong item count - Fix summary items count on checkout page is not consistent with settings "checkout/cart_link/use_qty" --- .../Checkout/Model/DefaultConfigProvider.php | 4 + .../Checkout/Test/Mftf/Data/ConfigData.xml | 12 +++ ...pesOfCustomOptionToTheShoppingCartTest.xml | 2 +- ...rontCheckCartAndCheckoutItemsCountTest.xml | 85 +++++++++++++++++++ .../web/js/view/summary/cart-items.js | 11 +++ .../web/template/minicart/content.html | 2 +- .../web/template/summary/cart-items.html | 2 +- 7 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml diff --git a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php index 470d4a3aca56..70352b50d8de 100644 --- a/app/code/Magento/Checkout/Model/DefaultConfigProvider.php +++ b/app/code/Magento/Checkout/Model/DefaultConfigProvider.php @@ -343,6 +343,10 @@ public function getConfig() ) ) ]; + $output['useQty'] = $this->scopeConfig->isSetFlag( + 'checkout/cart_link/use_qty', + \Magento\Store\Model\ScopeInterface::SCOPE_STORE + ); $output['activeCarriers'] = $this->getActiveCarriers(); $output['originCountryCode'] = $this->getOriginCountryCode(); $output['paymentMethods'] = $this->getPaymentMethods(); diff --git a/app/code/Magento/Checkout/Test/Mftf/Data/ConfigData.xml b/app/code/Magento/Checkout/Test/Mftf/Data/ConfigData.xml index cd9cd59d20b6..bb47a2fcc307 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Data/ConfigData.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Data/ConfigData.xml @@ -88,4 +88,16 @@ <data key="label">No</data> <data key="value">0</data> </entity> + + <!-- Checkout Config: Display Cart Summary --> + <entity name="DisplayItemsQuantities"> + <data key="path">checkout/cart_link/use_qty</data> + <data key="label">Display items quantities</data> + <data key="value">1</data> + </entity> + <entity name="DisplayUniqueItems"> + <data key="path">checkout/cart_link/use_qty</data> + <data key="label">Display number of items in cart</data> + <data key="value">0</data> + </entity> </entities> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml index 611c53dba0de..e90f69e88cec 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontAddProductWithAllTypesOfCustomOptionToTheShoppingCartTest.xml @@ -100,7 +100,7 @@ <!-- Assert Product Count in Mini Cart --> <actionGroup ref="StorefrontAssertMiniCartItemCountActionGroup" stepKey="assertProductCountAndTextInMiniCart"> <argument name="productCount" value="2"/> - <argument name="productCountText" value="1 Item in Cart"/> + <argument name="productCountText" value="2 Item in Cart"/> </actionGroup> <!--Assert Product Items in Mini cart--> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml new file mode 100644 index 000000000000..0327deaf1896 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckCartAndCheckoutItemsCountTest.xml @@ -0,0 +1,85 @@ +<?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="StorefrontCartItemsCountDisplayItemsQuantities"> + <annotations> + <stories value="Checkout order summary has wrong item count"/> + <title value="Checkout order summary has wrong item count - display items quantities"/> + <description value="Items count in shopping cart and on checkout page should be consistent with settings 'checkout/cart_link/use_qty'"/> + <testCaseId value="MC-18281"/> + <severity value="CRITICAL"/> + <group value="checkout"/> + </annotations> + + <before> + <!--Set Display Cart Summary to display items quantities--> + <magentoCLI command="config:set {{DisplayItemsQuantities.path}} {{DisplayItemsQuantities.value}}" stepKey="setDisplayCartSummary"/> + <!--Create simple product--> + <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> + <!--Create simple product--> + <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> + </before> + <after> + <deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/> + <magentoCLI command="config:set {{DisplayItemsQuantities.path}} {{DisplayItemsQuantities.value}}" stepKey="resetDisplayCartSummary"/> + </after> + + <!-- Add simpleProduct1 to cart --> + <amOnPage url="{{StorefrontProductPage.url($$simpleProduct1.custom_attributes[url_key]$)}}" stepKey="amOnProduct1Page"/> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addProduct1ToCart"> + <argument name="productName" value="$$simpleProduct1.name$$"/> + <argument name="productQty" value="2"/> + </actionGroup> + <!-- Add simpleProduct2 to cart --> + <amOnPage url="{{StorefrontProductPage.url($$simpleProduct2.custom_attributes[url_key]$)}}" stepKey="amOnProduct2Page"/> + <actionGroup ref="AddProductWithQtyToCartFromStorefrontProductPage" stepKey="addProduct2ToCart"> + <argument name="productName" value="$$simpleProduct2.name$$"/> + <argument name="productQty" value="1"/> + </actionGroup> + + <!-- Open Mini Cart --> + <actionGroup ref="StorefrontOpenMiniCartActionGroup" stepKey="openMiniCart"/> + + <!-- Assert Products Count in Mini Cart --> + <actionGroup ref="StorefrontAssertMiniCartItemCountActionGroup" stepKey="assertProductCountAndTextInMiniCart"> + <argument name="productCount" value="3"/> + <argument name="productCountText" value="3 Items in Cart"/> + </actionGroup> + <!-- Assert Products Count on checkout page --> + <actionGroup ref="StorefrontCheckoutAndAssertOrderSummaryDisplayActionGroup" stepKey="assertProductCountOnCheckoutPage"> + <argument name="itemsText" value="3 Items in Cart"/> + </actionGroup> + </test> + <test name="StorefrontCartItemsCountDisplayUniqueItems" extends="StorefrontCartItemsCountDisplayItemsQuantities"> + <annotations> + <stories value="Checkout order summary has wrong item count"/> + <title value="Checkout order summary has wrong item count - display unique items"/> + <description value="Items count in shopping cart and on checkout page should be consistent with settings 'checkout/cart_link/use_qty'"/> + <testCaseId value="MC-18281"/> + <severity value="CRITICAL"/> + <group value="checkout"/> + </annotations> + + <!-- Assert Products Count in Mini Cart --> + <actionGroup ref="StorefrontAssertMiniCartItemCountActionGroup" stepKey="assertProductCountAndTextInMiniCart"> + <argument name="productCount" value="2"/> + <argument name="productCountText" value="2 Items in Cart"/> + </actionGroup> + <!-- Assert Products Count on checkout page --> + <actionGroup ref="StorefrontCheckoutAndAssertOrderSummaryDisplayActionGroup" stepKey="assertProductCountOnCheckoutPage"> + <argument name="itemsText" value="2 Items in Cart"/> + </actionGroup> + + <before> + <!--Set Display Cart Summary to display items quantities--> + <magentoCLI command="config:set {{DisplayUniqueItems.path}} {{DisplayUniqueItems.value}}" stepKey="setDisplayCartSummary"/> + </before> + </test> +</tests> diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/cart-items.js b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/cart-items.js index 488bcfd67594..003fef9f15d3 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/cart-items.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/cart-items.js @@ -12,6 +12,8 @@ define([ ], function (ko, totals, Component, stepNavigator, quote) { 'use strict'; + var useQty = window.checkoutConfig.useQty; + return Component.extend({ defaults: { template: 'Magento_Checkout/summary/cart-items' @@ -44,6 +46,15 @@ define([ return parseInt(totals.getItems()().length, 10); }, + /** + * Returns shopping cart items summary (includes config settings) + * + * @returns {Number} + */ + getCartSummaryItemsCount: function () { + return useQty ? this.getItemsQty() : this.getCartLineItemsCount(); + }, + /** * @inheritdoc */ diff --git a/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html b/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html index fb128a891aea..0719a7d01ec7 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html @@ -29,7 +29,7 @@ <div class="items-total"> <span class="count" if="maxItemsToDisplay < getCartLineItemsCount()" text="maxItemsToDisplay"/> <translate args="'of'" if="maxItemsToDisplay < getCartLineItemsCount()"/> - <span class="count" text="getCartLineItemsCount()"/> + <span class="count" text="getCartParam('summary_count')"/> <!-- ko if: (getCartLineItemsCount() === 1) --> <span translate="'Item in Cart'"/> <!--/ko--> diff --git a/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html b/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html index fc74a4691a2e..4e49d4502d8a 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/summary/cart-items.html @@ -9,7 +9,7 @@ <strong role="heading" aria-level="1"> <translate args="maxCartItemsToDisplay" if="maxCartItemsToDisplay < getCartLineItemsCount()"/> <translate args="'of'" if="maxCartItemsToDisplay < getCartLineItemsCount()"/> - <span data-bind="text: getCartLineItemsCount()"></span> + <span data-bind="text: getCartSummaryItemsCount()"></span> <translate args="'Item in Cart'" if="getCartLineItemsCount() === 1"/> <translate args="'Items in Cart'" if="getCartLineItemsCount() > 1"/> </strong> From 438b0f0a3ab24e7a563e6543070824545de8781e Mon Sep 17 00:00:00 2001 From: Roman Lytvynenko <lytvynen@adobe.com> Date: Mon, 22 Jul 2019 16:52:45 -0500 Subject: [PATCH 175/230] MC-18094: Full page cache issue with non-default store view --- .../Store/App/Action/Plugin/Context.php | 19 ++++----- .../ContextNonDefaultStoreDirectLinkTest.php | 41 ++++++++++--------- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/app/code/Magento/Store/App/Action/Plugin/Context.php b/app/code/Magento/Store/App/Action/Plugin/Context.php index 44f6f681fbf0..b5d2e3d913f4 100644 --- a/app/code/Magento/Store/App/Action/Plugin/Context.php +++ b/app/code/Magento/Store/App/Action/Plugin/Context.php @@ -6,15 +6,14 @@ namespace Magento\Store\App\Action\Plugin; +use Magento\Framework\App\Action\AbstractAction; use Magento\Framework\App\Http\Context as HttpContext; +use Magento\Framework\App\RequestInterface; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Exception\NotFoundException; use Magento\Store\Api\Data\StoreInterface; use Magento\Store\Api\StoreCookieManagerInterface; -use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; -use Magento\Framework\App\Action\AbstractAction; -use Magento\Framework\App\RequestInterface; /** * Class ContextPlugin @@ -132,15 +131,11 @@ private function processInvalidStoreRequested( */ private function updateContext(StoreInterface $store) { - if (!$store->getConfig(Store::XML_PATH_STORE_IN_URL) || - $store->getCode() == $this->storeManager->getDefaultStoreView()->getCode() - ) { - $this->httpContext->setValue( - StoreManagerInterface::CONTEXT_STORE, - $store->getCode(), - $this->storeManager->getDefaultStoreView()->getCode() - ); - } + $this->httpContext->setValue( + StoreManagerInterface::CONTEXT_STORE, + $store->getCode(), + $store->isUseStoreInUrl() ? $store->getCode() : $this->storeManager->getDefaultStoreView()->getCode() + ); /** @var StoreInterface $defaultStore */ $defaultStore = $this->storeManager->getWebsite()->getDefaultStore(); diff --git a/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php b/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php index 13f5adf1687f..bb2705bff9aa 100644 --- a/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php +++ b/app/code/Magento/Store/Test/Unit/App/Action/Plugin/ContextNonDefaultStoreDirectLinkTest.php @@ -35,17 +35,17 @@ class ContextNonDefaultStoreDirectLinkTest extends TestCase * Test for full page cache hits from new http clients if store context was specified in the URL * * @dataProvider cacheHitOnDirectLinkToNonDefaultStoreView - * @param $customStore - * @param $defaultStore - * @param $setValueNumberOfTimes - * @param $xmlPathStoreInUrl + * @param string $customStore + * @param string $defaultStore + * @param string $expectedDefaultStore + * @param bool $useStoreInUrl * @return void */ public function testCacheHitOnDirectLinkToNonDefaultStoreView( - $customStore, - $defaultStore, - $setValueNumberOfTimes, - $xmlPathStoreInUrl + string $customStore, + string $defaultStore, + string $expectedDefaultStore, + bool $useStoreInUrl ) { $sessionMock = $this->createPartialMock(Generic::class, ['getCurrencyCode']); $httpContextMock = $this->createMock(HttpContext::class); @@ -89,14 +89,12 @@ public function testCacheHitOnDirectLinkToNonDefaultStoreView( ->method('getDefaultCurrencyCode') ->willReturn(self::CURRENCY_CURRENT_STORE); - $currentStoreMock->expects($this->any()) - ->method('getConfig') - ->willReturn($xmlPathStoreInUrl); - $currentStoreMock->expects($this->any()) ->method('getCode') ->willReturn($customStore); + $currentStoreMock->method('isUseStoreInUrl')->willReturn($useStoreInUrl); + $storeManager->expects($this->any()) ->method('getWebsite') ->willReturn($websiteMock); @@ -126,8 +124,11 @@ public function testCacheHitOnDirectLinkToNonDefaultStoreView( ->method('getCurrencyCode') ->willReturn(self::CURRENCY_SESSION); - $httpContextMock->expects($this->exactly($setValueNumberOfTimes)) - ->method('setValue'); + $httpContextMock->expects($this->at(1))->method( + 'setValue' + )->with(StoreManagerInterface::CONTEXT_STORE, $customStore, $expectedDefaultStore); + + $httpContextMock->expects($this->at(2))->method('setValue'); $plugin->beforeDispatch( $subjectMock, @@ -141,20 +142,20 @@ public function cacheHitOnDirectLinkToNonDefaultStoreView() [ 'custom_store', 'default', - 1, - 1 + 'custom_store', + true, ], [ + 'custom_store', 'default', 'default', - 2, - 0 + false, ], [ 'default', 'default', - 2, - 1 + 'default', + true, ], ]; } From 51996a128081536489c26565581364618a496e11 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Tue, 23 Jul 2019 16:05:30 +0300 Subject: [PATCH 176/230] MC-18366: Shipping confirmation email does not have link for order tracking --- .../Sales/Block/Email/Shipment/Track.php | 60 +++++++++++++++++++ .../sales_email_order_shipment_track.xml | 2 +- .../templates/email/shipment/track.phtml | 8 ++- 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/Sales/Block/Email/Shipment/Track.php diff --git a/app/code/Magento/Sales/Block/Email/Shipment/Track.php b/app/code/Magento/Sales/Block/Email/Shipment/Track.php new file mode 100644 index 000000000000..7780657e770c --- /dev/null +++ b/app/code/Magento/Sales/Block/Email/Shipment/Track.php @@ -0,0 +1,60 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Sales\Block\Email\Shipment; + +use Magento\Framework\View\Element\Template; +use Magento\Framework\View\Element\Template\Context; +use Magento\Sales\Model\Order\Shipment\Track as TrackModel; +use Magento\Shipping\Helper\Data as ShippingHelper; + +/** + * Shipment track info for email + */ +class Track extends Template +{ + /** + * @var ShippingHelper + */ + private $helper; + + /** + * @param Context $context + * @param ShippingHelper $helper + * @param array $data + */ + public function __construct( + Context $context, + ShippingHelper $helper, + array $data = [] + ) { + parent::__construct($context, $data); + $this->helper = $helper; + } + + /** + * Get Shipping tracking URL + * + * @param TrackModel $track + * @return string + */ + public function getTrackingUrl(TrackModel $track): string + { + return $this->helper->getTrackingPopupUrlBySalesModel($track); + } + + /** + * Get Shipping tracking URL escaped + * + * @param TrackModel $track + * @return string + */ + public function getTrackingUrlEscaped(TrackModel $track): string + { + return $this->escapeUrl($this->getTrackingUrl($track)); + } +} diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_track.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_track.xml index 91414663951d..e0daa49329df 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_track.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_track.xml @@ -8,6 +8,6 @@ <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_email_order_shipment_renderers"/> <body> - <block class="Magento\Framework\View\Element\Template" name="sales.order.email.shipment.track" template="Magento_Sales::email/shipment/track.phtml"/> + <block class="Magento\Sales\Block\Email\Shipment\Track" name="sales.order.email.shipment.track" template="Magento_Sales::email/shipment/track.phtml"/> </body> </page> \ No newline at end of file diff --git a/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml b/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml index 7b3769b2971e..2d2452573306 100644 --- a/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml @@ -3,8 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - ?> +<?php /* @var \Magento\Sales\Block\Email\Shipment\Track $block */ ?> <?php $_shipment = $block->getShipment() ?> <?php /* @var \Magento\Sales\Model\Order $_order */ @@ -24,7 +24,11 @@ $_order = $block->getOrder() ?> <?php foreach ($trackCollection as $_item) : ?> <tr> <td><?= $block->escapeHtml($_item->getTitle()) ?>:</td> - <td><?= $block->escapeHtml($_item->getNumber()) ?></td> + <td> + <a href="<?= $block->getTrackingUrlEscaped($_item) ?>" target="_blank"> + <?= $block->escapeHtml($_item->getNumber()) ?> + </a> + </td> </tr> <?php endforeach ?> </tbody> From 1c629361c5abd210f54bf7d14b332fb681e0b39f Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Tue, 23 Jul 2019 16:25:23 +0300 Subject: [PATCH 177/230] MC-18472: Product with different custom option prices in different scope overrides to default on import --- .../Model/Import/Product/Option.php | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php index 7435c0bebfc1..8f0d247ce15c 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php @@ -1504,6 +1504,7 @@ protected function _collectOptionTypeData( $specificTypeData = $this->_getSpecificTypeData($rowData, 0, false); //For others stores if ($specificTypeData) { + $typePrices[$nextValueId][$this->_rowStoreId] = $specificTypeData['price']; $typeTitles[$nextValueId++][$this->_rowStoreId] = $specificTypeData['title']; } } @@ -1788,29 +1789,30 @@ protected function _getPriceData(array $rowData, $optionId, $type) */ protected function _getSpecificTypeData(array $rowData, $optionTypeId, $defaultStore = true) { + $data = false; + $priceData = false; + $customOptionRowPrice = $rowData[self::COLUMN_ROW_PRICE]; + if (!empty($customOptionRowPrice) || $customOptionRowPrice === '0') { + $priceData = [ + 'price' => (double)rtrim($rowData[self::COLUMN_ROW_PRICE], '%'), + 'price_type' => 'fixed', + ]; + if ('%' == substr($rowData[self::COLUMN_ROW_PRICE], -1)) { + $priceData['price_type'] = 'percent'; + } + } if (!empty($rowData[self::COLUMN_ROW_TITLE]) && $defaultStore && empty($rowData[self::COLUMN_STORE])) { $valueData = [ 'option_type_id' => $optionTypeId, 'sort_order' => empty($rowData[self::COLUMN_ROW_SORT]) ? 0 : abs($rowData[self::COLUMN_ROW_SORT]), 'sku' => !empty($rowData[self::COLUMN_ROW_SKU]) ? $rowData[self::COLUMN_ROW_SKU] : '', ]; - - $priceData = false; - $customOptionRowPrice = $rowData[self::COLUMN_ROW_PRICE]; - if (!empty($customOptionRowPrice) || $customOptionRowPrice === '0') { - $priceData = [ - 'price' => (double)rtrim($rowData[self::COLUMN_ROW_PRICE], '%'), - 'price_type' => 'fixed', - ]; - if ('%' == substr($rowData[self::COLUMN_ROW_PRICE], -1)) { - $priceData['price_type'] = 'percent'; - } - } - return ['value' => $valueData, 'title' => $rowData[self::COLUMN_ROW_TITLE], 'price' => $priceData]; + $data = ['value' => $valueData, 'title' => $rowData[self::COLUMN_ROW_TITLE], 'price' => $priceData]; } elseif (!empty($rowData[self::COLUMN_ROW_TITLE]) && !$defaultStore && !empty($rowData[self::COLUMN_STORE])) { - return ['title' => $rowData[self::COLUMN_ROW_TITLE]]; + $data = ['title' => $rowData[self::COLUMN_ROW_TITLE], 'price' => $priceData]; } - return false; + + return $data; } /** @@ -1868,7 +1870,9 @@ protected function _saveTitles(array $titles) { $titleRows = []; foreach ($titles as $optionId => $storeInfo) { - foreach ($storeInfo as $storeId => $title) { + //for use default + $uniqStoreInfo = array_unique($storeInfo); + foreach ($uniqStoreInfo as $storeId => $title) { $titleRows[] = ['option_id' => $optionId, 'store_id' => $storeId, 'title' => $title]; } } @@ -1963,7 +1967,9 @@ protected function _saveSpecificTypeTitles(array $typeTitles) { $optionTypeTitleRows = []; foreach ($typeTitles as $optionTypeId => $storesData) { - foreach ($storesData as $storeId => $title) { + //for use default + $uniqStoresData = array_unique($storesData); + foreach ($uniqStoresData as $storeId => $title) { $optionTypeTitleRows[] = [ 'option_type_id' => $optionTypeId, 'store_id' => $storeId, From 02aa020892f1eeefcc086043f1c2a5f798fb059b Mon Sep 17 00:00:00 2001 From: Andrii Dimov <adimov@adobe.com> Date: Thu, 11 Jul 2019 20:33:46 -0500 Subject: [PATCH 178/230] MC-17981: Pricing Index runs without ever completing --- .../Magento/Catalog/Model/Indexer/Product/Price/Action/Full.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/Action/Full.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/Action/Full.php index 858eba3ab217..b30c85cfc52f 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/Action/Full.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/Action/Full.php @@ -279,6 +279,7 @@ private function getBatchesForIndexer(string $typeId): BatchIterator $select = $connection->select(); $select->distinct(true); $select->from(['e' => $entityMetadata->getEntityTable()], $entityMetadata->getIdentifierField()); + $select->where('type_id = ?', $typeId); return $this->batchQueryGenerator->generate( $this->getProductMetaData()->getIdentifierField(), From 986d9d89898bf168dde73c69a63a79d93093df3d Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Wed, 24 Jul 2019 08:58:10 +0200 Subject: [PATCH 179/230] MC-16192: Update composer.lock after merging mainline --- composer.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.lock b/composer.lock index 3e2747424741..9951434dc460 100644 --- a/composer.lock +++ b/composer.lock @@ -2349,7 +2349,7 @@ }, { "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "email": "backendtea@gmail.com" } ], "description": "Symfony polyfill for ctype functions", From 2b85a2c69d6ddf1a66bcc363a676b243c790678a Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Wed, 24 Jul 2019 10:46:26 +0300 Subject: [PATCH 180/230] graphQl-786: fixed the quantity field in the bundle product --- .../BundleGraphQl/Model/Resolver/Links/Collection.php | 2 +- app/code/Magento/BundleGraphQl/etc/schema.graphqls | 2 +- .../Magento/GraphQl/Bundle/BundleProductViewTest.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php index ee695c319501..74769e5d56b5 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php @@ -117,7 +117,7 @@ private function fetch() : array 'price' => $link->getSelectionPriceValue(), 'position' => $link->getPosition(), 'id' => $link->getSelectionId(), - 'qty' => (int)$link->getSelectionQty(), + 'quantity' => (int)$link->getSelectionQty(), 'is_default' => (bool)$link->getIsDefault(), 'price_type' => $this->enumLookup->getEnumValueFromField( 'PriceTypeEnum', diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index 26d2cbcd704f..e00a0b43c2e5 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -14,7 +14,7 @@ type BundleItem @doc(description: "BundleItem defines an individual item in a bu type BundleItemOption @doc(description: "BundleItemOption defines characteristics and options for a specific bundle item.") { id: Int @doc(description: "The ID assigned to the bundled item option.") label: String @doc(description: "The text that identifies the bundled item option.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\Label") - qty: Float @doc(description: "Indicates the quantity of this specific bundle item.") + quantity: Float @doc(description: "Indicates the quantity of this specific bundle item.") position: Int @doc(description: "When a bundle item contains multiple options, the relative position of this option compared to the other options.") is_default: Boolean @doc(description: "Indicates whether this option is the default option.") price: Float @doc(description: "The price of the selected option.") diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php index d5d34e48d77c..32526f1b6a78 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php @@ -58,7 +58,7 @@ public function testAllFieldsBundleProducts() sku options { id - qty + quantity position is_default price @@ -143,7 +143,7 @@ public function testBundleProductWithNotVisibleChildren() sku options { id - qty + quantity position is_default price @@ -269,7 +269,7 @@ private function assertBundleProductOptions($product, $actualResponse) $actualResponse['items'][0]['options'][0], [ 'id' => $bundleProductLink->getId(), - 'qty' => (int)$bundleProductLink->getQty(), + 'quantity' => (int)$bundleProductLink->getQty(), 'position' => $bundleProductLink->getPosition(), 'is_default' => (bool)$bundleProductLink->getIsDefault(), 'price_type' => self::KEY_PRICE_TYPE_FIXED, From 021ac539db3a5d1c7a1a4e6979df49dbbae0f5c7 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Wed, 24 Jul 2019 11:39:51 +0300 Subject: [PATCH 181/230] graphQl-738: un-skipped and fixed the media gallery test on the product --- .../testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php index f39feabccd83..f55fc8aa9df0 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -87,7 +87,6 @@ public function testMediaGalleryTypesAreCorrect() */ public function testProductMediaGalleryEntries() { - $this->markTestSkipped('https://github.com/magento/graphql-ce/issues/738'); $productSku = 'simple'; $query = <<<QUERY { @@ -107,7 +106,7 @@ public function testProductMediaGalleryEntries() $response = $this->graphQlQuery($query); self::assertArrayHasKey('file', $response['products']['items'][0]['media_gallery_entries'][0]); - self::assertContains('magento_image.jpg', $response['products']['items'][0]['media_gallery_entries'][0]['url']); + self::assertContains('magento_image.jpg', $response['products']['items'][0]['media_gallery_entries'][0]['file']); } /** From 176c6215d9e3d2a26ebe7eb0383cd18891042a5d Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Wed, 24 Jul 2019 11:47:21 +0300 Subject: [PATCH 182/230] MC-18472: Product with different custom option prices in different scope overrides to default on import --- .../Model/Import/Product/Option.php | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php b/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php index 8f0d247ce15c..6cdafa7fc6f5 100644 --- a/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php +++ b/app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php @@ -669,6 +669,7 @@ protected function _findNewOptionsWithTheSameTitles() * * @param array $sourceProductData * @return array + * phpcs:disable Generic.Metrics.NestingLevel */ protected function _getNewOptionsWithTheSameTitlesErrorRows(array $sourceProductData) { @@ -697,6 +698,7 @@ protected function _getNewOptionsWithTheSameTitlesErrorRows(array $sourceProduct * Find options with the same titles in DB * * @return array + * phpcs:disable Generic.Metrics.NestingLevel */ protected function _findOldOptionsWithTheSameTitles() { @@ -730,6 +732,7 @@ protected function _findOldOptionsWithTheSameTitles() * Find source file options, which have analogs in DB with the same name, but with different type * * @return array + * phpcs:disable Generic.Metrics.NestingLevel */ protected function _findNewOldOptionsTypeMismatch() { @@ -1067,7 +1070,7 @@ protected function _isSecondaryOptionRow(array $rowData) * * @param array &$options * @param array &$titles - * @param array $typeValues + * @param array $typeValues * @return bool */ protected function _isReadyForSaving(array &$options, array &$titles, array $typeValues) @@ -1414,9 +1417,9 @@ protected function _initProductsSku() /** * Collect custom option main data to import * - * @param array $rowData - * @param int &$prevOptionId - * @param int &$nextOptionId + * @param array $rowData + * @param int &$prevOptionId + * @param int &$nextOptionId * @param array &$products * @param array &$prices * @return array|null @@ -1454,9 +1457,9 @@ protected function _collectOptionMainData( /** * Collect custom option type data to import * - * @param array $rowData - * @param int &$prevOptionId - * @param int &$nextValueId + * @param array $rowData + * @param int &$prevOptionId + * @param int &$nextValueId * @param array &$typeValues * @param array &$typePrices * @param array &$typeTitles @@ -1504,7 +1507,9 @@ protected function _collectOptionTypeData( $specificTypeData = $this->_getSpecificTypeData($rowData, 0, false); //For others stores if ($specificTypeData) { - $typePrices[$nextValueId][$this->_rowStoreId] = $specificTypeData['price']; + if (isset($specificTypeData['price'])) { + $typePrices[$nextValueId][$this->_rowStoreId] = $specificTypeData['price']; + } $typeTitles[$nextValueId++][$this->_rowStoreId] = $specificTypeData['title']; } } @@ -1513,8 +1518,8 @@ protected function _collectOptionTypeData( /** * Collect custom option title to import * - * @param array $rowData - * @param int $prevOptionId + * @param array $rowData + * @param int $prevOptionId * @param array &$titles * @return void */ @@ -1789,17 +1794,12 @@ protected function _getPriceData(array $rowData, $optionId, $type) */ protected function _getSpecificTypeData(array $rowData, $optionTypeId, $defaultStore = true) { - $data = false; - $priceData = false; + $data = []; + $priceData = []; $customOptionRowPrice = $rowData[self::COLUMN_ROW_PRICE]; if (!empty($customOptionRowPrice) || $customOptionRowPrice === '0') { - $priceData = [ - 'price' => (double)rtrim($rowData[self::COLUMN_ROW_PRICE], '%'), - 'price_type' => 'fixed', - ]; - if ('%' == substr($rowData[self::COLUMN_ROW_PRICE], -1)) { - $priceData['price_type'] = 'percent'; - } + $priceData['price'] = (double)rtrim($rowData[self::COLUMN_ROW_PRICE], '%'); + $priceData['price_type'] = ('%' == substr($rowData[self::COLUMN_ROW_PRICE], -1)) ? 'percent' : 'fixed'; } if (!empty($rowData[self::COLUMN_ROW_TITLE]) && $defaultStore && empty($rowData[self::COLUMN_STORE])) { $valueData = [ @@ -1807,12 +1807,17 @@ protected function _getSpecificTypeData(array $rowData, $optionTypeId, $defaultS 'sort_order' => empty($rowData[self::COLUMN_ROW_SORT]) ? 0 : abs($rowData[self::COLUMN_ROW_SORT]), 'sku' => !empty($rowData[self::COLUMN_ROW_SKU]) ? $rowData[self::COLUMN_ROW_SKU] : '', ]; - $data = ['value' => $valueData, 'title' => $rowData[self::COLUMN_ROW_TITLE], 'price' => $priceData]; + $data['value'] = $valueData; + $data['title'] = $rowData[self::COLUMN_ROW_TITLE]; + $data['price'] = $priceData; } elseif (!empty($rowData[self::COLUMN_ROW_TITLE]) && !$defaultStore && !empty($rowData[self::COLUMN_STORE])) { - $data = ['title' => $rowData[self::COLUMN_ROW_TITLE], 'price' => $priceData]; + if ($priceData) { + $data['price'] = $priceData; + } + $data['title'] = $rowData[self::COLUMN_ROW_TITLE]; } - return $data; + return $data ?: false; } /** From 153a2362c80194b6ea7bb21c69d2f243537640b4 Mon Sep 17 00:00:00 2001 From: Volodymyr Vygovskyi <v.vygovskyi@atwix.com> Date: Wed, 24 Jul 2019 12:57:19 +0300 Subject: [PATCH 183/230] fixed test case with placing simple product order --- .../Downloadable/CustomerDownloadableProductsTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php index cdc7fd7b104b..5aa461722284 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php @@ -91,14 +91,21 @@ public function testCustomerHasNoOrders() /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php */ public function testCustomerHasNoDownloadableProducts() { + $quote = $this->quoteFactory->create(); + $this->quoteResource->load($quote, 'test_quote', 'reserved_order_id'); + $this->cartManagement->placeOrder($quote->getId()); + $query = $this->getQuery(); $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap()); From b30ab6993dfa32dda8e7acfbbf9b91724834d23b Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 24 Jul 2019 13:26:27 +0300 Subject: [PATCH 184/230] MC-18366: Shipping confirmation email does not have link for order tracking --- .../view/frontend/templates/tracking/popup.phtml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml b/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml index ee8a834044aa..70e7f53f6395 100644 --- a/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml +++ b/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml @@ -60,3 +60,18 @@ $results = $block->getTrackingInfo(); </button> </div> </div> +<script> + require([ + 'jquery', + 'prototype' + ], function (jQuery) { + var hideActions = function () { + jQuery('.actions button.close').hide(); + }; + + /* hide the close button when the content doesn't open in a modal window */ + if (window.opener === null || typeof window.opener === "undefined") { + hideActions(); + } + }); +</script> \ No newline at end of file From fe84af174f325eadf17f6a3753b62aca0323c748 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Wed, 24 Jul 2019 13:58:14 +0300 Subject: [PATCH 185/230] MC-18472: Product with different custom option prices in different scope overrides to default on import --- .../product_with_custom_options_and_multiple_store_views.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_and_multiple_store_views.csv b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_and_multiple_store_views.csv index 69d460cde472..f06836525854 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_and_multiple_store_views.csv +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/_files/product_with_custom_options_and_multiple_store_views.csv @@ -1,4 +1,4 @@ sku,website_code,store_view_code,attribute_set_code,product_type,name,description,short_description,weight,product_online,visibility,product_websites,categories,price,special_price,special_price_from_date,special_price_to_date,tax_class_name,url_key,meta_title,meta_keywords,meta_description,base_image,base_image_label,small_image,small_image_label,thumbnail_image,thumbnail_image_label,additional_images,additional_image_labels,configurable_variation_labels,configurable_variations,bundle_price_type,bundle_sku_type,bundle_weight_type,bundle_values,downloadble_samples,downloadble_links,associated_skus,related_skus,crosssell_skus,upsell_skus,custom_options,additional_attributes,manage_stock,is_in_stock,qty,out_of_stock_qty,is_qty_decimal,allow_backorders,min_cart_qty,max_cart_qty,notify_on_stock_below,qty_increments,enable_qty_increments,is_decimal_divided,new_from_date,new_to_date,gift_message_available,created_at,updated_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,page_layout,product_options_container,msrp_price,msrp_display_actual_price_type,map_enabled simple,base,,Default,simple,New Product,,,9,1,"Catalog, Search",base,,10,,,,Taxable Goods,new-product,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Select,type=drop_down,required=1,price=3,option_title=Select Option 1,sku=3-1-select|name=Test Select,type=drop_down,required=1,price=3,option_title=Select Option 2,sku=3-2-select|name=Test Field Title,type=field,required=1,sku=1-text,price=0,price_type=fixed,max_characters=10|name=Test Date and Time Title,type=date_time,required=1,price=2,sku=2-date|name=Test Checkbox,type=checkbox,required=1,price=3,option_title=Checkbox Option 1,sku=4-1-select|name=Test Checkbox,type=checkbox,required=1,price=3,option_title=Checkbox Option 2,sku=4-2-select|name=Test Radio,type=radio,required=1,price=3,option_title=Radio Option 1,sku=5-1-radio|name=Test Radio,type=radio,required=1,price=3,option_title=Radio Option 2,sku=5-2-radio",,1,1,999,0,0,0,1,10000,1,1,0,0,,,,,,,,,,,Block after Info Column,,, simple,,default,Default,simple,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Select_default,type=drop_down,option_title=Select Option 1_default|name=Test Select_default,type=drop_down,option_title=Select Option 2_default|name=Test Field Title_default,type=field|name=Test Date and Time Title_default,type=date_time|name=Test Checkbox_default,type=checkbox,option_title=Checkbox Option 1_default|name=Test Checkbox_default,type=checkbox,option_title=Checkbox Option 2_default|name=Test Radio_default,type=radio,option_title=Radio Option 1_default|name=Test Radio_default,type=radio,option_title=Radio Option 2_default",,,,,,,,,,,,,,,,,,,,,,,,,,, -simple,,fixture_second_store,Default,simple,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Select_fixture_second_store,type=drop_down,option_title=Select Option 1_fixture_second_store|name=Test Select_fixture_second_store,type=drop_down,option_title=Select Option 2_fixture_second_store|name=Test Field Title_fixture_second_store,type=field|name=Test Date and Time Title_fixture_second_store,type=date_time|name=Test Checkbox_second_store,type=checkbox,option_title=Checkbox Option 1_second_store|name=Test Checkbox_second_store,type=checkbox,option_title=Checkbox Option 2_second_store|name=Test Radio_fixture_second_store,type=radio,option_title=Radio Option 1_fixture_second_store|name=Test Radio_fixture_second_store,type=radio,option_title=Radio Option 2_fixture_second_store",,,,,,,,,,,,,,,,,,,,,,,,,,, +simple,,fixture_second_store,Default,simple,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"name=Test Select_fixture_second_store,type=drop_down,price=1,option_title=Select Option 1_fixture_second_store|name=Test Select_fixture_second_store,type=drop_down,option_title=Select Option 2_fixture_second_store|name=Test Field Title_fixture_second_store,type=field|name=Test Date and Time Title_fixture_second_store,type=date_time|name=Test Checkbox_second_store,type=checkbox,option_title=Checkbox Option 1_second_store|name=Test Checkbox_second_store,type=checkbox,option_title=Checkbox Option 2_second_store|name=Test Radio_fixture_second_store,type=radio,option_title=Radio Option 1_fixture_second_store|name=Test Radio_fixture_second_store,type=radio,option_title=Radio Option 2_fixture_second_store",,,,,,,,,,,,,,,,,,,,,,,,,,, From e4c07521ba9836c19cc7ba53b27c669488b02fd5 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Wed, 24 Jul 2019 14:38:13 +0300 Subject: [PATCH 186/230] graphQl-784: added validation for the lowercase country id --- .../Model/Cart/QuoteAddressFactory.php | 6 +++ .../Model/Cart/SetShippingAddressesOnCart.php | 1 - .../Customer/SetBillingAddressOnCartTest.php | 44 ++++++++++++++++++ .../Customer/SetShippingAddressOnCartTest.php | 46 +++++++++++++++++++ 4 files changed, 96 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php index a66c0ddb1a53..d70ebec2a39c 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php @@ -61,6 +61,11 @@ public function __construct( public function createBasedOnInputData(array $addressInput): QuoteAddress { $addressInput['country_id'] = $addressInput['country_code'] ?? ''; + if ($addressInput['country_id'] && !ctype_upper($addressInput['country_code'] )) { + throw new GraphQlInputException( + __('"Country Code" cannot contain lowercase characters.') + ); + } $maxAllowedLineCount = $this->addressHelper->getStreetLines(); if (is_array($addressInput['street']) && count($addressInput['street']) > $maxAllowedLineCount) { @@ -69,6 +74,7 @@ public function createBasedOnInputData(array $addressInput): QuoteAddress ); } + $quoteAddress = $this->quoteAddressFactory->create(); $quoteAddress->addData($addressInput); return $quoteAddress; diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php index de1d93003ab1..77719bed5b16 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php @@ -66,7 +66,6 @@ public function execute(ContextInterface $context, CartInterface $cart, array $s } if (null === $customerAddressId) { - $addressInput['country_code'] = strtoupper($addressInput['country_code']); $shippingAddress = $this->quoteAddressFactory->createBasedOnInputData($addressInput); } else { if (false === $context->getExtensionAttributes()->getIsCustomer()) { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index 9ff4d3bd0f60..927160c31d0a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -637,6 +637,50 @@ public function testSetNewBillingAddressWithRedundantStreetLine() $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @expectedException \Exception + * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. + */ + public function testSetNewBillingAddressWithLowercaseCountryCode() + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + + $query = <<<QUERY +mutation { + setBillingAddressOnCart( + input: { + cart_id: "$maskedQuoteId" + billing_address: { + address: { + firstname: "test firstname" + lastname: "test lastname" + company: "test company" + street: ["test street 1", "test street 2"] + city: "test city" + region: "test region" + postcode: "887766" + country_code: "us" + telephone: "88776655" + save_in_address_book: false + } + } + } + ) { + cart { + billing_address { + firstname + } + } + } +} +QUERY; + $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + } + /** * Verify the all the whitelisted fields for a New Address Object * diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php index 15ee12595506..747eeb21d665 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php @@ -655,6 +655,52 @@ public function testSetShippingAddressWithLowerCaseCountry() $this->assertEquals('CA', $address['region']['code']); } + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @expectedException \Exception + * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. + */ + public function testSetNewShippingAddressOnCartWithLowercaseCountryCode() + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + + $query = <<<QUERY +mutation { + setShippingAddressesOnCart( + input: { + cart_id: "$maskedQuoteId" + shipping_addresses: [ + { + address: { + firstname: "test firstname" + lastname: "test lastname" + company: "test company" + street: ["test street 1", "test street 2"] + city: "test city" + region: "test region" + postcode: "887766" + country_code: "us" + telephone: "88776655" + save_in_address_book: false + } + } + ] + } + ) { + cart { + shipping_addresses { + firstname + } + } + } +} +QUERY; + $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + } + /** * Verify the all the whitelisted fields for a New Address Object * From 28c5a881d23e99b847d16161f028a926bfc60ddb Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Wed, 24 Jul 2019 14:41:08 +0300 Subject: [PATCH 187/230] graphQl-784: code style fix --- app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php index d70ebec2a39c..c3b89fc48dae 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php @@ -74,7 +74,6 @@ public function createBasedOnInputData(array $addressInput): QuoteAddress ); } - $quoteAddress = $this->quoteAddressFactory->create(); $quoteAddress->addData($addressInput); return $quoteAddress; From 6db8374f8d3fd89e15398d87b340aa1042c0f080 Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Wed, 24 Jul 2019 14:35:31 +0200 Subject: [PATCH 188/230] MC-16192: Fixes for unit test after merging mainline --- .../Unit/Model/Wysiwyg/Images/StorageTest.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php index c9f64ea7e7ba..be7e9925c0d5 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php @@ -110,7 +110,12 @@ class StorageTest extends \PHPUnit\Framework\TestCase /** * @var \Magento\Framework\Filesystem\Io\File|\PHPUnit_Framework_MockObject_MockObject */ - protected $ioFile; + protected $ioFileMock; + + /** + * @var \Magento\Framework\Filesystem\Driver\File|\PHPUnit\Framework\MockObject\MockObject + */ + private $fileMock; private $allowedImageExtensions = [ 'jpg' => 'image/jpg', @@ -153,8 +158,9 @@ protected function setUp() $this->returnValue($this->directoryMock) ); - $this->ioFile = $this->createPartialMock(\Magento\Framework\Filesystem\Io\File::class, ['getPathInfo']); - $this->ioFile->expects( + $this->fileMock = $this->createPartialMock(\Magento\Framework\Filesystem\Driver\File::class, ['getParentDirectory']); + $this->ioFileMock = $this->createPartialMock(\Magento\Framework\Filesystem\Io\File::class, ['getPathInfo']); + $this->ioFileMock->expects( $this->any() )->method( 'getPathInfo' @@ -247,7 +253,8 @@ function ($path) { 'include' => [], ], 'data' => [], - 'ioFile' => $this->ioFile + 'file' => $this->fileMock, + 'ioFile' => $this->ioFileMock ] ); } @@ -514,6 +521,8 @@ public function testUploadFile() ] ); + $this->fileMock->expects($this->any())->method('getParentDirectory')->willReturn($path); + $image = $this->getMockBuilder(\Magento\Catalog\Model\Product\Image::class) ->disableOriginalConstructor() ->setMethods(['open', 'keepAspectRatio', 'resize', 'save']) From f427d3416547d104ac34570c2fb093018b95d17a Mon Sep 17 00:00:00 2001 From: roettigl <l.roettig@techdivision.com> Date: Wed, 24 Jul 2019 11:32:23 +0200 Subject: [PATCH 189/230] MC-14912: Update Zend lib to new minor version --- composer.json | 2 +- composer.lock | 70 +++++++++++++++++++++++++-------------------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/composer.json b/composer.json index de587e9b1c0f..e4cbc36435d4 100644 --- a/composer.json +++ b/composer.json @@ -79,7 +79,7 @@ "zendframework/zend-text": "^2.6.0", "zendframework/zend-uri": "^2.5.1", "zendframework/zend-validator": "^2.6.0", - "zendframework/zend-view": "~2.10.0", + "zendframework/zend-view": "~2.11.2", "guzzlehttp/guzzle": "^6.3.3" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 9951434dc460..ece9119f0450 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "869d419d288c8eb4e90e1fb205cd16a7", + "content-hash": "b5611ffe70383d5db27c29933e68f5ee", "packages": [ { "name": "braintree/braintree_php", @@ -534,16 +534,16 @@ }, { "name": "elasticsearch/elasticsearch", - "version": "v6.7.1", + "version": "v6.7.2", "source": { "type": "git", "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "7be453dd36d1b141b779f2cb956715f8e04ac2f4" + "reference": "9ba89f905ebf699e72dacffa410331c7fecc8255" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/7be453dd36d1b141b779f2cb956715f8e04ac2f4", - "reference": "7be453dd36d1b141b779f2cb956715f8e04ac2f4", + "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/9ba89f905ebf699e72dacffa410331c7fecc8255", + "reference": "9ba89f905ebf699e72dacffa410331c7fecc8255", "shasum": "" }, "require": { @@ -590,7 +590,7 @@ "elasticsearch", "search" ], - "time": "2019-05-20T14:15:55+00:00" + "time": "2019-07-19T14:48:24+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1245,16 +1245,16 @@ }, { "name": "paragonie/sodium_compat", - "version": "v1.10.0", + "version": "v1.10.1", "source": { "type": "git", "url": "https://github.com/paragonie/sodium_compat.git", - "reference": "228a9fc64cf4ba84c7967c1076d94209db03e0ee" + "reference": "5115fa44886d1c2785d2f135ef4626db868eac4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/228a9fc64cf4ba84c7967c1076d94209db03e0ee", - "reference": "228a9fc64cf4ba84c7967c1076d94209db03e0ee", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/5115fa44886d1c2785d2f135ef4626db868eac4b", + "reference": "5115fa44886d1c2785d2f135ef4626db868eac4b", "shasum": "" }, "require": { @@ -1323,7 +1323,7 @@ "secret-key cryptography", "side-channel resistant" ], - "time": "2019-05-13T16:04:50+00:00" + "time": "2019-07-12T16:36:59+00:00" }, { "name": "pelago/emogrifier", @@ -1521,16 +1521,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.20", + "version": "2.0.21", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "d6819a55b05e123db1e881d8b230d57f912126be" + "reference": "9f1287e68b3f283339a9f98f67515dd619e5bf9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d6819a55b05e123db1e881d8b230d57f912126be", - "reference": "d6819a55b05e123db1e881d8b230d57f912126be", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/9f1287e68b3f283339a9f98f67515dd619e5bf9d", + "reference": "9f1287e68b3f283339a9f98f67515dd619e5bf9d", "shasum": "" }, "require": { @@ -1609,7 +1609,7 @@ "x.509", "x509" ], - "time": "2019-06-23T16:33:11+00:00" + "time": "2019-07-12T12:53:49+00:00" }, { "name": "psr/container", @@ -4738,22 +4738,22 @@ }, { "name": "zendframework/zend-view", - "version": "2.10.1", + "version": "2.11.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-view.git", - "reference": "c1a3f2043fb75b5983ab9adfc369ae396601be7e" + "reference": "4f5cb653ed4c64bb8d9bf05b294300feb00c67f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-view/zipball/c1a3f2043fb75b5983ab9adfc369ae396601be7e", - "reference": "c1a3f2043fb75b5983ab9adfc369ae396601be7e", + "url": "https://api.github.com/repos/zendframework/zend-view/zipball/4f5cb653ed4c64bb8d9bf05b294300feb00c67f2", + "reference": "4f5cb653ed4c64bb8d9bf05b294300feb00c67f2", "shasum": "" }, "require": { "php": "^5.6 || ^7.0", "zendframework/zend-eventmanager": "^2.6.2 || ^3.0", - "zendframework/zend-json": "^2.6.1", + "zendframework/zend-json": "^2.6.1 || ^3.0", "zendframework/zend-loader": "^2.5", "zendframework/zend-stdlib": "^2.7 || ^3.0" }, @@ -4802,8 +4802,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.10.x-dev", - "dev-develop": "2.11.x-dev" + "dev-master": "2.11.x-dev", + "dev-develop": "2.12.x-dev" } }, "autoload": { @@ -4821,7 +4821,7 @@ "view", "zf2" ], - "time": "2018-12-06T21:20:01+00:00" + "time": "2019-02-19T17:40:15+00:00" } ], "packages-dev": [ @@ -7416,16 +7416,16 @@ }, { "name": "phpmd/phpmd", - "version": "2.6.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374" + "reference": "7425e155cf22cdd2b4dd3458a7da4cf6c0201562" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/4e9924b2c157a3eb64395460fcf56b31badc8374", - "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/7425e155cf22cdd2b4dd3458a7da4cf6c0201562", + "reference": "7425e155cf22cdd2b4dd3458a7da4cf6c0201562", "shasum": "" }, "require": { @@ -7453,20 +7453,20 @@ "authors": [ { "name": "Manuel Pichler", + "role": "Project Founder", "email": "github@manuel-pichler.de", - "homepage": "https://github.com/manuelpichler", - "role": "Project Founder" + "homepage": "https://github.com/manuelpichler" }, { "name": "Other contributors", - "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", - "role": "Contributors" + "role": "Contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors" }, { "name": "Marc Würth", + "role": "Project Maintainer", "email": "ravage@bluewin.ch", - "homepage": "https://github.com/ravage84", - "role": "Project Maintainer" + "homepage": "https://github.com/ravage84" } ], "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", @@ -7478,7 +7478,7 @@ "phpmd", "pmd" ], - "time": "2017-01-20T14:41:10+00:00" + "time": "2019-07-05T23:07:02+00:00" }, { "name": "phpoption/phpoption", From 4e22c63169cbdb4650be2069e46b782e485b4940 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 24 Jul 2019 16:31:50 +0300 Subject: [PATCH 190/230] MC-18366: Shipping confirmation email does not have link for order tracking --- .../Email/Shipment/TrackingUrl.php | 42 +++++++++++++ .../Sales/Block/Email/Shipment/Track.php | 60 ------------------- .../sales_email_order_shipment_track.xml | 6 +- .../templates/email/shipment/track.phtml | 2 +- .../Adminhtml/Order/Shipment/SaveTest.php | 18 +++++- 5 files changed, 65 insertions(+), 63 deletions(-) create mode 100644 app/code/Magento/Sales/Block/DataProviders/Email/Shipment/TrackingUrl.php delete mode 100644 app/code/Magento/Sales/Block/Email/Shipment/Track.php diff --git a/app/code/Magento/Sales/Block/DataProviders/Email/Shipment/TrackingUrl.php b/app/code/Magento/Sales/Block/DataProviders/Email/Shipment/TrackingUrl.php new file mode 100644 index 000000000000..cdc4ba2ce19d --- /dev/null +++ b/app/code/Magento/Sales/Block/DataProviders/Email/Shipment/TrackingUrl.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Sales\Block\DataProviders\Email\Shipment; + +use Magento\Framework\View\Element\Block\ArgumentInterface; +use Magento\Sales\Model\Order\Shipment\Track; +use Magento\Shipping\Helper\Data as ShippingHelper; + +/** + * Shipment track info for email + */ +class TrackingUrl implements ArgumentInterface +{ + /** + * @var ShippingHelper + */ + private $helper; + + /** + * @param ShippingHelper $helper + */ + public function __construct(ShippingHelper $helper) + { + $this->helper = $helper; + } + + /** + * Get Shipping tracking URL + * + * @param Track $track + * @return string + */ + public function getUrl(Track $track): string + { + return $this->helper->getTrackingPopupUrlBySalesModel($track); + } +} diff --git a/app/code/Magento/Sales/Block/Email/Shipment/Track.php b/app/code/Magento/Sales/Block/Email/Shipment/Track.php deleted file mode 100644 index 7780657e770c..000000000000 --- a/app/code/Magento/Sales/Block/Email/Shipment/Track.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Sales\Block\Email\Shipment; - -use Magento\Framework\View\Element\Template; -use Magento\Framework\View\Element\Template\Context; -use Magento\Sales\Model\Order\Shipment\Track as TrackModel; -use Magento\Shipping\Helper\Data as ShippingHelper; - -/** - * Shipment track info for email - */ -class Track extends Template -{ - /** - * @var ShippingHelper - */ - private $helper; - - /** - * @param Context $context - * @param ShippingHelper $helper - * @param array $data - */ - public function __construct( - Context $context, - ShippingHelper $helper, - array $data = [] - ) { - parent::__construct($context, $data); - $this->helper = $helper; - } - - /** - * Get Shipping tracking URL - * - * @param TrackModel $track - * @return string - */ - public function getTrackingUrl(TrackModel $track): string - { - return $this->helper->getTrackingPopupUrlBySalesModel($track); - } - - /** - * Get Shipping tracking URL escaped - * - * @param TrackModel $track - * @return string - */ - public function getTrackingUrlEscaped(TrackModel $track): string - { - return $this->escapeUrl($this->getTrackingUrl($track)); - } -} diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_track.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_track.xml index e0daa49329df..bbc7f04ce94f 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_track.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_track.xml @@ -8,6 +8,10 @@ <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="sales_email_order_shipment_renderers"/> <body> - <block class="Magento\Sales\Block\Email\Shipment\Track" name="sales.order.email.shipment.track" template="Magento_Sales::email/shipment/track.phtml"/> + <block class="Magento\Framework\View\Element\Template" name="sales.order.email.shipment.track" template="Magento_Sales::email/shipment/track.phtml"> + <arguments> + <argument name="tracking_url" xsi:type="object">Magento\Sales\Block\DataProviders\Email\Shipment\TrackingUrl</argument> + </arguments> + </block> </body> </page> \ No newline at end of file diff --git a/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml b/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml index 2d2452573306..35e184ead5a6 100644 --- a/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml @@ -25,7 +25,7 @@ $_order = $block->getOrder() ?> <tr> <td><?= $block->escapeHtml($_item->getTitle()) ?>:</td> <td> - <a href="<?= $block->getTrackingUrlEscaped($_item) ?>" target="_blank"> + <a href="<?= $block->escapeUrl($block->getTrackingUrl()->getUrl($_item)) ?>" target="_blank"> <?= $block->escapeHtml($_item->getNumber()) ?> </a> </td> diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php index e95e99224a6d..ec547ad03645 100644 --- a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php @@ -28,7 +28,14 @@ class SaveTest extends AbstractShipmentControllerTest */ public function testSendEmailOnShipmentSave(): void { - $order = $this->prepareRequest(['shipment' => ['send_email' => true]]); + $tracking = [ + [ + 'number' => 'some_racking_number', + 'title' => 'some_tracking_title', + 'carrier_code' => 'carrier_code' + ] + ]; + $order = $this->prepareRequest(['shipment' => ['send_email' => true], 'tracking' => $tracking]); $this->dispatch('backend/admin/order_shipment/save'); $this->assertSessionMessages( @@ -47,6 +54,15 @@ public function testSendEmailOnShipmentSave(): void ), new StringContains( "Your Shipment #{$shipment->getIncrementId()} for Order #{$order->getIncrementId()}" + ), + new StringContains( + "some_tracking_title" + ), + new StringContains( + "some_racking_number" + ), + new StringContains( + "shipping/tracking/popup?hash=" ) ); From 64d426633d7ad015850c5739bf9f077f3d6ea1fe Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 24 Jul 2019 17:00:31 +0300 Subject: [PATCH 191/230] MC-18366: Shipping confirmation email does not have link for order tracking --- .../Sales/view/frontend/templates/email/shipment/track.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml b/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml index 35e184ead5a6..5349ae5f1b1a 100644 --- a/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/email/shipment/track.phtml @@ -4,7 +4,7 @@ * See COPYING.txt for license details. */ ?> -<?php /* @var \Magento\Sales\Block\Email\Shipment\Track $block */ ?> +<?php /* @var \Magento\Framework\View\Element\Template $block */ ?> <?php $_shipment = $block->getShipment() ?> <?php /* @var \Magento\Sales\Model\Order $_order */ From 05f0181dda1de40f0a841fc6727ad4f39481528b Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 24 Jul 2019 17:05:30 +0300 Subject: [PATCH 192/230] MC-18366: Shipping confirmation email does not have link for order tracking --- .../Shipping/view/frontend/templates/tracking/popup.phtml | 6 +----- .../Controller/Adminhtml/Order/Shipment/SaveTest.php | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml b/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml index 70e7f53f6395..71558465c0ba 100644 --- a/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml +++ b/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml @@ -65,13 +65,9 @@ $results = $block->getTrackingInfo(); 'jquery', 'prototype' ], function (jQuery) { - var hideActions = function () { - jQuery('.actions button.close').hide(); - }; - /* hide the close button when the content doesn't open in a modal window */ if (window.opener === null || typeof window.opener === "undefined") { - hideActions(); + jQuery('.actions button.close').hide(); } }); </script> \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php index ec547ad03645..e3374064aa3c 100644 --- a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php +++ b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php @@ -56,13 +56,13 @@ public function testSendEmailOnShipmentSave(): void "Your Shipment #{$shipment->getIncrementId()} for Order #{$order->getIncrementId()}" ), new StringContains( - "some_tracking_title" + 'some_tracking_title' ), new StringContains( - "some_racking_number" + 'some_racking_number' ), new StringContains( - "shipping/tracking/popup?hash=" + 'shipping/tracking/popup?hash=' ) ); From bcc6af6fb72f9b10bb5a6385e7ce857dfcd1cebf Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Wed, 24 Jul 2019 16:17:28 +0200 Subject: [PATCH 193/230] MC-16192: Fixes for static test --- .../Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php index be7e9925c0d5..ed87c66b6e1c 100644 --- a/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php +++ b/app/code/Magento/Cms/Test/Unit/Model/Wysiwyg/Images/StorageTest.php @@ -158,7 +158,10 @@ protected function setUp() $this->returnValue($this->directoryMock) ); - $this->fileMock = $this->createPartialMock(\Magento\Framework\Filesystem\Driver\File::class, ['getParentDirectory']); + $this->fileMock = $this->createPartialMock( + \Magento\Framework\Filesystem\Driver\File::class, + ['getParentDirectory'] + ); $this->ioFileMock = $this->createPartialMock(\Magento\Framework\Filesystem\Io\File::class, ['getPathInfo']); $this->ioFileMock->expects( $this->any() From 03626cb2c9c0cdb8f7271ca49942137a6a168e91 Mon Sep 17 00:00:00 2001 From: Serhii Balko <serhii.balko@transoftgroup.com> Date: Wed, 24 Jul 2019 17:28:05 +0300 Subject: [PATCH 194/230] MC-18366: Shipping confirmation email does not have link for order tracking --- .../Shipping/view/frontend/templates/tracking/popup.phtml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml b/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml index 71558465c0ba..1e8760b3afd6 100644 --- a/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml +++ b/app/code/Magento/Shipping/view/frontend/templates/tracking/popup.phtml @@ -62,8 +62,7 @@ $results = $block->getTrackingInfo(); </div> <script> require([ - 'jquery', - 'prototype' + 'jquery' ], function (jQuery) { /* hide the close button when the content doesn't open in a modal window */ if (window.opener === null || typeof window.opener === "undefined") { From a13c4ae9c799dbc846737046d4c9ec39fed195c0 Mon Sep 17 00:00:00 2001 From: Dave Macaulay <macaulay@adobe.com> Date: Wed, 24 Jul 2019 10:56:08 -0500 Subject: [PATCH 195/230] MC-18558: Fix PHP version composer.json check for Page Builder static test failure --- .../Magento/Test/Integrity/ComposerTest.php | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php index a42fe147303b..438d9530ec5d 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php @@ -326,24 +326,15 @@ private function assertDependsOnFramework(\StdClass $json) private function assertPhpVersionInSync($name, $phpVersion) { if (isset(self::$rootJson['require']['php'])) { - if ($this->isVendorMagento($name)) { - $this->assertEquals( - self::$rootJson['require']['php'], - $phpVersion, - "PHP version {$phpVersion} in component {$name} is inconsistent with version " - . self::$rootJson['require']['php'] . ' in root composer.json' - ); - } else { - $composerVersionsPattern = '{\s*\|\|?\s*}'; - $rootPhpVersions = preg_split($composerVersionsPattern, self::$rootJson['require']['php']); - $modulePhpVersions = preg_split($composerVersionsPattern, $phpVersion); - - $this->assertEmpty( - array_diff($rootPhpVersions, $modulePhpVersions), - "PHP version {$phpVersion} in component {$name} is inconsistent with version " - . self::$rootJson['require']['php'] . ' in root composer.json' - ); - } + $composerVersionsPattern = '{\s*\|\|?\s*}'; + $rootPhpVersions = preg_split($composerVersionsPattern, self::$rootJson['require']['php']); + $modulePhpVersions = preg_split($composerVersionsPattern, $phpVersion); + + $this->assertEmpty( + array_diff($rootPhpVersions, $modulePhpVersions), + "PHP version {$phpVersion} in component {$name} is inconsistent with version " + . self::$rootJson['require']['php'] . ' in root composer.json' + ); } } From d33f3d7f5b7bf5ac103ca067865b606f7a304c8f Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Wed, 24 Jul 2019 12:44:36 -0500 Subject: [PATCH 196/230] MC-4459: Convert OnePageCheckoutOfflinePaymentMethodsTest to MFTF Fixed locator --- .../Checkout/Test/Mftf/Section/CheckoutShippingSection.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml index 50bf3dfee0c4..5d23eb23742b 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml @@ -39,7 +39,7 @@ <element name="editActiveAddress" type="button" selector="//div[@class='shipping-address-item selected-item']//span[text()='Edit']" timeout="30"/> <element name="loginButton" type="button" selector="//button[@data-action='checkout-method-login']" timeout="30"/> <element name="editActiveAddressButton" type="button" selector="//div[contains(@class,'payment-method _active')]//button[contains(@class,'action action-edit-address')]" timeout="30"/> - <element name="emailAddress" type="input" selector="#checkout-customer-email"/> + <element name="emailAddress" type="input" selector="#customer-email"/> <element name="shipHereButton" type="button" selector="//div[text()='{{street}}']/button[@class='action action-select-shipping-item']" parameterized="true" timeout="30"/> <element name="textFieldAttrRequireMessage" type="text" selector="//input[@name='custom_attributes[{{attribute}}]']/ancestor::div[contains(@class, 'control')]/div/span" parameterized="true" timeout="30"/> <element name="textFieldAttribute" type="input" selector="[name*='custom_attributes[{{attribute}}]']" parameterized="true" timeout="30"/> From cefdaaa92259a5f97640ca3fc45f8e3b3a4f1133 Mon Sep 17 00:00:00 2001 From: Deepty Thampy <dthampy@adobe.com> Date: Wed, 24 Jul 2019 14:19:23 -0500 Subject: [PATCH 197/230] MC-18552: Add api-functional test for querying for all linked categories for product - added test --- .../Resolver/Product/ProductCategories.php | 2 +- .../GraphQl/Catalog/ProductViewTest.php | 161 ++++++++++++++++++ 2 files changed, 162 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductCategories.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductCategories.php index 736f2a8c8e40..86984a29149e 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductCategories.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductCategories.php @@ -79,7 +79,7 @@ public function getCategoryIdsByProduct(int $productId, int $storeId) } /** - * Get catalog_product_category table name + * Get catalog_category_product table name * * @param int $storeId * @return string diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php index 1adca29ffb05..62e34fe25470 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php @@ -7,9 +7,11 @@ namespace Magento\GraphQl\Catalog; +use Magento\Catalog\Api\CategoryRepositoryInterface; use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Api\Data\ProductLinkInterface; use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Category; use Magento\Framework\DataObject; use Magento\Framework\EntityManager\MetadataPool; use Magento\TestFramework\ObjectManager; @@ -970,4 +972,163 @@ private function eavAttributesToGraphQlSchemaFieldTranslator(string $eavAttribut } return $eavAttributeCode; } + + /** + * @magentoApiDataFixture Magento/Catalog/_files/categories.php + */ + public function testProductInAllAnchoredCategories() + { + $query = <<<QUERY +{ + products(filter: {sku: {like: "12345%"}}) + { + items + { + sku + name + categories { + id + name + is_anchor + } + } + } +} +QUERY; + $response = $this->graphQlQuery($query); + $this->assertNotEmpty($response['products']['items'][0]['categories'], "Categories must not be empty"); + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); + /** @var CategoryRepositoryInterface $categoryRepository */ + $categoryRepository = ObjectManager::getInstance()->get(CategoryRepositoryInterface::class); + $categoryIds = [3, 4, 5]; + + $productItemsInResponse = $response['products']['items']; + $this->assertEquals(1, count($productItemsInResponse)); + $this->assertCount(3, $productItemsInResponse[0]['categories']); + $categoriesInResponse = array_map(null, $categoryIds, $productItemsInResponse[0]['categories']); + foreach ($categoriesInResponse as $key => $categoryData) { + $this->assertNotEmpty($categoryData); + /** @var Category | Category $category */ + $category = $categoryRepository->get($categoriesInResponse[$key][0]); + $this->assertResponseFields( + $categoriesInResponse[$key][1], + [ + 'name' => $category->getName(), + 'id' => $category->getId(), + 'is_anchor' => $category->getIsAnchor() + ] + ); + } + } + + /** + * Set one of the categories directly assigned to the product as non -anchored. + * Verify that the non-anchored category still shows in the response + * + * @magentoApiDataFixture Magento/Catalog/_files/categories.php + */ + public function testProductWithNonAnchoredParentCategory() + { + $query = <<<QUERY +{ + products(filter: {sku: {like: "12345%"}}) + { + items + { + sku + name + categories { + id + name + is_anchor + } + } + } +} +QUERY; + /** @var CategoryRepositoryInterface $categoryRepository */ + $categoryRepository = ObjectManager::getInstance()->get(CategoryRepositoryInterface::class); + /** @var Category $nonAnchorCategory */ + $nonAnchorCategory = $categoryRepository->get(4); + $nonAnchorCategory->setIsAnchor(false); + $categoryRepository->save($nonAnchorCategory); + $categoryIds = [3, 4, 5]; + + $response = $this->graphQlQuery($query); + $this->assertNotEmpty($response['products']['items'][0]['categories'], "Categories must not be empty"); + + $productItemsInResponse = $response['products']['items']; + $this->assertEquals(1, count($productItemsInResponse)); + $this->assertCount(3, $productItemsInResponse[0]['categories']); + $categoriesInResponse = array_map(null, $categoryIds, $productItemsInResponse[0]['categories']); + foreach ($categoriesInResponse as $key => $categoryData) { + $this->assertNotEmpty($categoryData); + /** @var Category | Category $category */ + $category = $categoryRepository->get($categoriesInResponse[$key][0]); + $this->assertResponseFields( + $categoriesInResponse[$key][1], + [ + 'name' => $category->getName(), + 'id' => $category->getId(), + 'is_anchor' => $category->getIsAnchor() + ] + ); + } + } + /** + * Set as non-anchored, one of the categories not directly assigned to the product + * Verify that the category doesn't show in the response + * + * @magentoApiDataFixture Magento/Catalog/_files/categories.php + */ + public function testProductInNonAnchoredSubCategories() + { + $query = <<<QUERY +{ + products(filter: {sku: {like: "12345%"}}) + { + items + { + sku + name + categories { + id + name + is_anchor + } + } + } +} +QUERY; + /** @var CategoryRepositoryInterface $categoryRepository */ + $categoryRepository = ObjectManager::getInstance()->get(CategoryRepositoryInterface::class); + /** @var Category $nonAnchorCategory */ + $nonAnchorCategory = $categoryRepository->get(3); + //Set the parent category as non-anchored + $nonAnchorCategory->setIsAnchor(false); + $categoryRepository->save($nonAnchorCategory); + $categoryIds = [4, 5]; + + $response = $this->graphQlQuery($query); + $this->assertNotEmpty($response['products']['items'][0]['categories'], "Categories must not be empty"); + + $productItemsInResponse = $response['products']['items']; + $this->assertEquals(1, count($productItemsInResponse)); + $this->assertCount(2, $productItemsInResponse[0]['categories']); + $categoriesInResponse = array_map(null, $categoryIds, $productItemsInResponse[0]['categories']); + foreach ($categoriesInResponse as $key => $categoryData) { + $this->assertNotEmpty($categoryData); + /** @var Category | Category $category */ + $category = $categoryRepository->get($categoriesInResponse[$key][0]); + $this->assertResponseFields( + $categoriesInResponse[$key][1], + [ + 'name' => $category->getName(), + 'id' => $category->getId(), + 'is_anchor' => $category->getIsAnchor() + ] + ); + } + } } From 69aab3375eb82f97d1360227eb533e125470c23e Mon Sep 17 00:00:00 2001 From: Valerii Naida <vnayda@adobe.com> Date: Wed, 24 Jul 2019 15:37:55 -0500 Subject: [PATCH 198/230] magento/graphql-ce#751: Empty PaymentMethodAdditionalDataInput causes schema invalidation --- .../Magento/TestModuleAuthorizenetAcceptjs/registration.php | 1 + .../_files/Magento/TestModuleFedex/registration.php | 2 ++ .../_files/Magento/TestModuleUsps/registration.php | 2 ++ 3 files changed, 5 insertions(+) diff --git a/dev/tests/api-functional/_files/Magento/TestModuleAuthorizenetAcceptjs/registration.php b/dev/tests/api-functional/_files/Magento/TestModuleAuthorizenetAcceptjs/registration.php index 42ac55817406..28c5861ed5fb 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleAuthorizenetAcceptjs/registration.php +++ b/dev/tests/api-functional/_files/Magento/TestModuleAuthorizenetAcceptjs/registration.php @@ -3,6 +3,7 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); use Magento\Framework\Component\ComponentRegistrar; diff --git a/dev/tests/api-functional/_files/Magento/TestModuleFedex/registration.php b/dev/tests/api-functional/_files/Magento/TestModuleFedex/registration.php index 7b11c17ff7ea..7a5a73f54894 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleFedex/registration.php +++ b/dev/tests/api-functional/_files/Magento/TestModuleFedex/registration.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + use Magento\Framework\Component\ComponentRegistrar; $registrar = new ComponentRegistrar(); diff --git a/dev/tests/api-functional/_files/Magento/TestModuleUsps/registration.php b/dev/tests/api-functional/_files/Magento/TestModuleUsps/registration.php index 3d45a323b529..c336f620b002 100644 --- a/dev/tests/api-functional/_files/Magento/TestModuleUsps/registration.php +++ b/dev/tests/api-functional/_files/Magento/TestModuleUsps/registration.php @@ -3,6 +3,8 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + use Magento\Framework\Component\ComponentRegistrar; $registrar = new ComponentRegistrar(); From d5fe1e5f41c4d54b0c8cf222ef0ab40990325883 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Wed, 24 Jul 2019 16:29:25 -0500 Subject: [PATCH 199/230] Test improvements: - test stabilization --- .../Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml index e8f8c23b7e4e..68b5f99112d9 100644 --- a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminOpenUserEditPageActionGroup.xml @@ -15,6 +15,7 @@ <amOnPage url="{{AdminUsersPage.url}}" stepKey="openAdminUsersPage"/> <waitForPageLoad stepKey="waitForPageToLoad"/> <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="resetFilters" /> + <waitForPageLoad stepKey="waitForPageToLoadAfterFilterReset"/> <fillField selector="{{AdminLegacyDataGridFilterSection.inputFieldByNameAttr('username')}}" userInput="{{user.username}}" stepKey="fillSearchUsernameFilter"/> <click selector="{{AdminLegacyDataGridFilterSection.apply}}" stepKey="clickSearch" /> <waitForPageLoad stepKey="waitForGridToLoad"/> From d856f38e3618d36d9c2d18f3850aab7398c34e53 Mon Sep 17 00:00:00 2001 From: Cristian Partica <cpartica@magento.com> Date: Wed, 24 Jul 2019 16:40:33 -0500 Subject: [PATCH 200/230] MC-18550: Modify performance tests to include products with anchored category --- setup/performance-toolkit/benchmark.jmx | 70 ++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx index e92c0bd73812..c2d4177b789a 100644 --- a/setup/performance-toolkit/benchmark.jmx +++ b/setup/performance-toolkit/benchmark.jmx @@ -38661,7 +38661,7 @@ if (totalCount == null) { <collectionProp name="Arguments.arguments"> <elementProp name="" elementType="HTTPArgument"> <boolProp name="HTTPArgument.always_encode">false</boolProp> - <stringProp name="Argument.value">{"query":"{\n products(\n pageSize:20\n currentPage:1\n search: \"configurable\"\n filter: {name: {like: \"Configurable Product%\"} }\n ) {\n total_count\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.value">{"query":"{\n products(\n pageSize:20\n currentPage:1\n search: \"configurable\"\n filter: {name: {like: \"Configurable Product%\"} }\n ) {\n total_count\n page_info {\n current_page\n page_size\n total_pages\n }\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> <stringProp name="Argument.metadata">=</stringProp> </elementProp> </collectionProp> @@ -38682,6 +38682,74 @@ if (totalCount == null) { <stringProp name="HTTPSampler.embedded_url_re"/> <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter.jmx</stringProp> </HTTPSamplerProxy> + <hashTree> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_count_fulltext_filter</stringProp> + <stringProp name="JSONPATH">$.data.products.total_count</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_pages" enabled="true"> + <stringProp name="VAR">graphql_search_products_query_total_pages_fulltext_filter</stringProp> + <stringProp name="JSONPATH">$.data.products.page_info.total_pages</stringProp> + <stringProp name="DEFAULT"/> + <stringProp name="VARIABLE"/> + <stringProp name="SUBJECT">BODY</stringProp> + </com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor> + <hashTree/> + <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="Assert total count > 0" enabled="true"> + <stringProp name="BeanShellAssertion.query">String totalCount=vars.get("graphql_search_products_query_total_count_fulltext_filter"); + +if (totalCount == null) { + Failure = true; + FailureMessage = "Not Expected \"totalCount\" to be null"; +} else { + if (Integer.parseInt(totalCount) < 1) { + Failure = true; + FailureMessage = "Expected \"totalCount\" to be greater than zero, Actual: " + totalCount; + } else { + Failure = false; + } +} + + +</stringProp> + <stringProp name="BeanShellAssertion.filename"/> + <stringProp name="BeanShellAssertion.parameters"/> + <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp> + </BeanShellAssertion> + <hashTree/> + </hashTree> + + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Query products with full text search and filter last page" enabled="true"> + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> + <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> + <collectionProp name="Arguments.arguments"> + <elementProp name="" elementType="HTTPArgument"> + <boolProp name="HTTPArgument.always_encode">false</boolProp> + <stringProp name="Argument.value">{"query":"{\n products(\n pageSize:20\n currentPage:${graphql_search_products_query_total_pages_fulltext_filter}\n search: \"configurable\"\n filter: {name: {like: \"Configurable Product%\"} }\n ) {\n total_count\n page_info {\n current_page\n page_size\n total_pages\n }\n items {\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n ... on PhysicalProductInterface {\n \t\t\tweight\n \t\t\t}\n ... on ConfigurableProduct {\n configurable_options {\n id\n attribute_id\n label\n position\n use_default\n attribute_code\n values {\n value_index\n label\n store_label\n default_label\n use_default_value\n }\n product_id\n }\n variants {\n product {\n ... on PhysicalProductInterface {\n weight\n }\n sku\n color\n attribute_set_id\n categories\n {\n id\n position\n }\n country_of_manufacture\n created_at\n description {\n html\n }\n gift_message_available\n id\n image\n {\n url\n label\n }\n meta_description\n meta_keyword\n meta_title\n media_gallery_entries\n {\n disabled\n file\n id\n label\n media_type\n position\n types\n content\n {\n base64_encoded_data\n type\n name\n }\n video_content\n {\n media_type\n video_description\n video_metadata\n video_provider\n video_title\n video_url\n }\n }\n name\n new_from_date\n new_to_date\n options_container\n ... on CustomizableProductInterface {\n options\n {\n title\n required\n sort_order\n }\n }\n \n price {\n minimalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n maximalPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n regularPrice {\n amount {\n value\n currency\n }\n adjustments {\n amount {\n value\n currency\n }\n code\n description\n }\n }\n }\n product_links\n {\n link_type\n linked_product_sku\n linked_product_type\n position\n sku\n }\n short_description {\n html\n }\n sku\n small_image\n {\n url\n label\n }\n special_from_date\n special_price\n special_to_date\n swatch_image\n thumbnail\n {\n url\n label\n }\n tier_price\n tier_prices\n {\n customer_group_id\n percentage_value\n qty\n value\n website_id\n }\n type_id\n updated_at\n url_key\n url_path\n websites { id name code sort_order default_group_id is_default }\n\n\n }\n attributes {\n label\n code\n value_index\n }\n }\n }\n }\n }\n}\n","variables":null,"operationName":null}</stringProp> + <stringProp name="Argument.metadata">=</stringProp> + </elementProp> + </collectionProp> + </elementProp> + <stringProp name="HTTPSampler.domain"/> + <stringProp name="HTTPSampler.port"/> + <stringProp name="HTTPSampler.connect_timeout"/> + <stringProp name="HTTPSampler.response_timeout"/> + <stringProp name="HTTPSampler.protocol">${request_protocol}</stringProp> + <stringProp name="HTTPSampler.contentEncoding"/> + <stringProp name="HTTPSampler.path">${base_path}graphql</stringProp> + <stringProp name="HTTPSampler.method">POST</stringProp> + <boolProp name="HTTPSampler.follow_redirects">true</boolProp> + <boolProp name="HTTPSampler.auto_redirects">false</boolProp> + <boolProp name="HTTPSampler.use_keepalive">true</boolProp> + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> + <boolProp name="HTTPSampler.monitor">false</boolProp> + <stringProp name="HTTPSampler.embedded_url_re"/> + <stringProp name="TestPlan.comments">mpaf/tool/fragments/ce/graphql/query_multiple_products_with_extensible_data_objects_using_full_text_and_filter_last_page.jmx</stringProp> + </HTTPSamplerProxy> <hashTree> <com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor guiclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.gui.JSONPathExtractorGui" testclass="com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor" testname="Extract total_count" enabled="true"> <stringProp name="VAR">graphql_search_products_query_total_count_fulltext_filter</stringProp> From 70b1ff3b8d4847583a994ac5f2f8f9fad8bb1b31 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Wed, 24 Jul 2019 17:22:28 -0500 Subject: [PATCH 201/230] Test improvements: - test stabilization --- ...AdminClickFormActionButtonActionGroup.xml} | 10 ++-- ...l => AdminFilterLegacyGridActionGroup.xml} | 9 ++-- ...AdminResetLegacyGridFilterActionGroup.xml} | 4 +- .../AssertValueInAdminGridActionGroup.xml | 16 ------ ...AdminFillFormCustomVariableActionGroup.xml | 16 ------ .../AdminFillVariableFormActionGroup.xml | 19 +++++++ .../AdminFilterVariableGridActionGroup.xml | 22 ++++++++ ...AdminNavigateToVariablePageActionGroup.xml | 5 +- ...> AdminOpenNewVariablePageActionGroup.xml} | 2 +- ...AdminOpenVariablesGridPageActionGroup.xml} | 2 +- ...sertAdminCustomVariableFormActionGroup.xml | 19 +++++++ ...rtAdminCustomVariableInGridActionGroup.xml | 17 +++++++ .../Variable/Test/Mftf/Data/VariableData.xml | 6 +++ .../Mftf/Section/AdminVariableFormSection.xml | 20 ++++++++ ...xml => AdminVariableGridFilterSection.xml} | 6 +-- .../AdminCreateCustomVariableEntityTest.xml | 51 +++++++++++++++++++ .../Test/CreateCustomVariableEntityTest.xml | 48 ----------------- 17 files changed, 175 insertions(+), 97 deletions(-) rename app/code/Magento/Backend/Test/Mftf/ActionGroup/{AdminClickMainButtonActionGroup.xml => AdminClickFormActionButtonActionGroup.xml} (58%) rename app/code/Magento/Backend/Test/Mftf/ActionGroup/{AdminFilterGridActionGroup.xml => AdminFilterLegacyGridActionGroup.xml} (64%) rename app/code/Magento/Backend/Test/Mftf/ActionGroup/{AdminResetGridFilterActionGroup.xml => AdminResetLegacyGridFilterActionGroup.xml} (82%) delete mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInAdminGridActionGroup.xml delete mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillFormCustomVariableActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillVariableFormActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFilterVariableGridActionGroup.xml rename app/code/Magento/Variable/Test/Mftf/ActionGroup/{AdminNavigateToNewVariablePageActionGroup.xml => AdminOpenNewVariablePageActionGroup.xml} (87%) rename app/code/Magento/Variable/Test/Mftf/ActionGroup/{AdminNavigateToVariablesGridPageActionGroup.xml => AdminOpenVariablesGridPageActionGroup.xml} (87%) create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AssertAdminCustomVariableFormActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/ActionGroup/AssertAdminCustomVariableInGridActionGroup.xml create mode 100644 app/code/Magento/Variable/Test/Mftf/Section/AdminVariableFormSection.xml rename app/code/Magento/Variable/Test/Mftf/Section/{AdminVariablesFilterSection.xml => AdminVariableGridFilterSection.xml} (52%) create mode 100644 app/code/Magento/Variable/Test/Mftf/Test/AdminCreateCustomVariableEntityTest.xml delete mode 100644 app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickMainButtonActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickFormActionButtonActionGroup.xml similarity index 58% rename from app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickMainButtonActionGroup.xml rename to app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickFormActionButtonActionGroup.xml index 6eef59695745..186f11e4ea50 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickMainButtonActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickFormActionButtonActionGroup.xml @@ -8,12 +8,12 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminClickMainButtonActionGroup"> + <actionGroup name="AdminClickFormActionButtonActionGroup"> <arguments> - <argument name="button" type="string" /> - </arguments> - <waitForElementVisible selector="{{button}}" stepKey="waitForButton"/> - <click selector="{{button}}" stepKey="clickButton"/> + <argument name="buttonSelector" type="string" /> + </arguments> + <waitForElementVisible selector="{{buttonSelector}}" stepKey="waitForButton"/> + <click selector="{{buttonSelector}}" stepKey="clickButton"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterGridActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml similarity index 64% rename from app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterGridActionGroup.xml rename to app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml index dea1038159fc..f4af54d2edc4 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterGridActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterLegacyGridActionGroup.xml @@ -8,13 +8,16 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminFilterGridActionGroup"> + <actionGroup name="AdminFilterLegacyGridActionGroup"> <arguments> - <argument name="field" type="string"/> + <argument name="fieldSelector" type="string"/> <argument name="value" type="string"/> - <argument name="button" type="string" defaultValue="{{AdminSecondaryGridSection.searchButton}}"/> + <argument name="button" type="string" defaultValue="{{AdminLegacyDataGridFilterSection.apply}}"/> </arguments> + <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="resetFilters" /> + <waitForPageLoad stepKey="waitForFilterReset" /> <fillField selector="{{field}}" userInput="{{value}}" stepKey="fillFieldInFilter"/> <click selector="{{button}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForFiltersApply" /> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetGridFilterActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetLegacyGridFilterActionGroup.xml similarity index 82% rename from app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetGridFilterActionGroup.xml rename to app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetLegacyGridFilterActionGroup.xml index 7e22309493be..8a9ac8991bac 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetGridFilterActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminResetLegacyGridFilterActionGroup.xml @@ -8,9 +8,9 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminResetGridFilterActionGroup"> + <actionGroup name="AdminResetLegacyGridFilterActionGroup"> <arguments> - <argument name="selector" type="string" defaultValue="{{AdminSecondaryGridSection.resetFilters}}"/> + <argument name="selector" type="string" defaultValue="{{AdminLegacyDataGridFilterSection.clear}}"/> </arguments> <click selector="{{selector}}" stepKey="clickResetButton"/> </actionGroup> diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInAdminGridActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInAdminGridActionGroup.xml deleted file mode 100644 index f3eec4446ae7..000000000000 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertValueInAdminGridActionGroup.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AssertValueInAdminGridActionGroup"> - <arguments> - <argument name="value" type="string" /> - </arguments> - <see selector="{{AdminGridTableSection.rowByValue(value)}}" userInput="{{value}}" stepKey="seeValueInGrid"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillFormCustomVariableActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillFormCustomVariableActionGroup.xml deleted file mode 100644 index 4dabe6f0ae19..000000000000 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillFormCustomVariableActionGroup.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminFillFormCustomVariableActionGroup"> - <fillField selector="{{CustomVariableSection.variableCode}}" userInput="{{customVariable.code}}" stepKey="fillVariableCode"/> - <fillField selector="{{CustomVariableSection.variableName}}" userInput="{{customVariable.name}}" stepKey="fillVariableName"/> - <fillField selector="{{CustomVariableSection.variableHTML}}" userInput="{{customVariable.html}}" stepKey="fillVariableHtml"/> - <fillField selector="{{CustomVariableSection.variablePlain}}" userInput="{{customVariable.plain}}" stepKey="fillVariablePlain"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillVariableFormActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillVariableFormActionGroup.xml new file mode 100644 index 000000000000..f9761ede76ad --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFillVariableFormActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillVariableFormActionGroup"> + <arguments> + <argument name="variable" /> + </arguments> + <fillField selector="{{AdminVariableFormSection.code}}" userInput="{{variable.code}}" stepKey="fillVariableCode"/> + <fillField selector="{{AdminVariableFormSection.name}}" userInput="{{variable.name}}" stepKey="fillVariableName"/> + <fillField selector="{{AdminVariableFormSection.html}}" userInput="{{variable.html}}" stepKey="fillVariableHtml"/> + <fillField selector="{{AdminVariableFormSection.plain}}" userInput="{{variable.plain}}" stepKey="fillVariablePlain"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFilterVariableGridActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFilterVariableGridActionGroup.xml new file mode 100644 index 000000000000..a9f1f049081e --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminFilterVariableGridActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFilterVariableGridActionGroup"> + <arguments> + <argument name="variable" type="entity"/> + </arguments> + <click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="resetFilters" /> + <waitForPageLoad stepKey="waitForFilterReset" /> + <fillField selector="{{AdminVariableGridFilterSection.codeField}}" userInput="{{variable.code}}" stepKey="fillCodeFieldInFilter"/> + <fillField selector="{{AdminVariableGridFilterSection.nameField}}" userInput="{{variable.name}}" stepKey="fillNameFieldInFilter"/> + <click selector="{{AdminLegacyDataGridFilterSection.apply}}" stepKey="clickSearchButton"/> + <waitForPageLoad stepKey="waitForFiltersApply" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablePageActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablePageActionGroup.xml index 4904b45a47e4..4241757ada14 100644 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablePageActionGroup.xml +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablePageActionGroup.xml @@ -8,10 +8,11 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminNavigateToVariablePageActionGroup"> + <actionGroup name="AdminNavigateToVariablePageByCodeActionGroup"> <arguments> <argument name="code" type="string"/> </arguments> - <click selector="{{CustomVariableSection.GridCustomVariableCode(code)}}" stepKey="goToCustomVariableEditPage"/> + <click selector="{{AdminLegacyDataGridTableSection.rowTemplateStrict(code)}}" stepKey="goToCustomVariableEditPage"/> + <waitForPageLoad stepKey="waitForVariableEditPageOpen" /> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToNewVariablePageActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminOpenNewVariablePageActionGroup.xml similarity index 87% rename from app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToNewVariablePageActionGroup.xml rename to app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminOpenNewVariablePageActionGroup.xml index 060a2a608b12..24b45926dd6a 100644 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToNewVariablePageActionGroup.xml +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminOpenNewVariablePageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminNavigateToNewVariablePageActionGroup"> + <actionGroup name="AdminOpenNewVariablePageActionGroup"> <amOnPage url="{{AdminNewVariablePage.url}}" stepKey="openNewVariablePage"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablesGridPageActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminOpenVariablesGridPageActionGroup.xml similarity index 87% rename from app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablesGridPageActionGroup.xml rename to app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminOpenVariablesGridPageActionGroup.xml index cc57f6b83d49..b2b0a155ae67 100644 --- a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminNavigateToVariablesGridPageActionGroup.xml +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminOpenVariablesGridPageActionGroup.xml @@ -8,7 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminNavigateToVariablesGridPageActionGroup"> + <actionGroup name="AdminOpenVariablesGridPageActionGroup"> <amOnPage url="{{AdminVariablesPage.url}}" stepKey="openVariablesGridPage"/> <waitForPageLoad stepKey="waitForPageLoad"/> </actionGroup> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AssertAdminCustomVariableFormActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AssertAdminCustomVariableFormActionGroup.xml new file mode 100644 index 000000000000..e8372ed7593e --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AssertAdminCustomVariableFormActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminCustomVariableFormActionGroup"> + <arguments> + <argument name="variable" /> + </arguments> + <seeInField selector="{{AdminVariableFormSection.code}}" userInput="{{variable.code}}" stepKey="seeVariableCode"/> + <seeInField selector="{{AdminVariableFormSection.name}}" userInput="{{variable.name}}" stepKey="seeVariableName"/> + <seeInField selector="{{AdminVariableFormSection.html}}" userInput="{{variable.html}}" stepKey="seeVariableHtml"/> + <seeInField selector="{{AdminVariableFormSection.plain}}" userInput="{{variable.plain}}" stepKey="seeVariablePlain"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/ActionGroup/AssertAdminCustomVariableInGridActionGroup.xml b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AssertAdminCustomVariableInGridActionGroup.xml new file mode 100644 index 000000000000..d68c73f16445 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/ActionGroup/AssertAdminCustomVariableInGridActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertAdminCustomVariableInGridActionGroup"> + <arguments> + <argument name="variable" /> + </arguments> + <see selector="{{AdminLegacyDataGridTableSection.rowTemplateStrict(variable.code)}}" userInput="{{variable.code}}" stepKey="seeVariableCode" /> + <see selector="{{AdminLegacyDataGridTableSection.rowTemplateStrict(variable.code)}}" userInput="{{variable.name}}" stepKey="seeVariableName" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml index 1160b7902661..4353059eba4e 100644 --- a/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml +++ b/app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml @@ -17,4 +17,10 @@ <data key="html"> Sample Variable </data> <data key="plain">variable-plain-</data> </entity> + <entity name="SampleVariable"> + <data key="code" unique="suffix">variable-code-</data> + <data key="name">Test Sample Variable</data> + <data key="html">Test Sample Variable HTML value</data> + <data key="plain">Test Sample Variable PLAIN value</data> + </entity> </entities> diff --git a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableFormSection.xml b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableFormSection.xml new file mode 100644 index 000000000000..59a87b434cd9 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableFormSection.xml @@ -0,0 +1,20 @@ +<?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="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminVariableFormSection"> + <element name="code" type="input" selector="#edit_form input[name='variable[code]']"/> + <element name="name" type="input" selector="#edit_form input[name='variable[name]']"/> + <element name="html" type="textarea" selector="#edit_form textarea[name='variable[html_value]']"/> + <element name="plain" type="textarea" selector="#edit_form textarea[name='variable[plain_value]']"/> + <element name="save" type="button" selector=".page-actions-buttons #save"/> + <element name="delete" type="button" selector=".page-actions-buttons #delete"/> + <element name="confirmDelete" type="button" selector=".action-primary.action-accept"/> + </section> +</sections> diff --git a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableGridFilterSection.xml similarity index 52% rename from app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml rename to app/code/Magento/Variable/Test/Mftf/Section/AdminVariableGridFilterSection.xml index 8c3eb683184d..93a94e371808 100644 --- a/app/code/Magento/Variable/Test/Mftf/Section/AdminVariablesFilterSection.xml +++ b/app/code/Magento/Variable/Test/Mftf/Section/AdminVariableGridFilterSection.xml @@ -8,8 +8,8 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> - <section name="AdminVariablesFilterSection"> - <element name="codeFilter" type="input" selector="input.admin__control-text[name='code']"/> - <element name="nameFilter" type="input" selector="input.admin__control-text[name='name']"/> + <section name="AdminVariableGridFilterSection"> + <element name="codeField" type="input" selector="[data-role='filter-form'] input.admin__control-text[name='code']"/> + <element name="nameField" type="input" selector="[data-role='filter-form'] input.admin__control-text[name='name']"/> </section> </sections> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/AdminCreateCustomVariableEntityTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/AdminCreateCustomVariableEntityTest.xml new file mode 100644 index 000000000000..3185640e3783 --- /dev/null +++ b/app/code/Magento/Variable/Test/Mftf/Test/AdminCreateCustomVariableEntityTest.xml @@ -0,0 +1,51 @@ +<?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="AdminCreateCustomVariableEntityTest"> + <annotations> + <features value="Variable"/> + <stories value="Create Custom Variable."/> + <title value="Admin Create Custom Variable"/> + <description value="Test for creating a custom variable."/> + <testCaseId value="MC-14253"/> + <severity value="MAJOR"/> + <group value="variable"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="logout" stepKey="logout"/> + </after> + <actionGroup ref="AdminOpenNewVariablePageActionGroup" stepKey="goToNewVariableAdminPage"/> + <actionGroup ref="AdminFillVariableFormActionGroup" stepKey="fillInCustomVariableData"> + <argument name="variable" value="SampleVariable" /> + </actionGroup> + <actionGroup ref="AdminClickFormActionButtonActionGroup" stepKey="clickSaveCustomVariable"> + <argument name="buttonSelector" value="{{AdminMainActionsSection.save}}"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage"> + <argument name="message" value="You saved the custom variable."/> + </actionGroup> + <actionGroup ref="AdminFilterVariableGridActionGroup" stepKey="filterVariablesGrid"> + <argument name="variable" value="SampleVariable"/> + </actionGroup> + <actionGroup ref="AssertAdminCustomVariableInGridActionGroup" stepKey="seeNewVariableInGrid"> + <argument name="variable" value="SampleVariable"/> + </actionGroup> + <actionGroup ref="AdminNavigateToVariablePageByCodeActionGroup" stepKey="openVariableEditPage"> + <argument name="code" value="{{SampleVariable.code}}" /> + </actionGroup> + <actionGroup ref="AssertAdminCustomVariableFormActionGroup" stepKey="assertCustomVariableForm"> + <argument name="variable" value="SampleVariable"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml deleted file mode 100644 index ff6e648c5998..000000000000 --- a/app/code/Magento/Variable/Test/Mftf/Test/CreateCustomVariableEntityTest.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?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="CreateCustomVariableEntityTest"> - <annotations> - <features value="Variable"/> - <stories value="Create Custom Variable."/> - <title value="Create Custom Variable."/> - <description value="Test for creating a custom variable."/> - <severity value="MAJOR"/> - <group value="variable"/> - <group value="mtf_migrated"/> - </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - </before> - <after> - <actionGroup ref="AdminResetGridFilterActionGroup" stepKey="resetVariablesGrid"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> - <actionGroup ref="AdminNavigateToNewVariablePageActionGroup" stepKey="goToNewVariableAdminPage"/> - <actionGroup ref="AdminFillFormCustomVariableActionGroup" stepKey="fillInCustomVariableData"/> - <actionGroup ref="AdminClickMainButtonActionGroup" stepKey="clickSaveCustomVariable"> - <argument name="button" value="{{AdminMainActionsSection.save}}"/> - </actionGroup> - <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="seeSuccessMessage"> - <argument name="message" value="You saved the custom variable."/> - </actionGroup> - <actionGroup ref="AdminFilterGridActionGroup" stepKey="filterVariablesGridByNewVariableCode" > - <argument name="field" value="{{AdminVariablesFilterSection.codeFilter}}"/> - <argument name="value" value="{{customVariable.code}}"/> - </actionGroup> - <actionGroup ref="AdminFilterGridActionGroup" stepKey="filterVariablesGridByNewVariableName" > - <argument name="field" value="{{AdminVariablesFilterSection.nameFilter}}"/> - <argument name="value" value="{{customVariable.name}}"/> - </actionGroup> - <actionGroup ref="AssertValueInAdminGridActionGroup" stepKey="seeNewVariableInGrid"> - <argument name="value" value="{{customVariable.code}}"/> - </actionGroup> - </test> -</tests> From 32f94251cd330e65d9e3eb7b1f11f1960c81ad87 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Thu, 25 Jul 2019 08:48:47 +0300 Subject: [PATCH 202/230] graphQl-738: code style fix --- .../testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php index f55fc8aa9df0..c839be26897b 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/MediaGalleryTest.php @@ -106,7 +106,10 @@ public function testProductMediaGalleryEntries() $response = $this->graphQlQuery($query); self::assertArrayHasKey('file', $response['products']['items'][0]['media_gallery_entries'][0]); - self::assertContains('magento_image.jpg', $response['products']['items'][0]['media_gallery_entries'][0]['file']); + self::assertContains( + 'magento_image.jpg', + $response['products']['items'][0]['media_gallery_entries'][0]['file'] + ); } /** From 1f06deaf705ee170e588c82f67e0c7f9ddfeb816 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Thu, 25 Jul 2019 08:58:31 +0300 Subject: [PATCH 203/230] graphQl-786: deprecated qty --- .../BundleGraphQl/Model/Resolver/Links/Collection.php | 1 + app/code/Magento/BundleGraphQl/etc/schema.graphqls | 1 + .../Magento/GraphQl/Bundle/BundleProductViewTest.php | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php index 74769e5d56b5..5c8c09a93042 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php @@ -117,6 +117,7 @@ private function fetch() : array 'price' => $link->getSelectionPriceValue(), 'position' => $link->getPosition(), 'id' => $link->getSelectionId(), + 'qty' => (int)$link->getSelectionQty(), 'quantity' => (int)$link->getSelectionQty(), 'is_default' => (bool)$link->getIsDefault(), 'price_type' => $this->enumLookup->getEnumValueFromField( diff --git a/app/code/Magento/BundleGraphQl/etc/schema.graphqls b/app/code/Magento/BundleGraphQl/etc/schema.graphqls index e00a0b43c2e5..74e21d3feaba 100644 --- a/app/code/Magento/BundleGraphQl/etc/schema.graphqls +++ b/app/code/Magento/BundleGraphQl/etc/schema.graphqls @@ -14,6 +14,7 @@ type BundleItem @doc(description: "BundleItem defines an individual item in a bu type BundleItemOption @doc(description: "BundleItemOption defines characteristics and options for a specific bundle item.") { id: Int @doc(description: "The ID assigned to the bundled item option.") label: String @doc(description: "The text that identifies the bundled item option.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\Label") + qty: Float @deprecated(reason: "The `qty` is deprecated. Use `quantity` instead.") @doc(description: "Indicates the quantity of this specific bundle item.") quantity: Float @doc(description: "Indicates the quantity of this specific bundle item.") position: Int @doc(description: "When a bundle item contains multiple options, the relative position of this option compared to the other options.") is_default: Boolean @doc(description: "Indicates whether this option is the default option.") diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php index 32526f1b6a78..5d08078cf764 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Bundle/BundleProductViewTest.php @@ -428,8 +428,9 @@ public function testNonExistentFieldQtyExceptionOnBundleProduct() QUERY; $this->expectException(\Exception::class); - $this->expectExceptionMessage('GraphQL response contains errors: Cannot'. ' ' . - 'query field "qty" on type "ProductInterface".'); + $this->expectExceptionMessage( + 'GraphQL response contains errors: Cannot query field "qty" on type "ProductInterface".' + ); $this->graphQlQuery($query); } } From 53a03252623eedf7c0c8ad01821e7f8287c174a6 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Thu, 25 Jul 2019 08:59:26 +0300 Subject: [PATCH 204/230] graphQl-786: fixed type --- .../Magento/BundleGraphQl/Model/Resolver/Links/Collection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php index 5c8c09a93042..13bf10bc6aca 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php @@ -117,8 +117,8 @@ private function fetch() : array 'price' => $link->getSelectionPriceValue(), 'position' => $link->getPosition(), 'id' => $link->getSelectionId(), - 'qty' => (int)$link->getSelectionQty(), - 'quantity' => (int)$link->getSelectionQty(), + 'qty' => (float)$link->getSelectionQty(), + 'quantity' => (float)$link->getSelectionQty(), 'is_default' => (bool)$link->getIsDefault(), 'price_type' => $this->enumLookup->getEnumValueFromField( 'PriceTypeEnum', From e9b63347f026274dc8c9c2a16d3181ebac0eb950 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Thu, 25 Jul 2019 13:32:27 +0300 Subject: [PATCH 205/230] graphQl-784: added guest tests --- .../Model/Cart/QuoteAddressFactory.php | 2 +- .../Customer/SetBillingAddressOnCartTest.php | 2 +- .../Customer/SetShippingAddressOnCartTest.php | 55 +------------------ .../Guest/SetBillingAddressOnCartTest.php | 43 +++++++++++++++ .../Guest/SetShippingAddressOnCartTest.php | 10 +--- 5 files changed, 49 insertions(+), 63 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php index c3b89fc48dae..af45831e6102 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php @@ -61,7 +61,7 @@ public function __construct( public function createBasedOnInputData(array $addressInput): QuoteAddress { $addressInput['country_id'] = $addressInput['country_code'] ?? ''; - if ($addressInput['country_id'] && !ctype_upper($addressInput['country_code'] )) { + if ($addressInput['country_id'] && !ctype_upper($addressInput['country_code'])) { throw new GraphQlInputException( __('"Country Code" cannot contain lowercase characters.') ); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index 927160c31d0a..a2b2d2e82e60 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -645,7 +645,7 @@ public function testSetNewBillingAddressWithRedundantStreetLine() * @expectedException \Exception * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. */ - public function testSetNewBillingAddressWithLowercaseCountryCode() + public function testSetBillingAddressWithLowerCaseCountry() { $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php index 747eeb21d665..9f2bb5e2a35d 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php @@ -602,59 +602,6 @@ public function testSetShippingAddressToGuestCart() $this->graphQlMutation($query, [], '', $this->getHeaderMap()); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - */ - public function testSetShippingAddressWithLowerCaseCountry() - { - $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); - - $query = <<<QUERY -mutation { - setShippingAddressesOnCart( - input: { - cart_id: "{$maskedQuoteId}" - shipping_addresses: [ - { - address: { - firstname: "John" - lastname: "Doe" - street: ["6161 West Centinella Avenue"] - city: "Culver City" - region: "CA" - postcode: "90230" - country_code: "us" - telephone: "555-555-55-55" - } - } - ] - } - ) { - cart { - shipping_addresses { - region { - code - } - country { - code - } - } - } - } -} -QUERY; - $result = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); - - self::assertCount(1, $result['setShippingAddressesOnCart']['cart']['shipping_addresses']); - $address = reset($result['setShippingAddressesOnCart']['cart']['shipping_addresses']); - - $this->assertEquals('US', $address['country']['code']); - $this->assertEquals('CA', $address['region']['code']); - } - /** * @magentoApiDataFixture Magento/Customer/_files/customer.php * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php @@ -663,7 +610,7 @@ public function testSetShippingAddressWithLowerCaseCountry() * @expectedException \Exception * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. */ - public function testSetNewShippingAddressOnCartWithLowercaseCountryCode() + public function testSetShippingAddressWithLowerCaseCountry() { $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php index 4afcfb2aef9d..796beea877f8 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php @@ -455,6 +455,49 @@ public function testSetNewBillingAddressRedundantStreetLine() $this->graphQlMutation($query); } + /** + * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @expectedException \Exception + * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. + */ + public function testSetBillingAddressWithLowerCaseCountry() + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + + $query = <<<QUERY +mutation { + setBillingAddressOnCart( + input: { + cart_id: "$maskedQuoteId" + billing_address: { + address: { + firstname: "test firstname" + lastname: "test lastname" + company: "test company" + street: ["test street 1", "test street 2"] + city: "test city" + region: "test region" + postcode: "887766" + country_code: "us" + telephone: "88776655" + save_in_address_book: false + } + } + } + ) { + cart { + billing_address { + firstname + } + } + } +} +QUERY; + $this->graphQlMutation($query); + } + /** * Verify the all the whitelisted fields for a New Address Object * diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php index 537c8f09a0a9..553b498d7b9d 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php @@ -411,6 +411,8 @@ public function testSetShippingAddressOnNonExistentCart() * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @expectedException \Exception + * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. */ public function testSetShippingAddressWithLowerCaseCountry() { @@ -450,13 +452,7 @@ public function testSetShippingAddressWithLowerCaseCountry() } } QUERY; - $result = $this->graphQlMutation($query); - - self::assertCount(1, $result['setShippingAddressesOnCart']['cart']['shipping_addresses']); - $address = reset($result['setShippingAddressesOnCart']['cart']['shipping_addresses']); - - $this->assertEquals('US', $address['country']['code']); - $this->assertEquals('CA', $address['region']['code']); + $this->graphQlMutation($query); } /** From 9078004b6a2a01f0ceb1ccfcf13da97674f3ac2c Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Thu, 25 Jul 2019 19:14:44 +0300 Subject: [PATCH 206/230] graphQl-784: removed validation, added the text convert instead --- .../Model/Cart/QuoteAddressFactory.php | 8 ++--- .../Customer/SetBillingAddressOnCartTest.php | 21 +++++++++-- .../Customer/SetShippingAddressOnCartTest.php | 35 +++++++++++-------- .../Guest/SetBillingAddressOnCartTest.php | 25 ++++++++++--- .../Guest/SetShippingAddressOnCartTest.php | 10 ++++-- 5 files changed, 69 insertions(+), 30 deletions(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php index af45831e6102..3ab93e2f0a19 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php @@ -60,12 +60,10 @@ public function __construct( */ public function createBasedOnInputData(array $addressInput): QuoteAddress { - $addressInput['country_id'] = $addressInput['country_code'] ?? ''; - if ($addressInput['country_id'] && !ctype_upper($addressInput['country_code'])) { - throw new GraphQlInputException( - __('"Country Code" cannot contain lowercase characters.') - ); + if ($addressInput['country_code']) { + $addressInput['country_code'] = strtoupper($addressInput['country_code']); } + $addressInput['country_id'] = $addressInput['country_code'] ?? ''; $maxAllowedLineCount = $this->addressHelper->getStreetLines(); if (is_array($addressInput['street']) && count($addressInput['street']) > $maxAllowedLineCount) { diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php index a2b2d2e82e60..011930e72327 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php @@ -642,8 +642,6 @@ public function testSetNewBillingAddressWithRedundantStreetLine() * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @expectedException \Exception - * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. */ public function testSetBillingAddressWithLowerCaseCountry() { @@ -673,12 +671,29 @@ public function testSetBillingAddressWithLowerCaseCountry() cart { billing_address { firstname + lastname + company + street + city + postcode + telephone + country { + code + label + } + __typename } } } } QUERY; - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + $response = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + + self::assertArrayHasKey('cart', $response['setBillingAddressOnCart']); + $cartResponse = $response['setBillingAddressOnCart']['cart']; + self::assertArrayHasKey('billing_address', $cartResponse); + $billingAddressResponse = $cartResponse['billing_address']; + $this->assertNewAddressFields($billingAddressResponse); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php index 9f2bb5e2a35d..15ee12595506 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingAddressOnCartTest.php @@ -607,8 +607,6 @@ public function testSetShippingAddressToGuestCart() * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @expectedException \Exception - * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. */ public function testSetShippingAddressWithLowerCaseCountry() { @@ -618,20 +616,18 @@ public function testSetShippingAddressWithLowerCaseCountry() mutation { setShippingAddressesOnCart( input: { - cart_id: "$maskedQuoteId" + cart_id: "{$maskedQuoteId}" shipping_addresses: [ { address: { - firstname: "test firstname" - lastname: "test lastname" - company: "test company" - street: ["test street 1", "test street 2"] - city: "test city" - region: "test region" - postcode: "887766" + firstname: "John" + lastname: "Doe" + street: ["6161 West Centinella Avenue"] + city: "Culver City" + region: "CA" + postcode: "90230" country_code: "us" - telephone: "88776655" - save_in_address_book: false + telephone: "555-555-55-55" } } ] @@ -639,13 +635,24 @@ public function testSetShippingAddressWithLowerCaseCountry() ) { cart { shipping_addresses { - firstname + region { + code + } + country { + code + } } } } } QUERY; - $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + $result = $this->graphQlMutation($query, [], '', $this->getHeaderMap()); + + self::assertCount(1, $result['setShippingAddressesOnCart']['cart']['shipping_addresses']); + $address = reset($result['setShippingAddressesOnCart']['cart']['shipping_addresses']); + + $this->assertEquals('US', $address['country']['code']); + $this->assertEquals('CA', $address['region']['code']); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php index 796beea877f8..730e65b4ba8a 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php @@ -459,8 +459,6 @@ public function testSetNewBillingAddressRedundantStreetLine() * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @expectedException \Exception - * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. */ public function testSetBillingAddressWithLowerCaseCountry() { @@ -472,7 +470,7 @@ public function testSetBillingAddressWithLowerCaseCountry() input: { cart_id: "$maskedQuoteId" billing_address: { - address: { + address: { firstname: "test firstname" lastname: "test lastname" company: "test company" @@ -483,19 +481,36 @@ public function testSetBillingAddressWithLowerCaseCountry() country_code: "us" telephone: "88776655" save_in_address_book: false - } + } } } ) { cart { billing_address { firstname + lastname + company + street + city + postcode + telephone + country { + code + label + } + __typename } } } } QUERY; - $this->graphQlMutation($query); + $response = $this->graphQlMutation($query); + + self::assertArrayHasKey('cart', $response['setBillingAddressOnCart']); + $cartResponse = $response['setBillingAddressOnCart']['cart']; + self::assertArrayHasKey('billing_address', $cartResponse); + $billingAddressResponse = $cartResponse['billing_address']; + $this->assertNewAddressFields($billingAddressResponse); } /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php index 553b498d7b9d..537c8f09a0a9 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingAddressOnCartTest.php @@ -411,8 +411,6 @@ public function testSetShippingAddressOnNonExistentCart() * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @expectedException \Exception - * @expectedExceptionMessage "Country Code" cannot contain lowercase characters. */ public function testSetShippingAddressWithLowerCaseCountry() { @@ -452,7 +450,13 @@ public function testSetShippingAddressWithLowerCaseCountry() } } QUERY; - $this->graphQlMutation($query); + $result = $this->graphQlMutation($query); + + self::assertCount(1, $result['setShippingAddressesOnCart']['cart']['shipping_addresses']); + $address = reset($result['setShippingAddressesOnCart']['cart']['shipping_addresses']); + + $this->assertEquals('US', $address['country']['code']); + $this->assertEquals('CA', $address['region']['code']); } /** From b27335daf826892fb925e70b57d3932bfafc37d0 Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Thu, 25 Jul 2019 11:44:17 -0500 Subject: [PATCH 207/230] MC-18191: Customer cart section on reloads each web transaction --- .../js/model/cart/totals-processor/default.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js b/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js index 0e94232786c6..ae3067467020 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js @@ -87,17 +87,17 @@ define([ data.shippingCarrierCode = quote.shippingMethod()['carrier_code']; } - if (!cartCache.isChanged('cartVersion', customerData.get('cart')()['data_id']) && - !cartCache.isChanged('shippingMethodCode', data.shippingMethodCode) && - !cartCache.isChanged('shippingCarrierCode', data.shippingCarrierCode) && - !cartCache.isChanged('address', address) && - cartCache.get('totals') && - !cartCache.isChanged('subtotal', parseFloat(quote.totals().subtotal)) - ) { - quote.setTotals(cartCache.get('totals')); - } else { + // if (!cartCache.isChanged('cartVersion', customerData.get('cart')()['data_id']) && + // !cartCache.isChanged('shippingMethodCode', data.shippingMethodCode) && + // !cartCache.isChanged('shippingCarrierCode', data.shippingCarrierCode) && + // !cartCache.isChanged('address', address) && + // cartCache.get('totals') && + // !cartCache.isChanged('subtotal', parseFloat(quote.totals().subtotal)) + // ) { + // quote.setTotals(cartCache.get('totals')); + // } else { return loadFromServer(address); - } + // } } }; }); From 03949568f3deb0ec97b0736a559c19dfbd63cf87 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Thu, 25 Jul 2019 21:58:35 +0300 Subject: [PATCH 208/230] graphQl-784: optimized the code --- .../Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php index 3ab93e2f0a19..28017a1f7aca 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php @@ -60,10 +60,11 @@ public function __construct( */ public function createBasedOnInputData(array $addressInput): QuoteAddress { + $addressInput['country_id'] = ''; if ($addressInput['country_code']) { $addressInput['country_code'] = strtoupper($addressInput['country_code']); } - $addressInput['country_id'] = $addressInput['country_code'] ?? ''; + $addressInput['country_id'] = $addressInput['country_code']; $maxAllowedLineCount = $this->addressHelper->getStreetLines(); if (is_array($addressInput['street']) && count($addressInput['street']) > $maxAllowedLineCount) { From dd0e02b50cbc87cd223434f9738358cf03581213 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko <v.boyko@atwix.com> Date: Thu, 25 Jul 2019 21:59:22 +0300 Subject: [PATCH 209/230] graphQl-784: optimized the code --- .../Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php index 28017a1f7aca..afc88f026ed6 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/QuoteAddressFactory.php @@ -63,8 +63,8 @@ public function createBasedOnInputData(array $addressInput): QuoteAddress $addressInput['country_id'] = ''; if ($addressInput['country_code']) { $addressInput['country_code'] = strtoupper($addressInput['country_code']); + $addressInput['country_id'] = $addressInput['country_code']; } - $addressInput['country_id'] = $addressInput['country_code']; $maxAllowedLineCount = $this->addressHelper->getStreetLines(); if (is_array($addressInput['street']) && count($addressInput['street']) > $maxAllowedLineCount) { From 4f81760e627d6b7479c8a411be4bf678848c8bb9 Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Thu, 25 Jul 2019 15:17:28 -0500 Subject: [PATCH 210/230] MC-18191: Customer cart section on reloads each web transaction --- .../view/frontend/web/js/model/cart/totals-processor/default.js | 2 +- .../Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js b/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js index ae3067467020..0f0de68f8c62 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js @@ -96,7 +96,7 @@ define([ // ) { // quote.setTotals(cartCache.get('totals')); // } else { - return loadFromServer(address); + return loadFromServer(address); // } } }; diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml index e5c77ee41436..d508ebaa2688 100644 --- a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml +++ b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml @@ -54,8 +54,6 @@ <resetCookie userInput="persistent_shopping_cart" stepKey="resetPersistentCookie"/> <amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnHomePageAfterResetPersistentCookie"/> <waitForPageLoad stepKey="waitHomePageLoadAfterResetCookie"/> - <!--Check that the minicart is empty--> - <actionGroup ref="assertMiniCartEmpty" after="waitHomePageLoadAfterResetCookie" stepKey="seeMinicartEmpty"/> <!--Step 4: Add the product to shopping cart and open cart--> <amOnPage url="{{StorefrontProductPage.url($$createProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageAsGuestUser"/> <actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addProductToCartAsGuestUser"> From 7956633a101b2db7e49ed98cb71319209a34339a Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Thu, 25 Jul 2019 15:24:09 -0500 Subject: [PATCH 211/230] Test improvements: - test stabilization --- ...eMainButtonWithConfirmationActionGroup.xml | 18 --------------- .../Mftf/Section/AdminGridTableSection.xml | 1 - ...dSimpleProductToShopingCartActionGroup.xml | 22 +++++++++++++++++++ .../Section/StorefrontMessagesSection.xml | 1 + 4 files changed, 23 insertions(+), 19 deletions(-) delete mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickDeleteMainButtonWithConfirmationActionGroup.xml create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToShopingCartActionGroup.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickDeleteMainButtonWithConfirmationActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickDeleteMainButtonWithConfirmationActionGroup.xml deleted file mode 100644 index 17c9c2dea365..000000000000 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickDeleteMainButtonWithConfirmationActionGroup.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminClickDeleteMainButtonWithConfirmationActionGroup"> - <waitForElementVisible selector="{{AdminMainActionsSection.delete}}" stepKey="waitForDeleteButton"/> - <click selector="{{AdminMainActionsSection.delete}}" stepKey="clickDeleteButton"/> - <waitForText userInput="Are you sure you want to do this?" stepKey="waitForText"/> - <click selector="{{AdminMainActionsSection.confirmDelete}}" stepKey="confirmDelete"/> - <waitForPageLoad stepKey="waitForPageLoad3"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml b/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml index cc6476547dc8..cc92e530cf3d 100644 --- a/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml +++ b/app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml @@ -10,6 +10,5 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminGridTableSection"> <element name="row" type="text" selector="table.data-grid tbody tr[data-role=row]:nth-of-type({{row}})" parameterized="true"/> - <element name="rowByValue" type="text" selector="//table[@class='data-grid']//tbody//tr[@data-role='row'] //td[contains(., '{{var}}')]" parameterized="true" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToShopingCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToShopingCartActionGroup.xml new file mode 100644 index 000000000000..14b1331c7ceb --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontAddSimpleProductToShopingCartActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAddSimpleProductToShoppingCartActionGroup"> + <arguments> + <argument name="product"/> + <argument name="qty" type="string" defaultValue="1" /> + </arguments> + <amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="openProductPage" /> + <waitForPageLoad stepKey="waitForProductPageOpen" /> + <fillField userInput="{{qty}}" selector="{{StorefrontProductInfoMainSection.qty}}" stepKey="fillQty" /> + <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart" /> + <waitForElementVisible selector="{{StorefrontMessagesSection.messageByType('success')}}" stepKey="waitForSuccessMessage" /> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Theme/Test/Mftf/Section/StorefrontMessagesSection.xml b/app/code/Magento/Theme/Test/Mftf/Section/StorefrontMessagesSection.xml index a7bc36f1e629..7f55065fc318 100644 --- a/app/code/Magento/Theme/Test/Mftf/Section/StorefrontMessagesSection.xml +++ b/app/code/Magento/Theme/Test/Mftf/Section/StorefrontMessagesSection.xml @@ -13,5 +13,6 @@ selector="//main//div[contains(@class, 'messages')]//div[contains(@class, 'message')]/div[contains(text(), '{{var1}}')]" parameterized="true" /> + <element name="messageByType" type="text" selector="[data-ui-id='message-{{messageType}}']" parameterized="true" /> </section> </sections> From b23231cbaefb339fe7096ef4467a81f03011839f Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Thu, 25 Jul 2019 16:03:23 -0500 Subject: [PATCH 212/230] magento/graphql-ce#702: [Test coverage] Customer Downloadable Products --- .../CustomerDownloadableProductsTest.php | 75 +++---------------- ...stomer_order_with_downloadable_product.php | 59 +++++++++++++++ ...der_with_downloadable_product_rollback.php | 8 ++ .../Catalog/_files/downloadable_product.php | 74 ------------------ .../_files/downloadable_product_rollback.php | 31 -------- .../Quote/_files/add_downloadable_product.php | 28 ------- 6 files changed, 77 insertions(+), 198 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Downloadable/_files/customer_order_with_downloadable_product.php create mode 100644 dev/tests/integration/testsuite/Magento/Downloadable/_files/customer_order_with_downloadable_product_rollback.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product_rollback.php delete mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_downloadable_product.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php index 5aa461722284..a08092d62a28 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php @@ -8,52 +8,35 @@ namespace Magento\GraphQl\Downloadable; use Magento\Integration\Api\CustomerTokenServiceInterface; -use Magento\Quote\Api\CartManagementInterface; -use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\GraphQlAbstract; -use Magento\Quote\Model\QuoteFactory; /** - * Test retrieving of customer download products + * Test retrieving of customer downloadable products. */ class CustomerDownloadableProductsTest extends GraphQlAbstract { - /** - * @var QuoteFactory - */ - protected $quoteFactory; - - /** - * @var QuoteResource - */ - protected $quoteResource; - /** * @var CustomerTokenServiceInterface */ private $customerTokenService; /** - * @var CartManagementInterface + * @inheritdoc */ - private $cartManagement; + protected function setUp() + { + $objectManager = Bootstrap::getObjectManager(); + $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class); + } /** * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/downloadable_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_downloadable_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php + * @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php + * @magentoApiDataFixture Magento/Downloadable/_files/customer_order_with_downloadable_product.php */ public function testCustomerDownloadableProducts() { - $quote = $this->quoteFactory->create(); - $this->quoteResource->load($quote, 'test_quote', 'reserved_order_id'); - $this->cartManagement->placeOrder($quote->getId()); - $query = $this->getQuery(); $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap()); @@ -88,43 +71,6 @@ public function testCustomerHasNoOrders() self::assertCount(0, $response['customerDownloadableProducts']['items']); } - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php - */ - public function testCustomerHasNoDownloadableProducts() - { - $quote = $this->quoteFactory->create(); - $this->quoteResource->load($quote, 'test_quote', 'reserved_order_id'); - $this->cartManagement->placeOrder($quote->getId()); - - $query = $this->getQuery(); - $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap()); - - self::assertArrayHasKey('items', $response['customerDownloadableProducts']); - self::assertCount(0, $response['customerDownloadableProducts']['items']); - } - - /** - * @inheritdoc - */ - protected function setUp() - { - $objectManager = Bootstrap::getObjectManager(); - $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class); - $this->quoteFactory = $objectManager->get(QuoteFactory::class); - $this->quoteResource = $objectManager->get(QuoteResource::class); - $this->cartManagement = $objectManager->get(CartManagementInterface::class); - } - /** * @return string */ @@ -154,7 +100,6 @@ private function getQuery(): string private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array { $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password); - $headerMap = ['Authorization' => 'Bearer ' . $customerToken]; - return $headerMap; + return ['Authorization' => 'Bearer ' . $customerToken]; } } diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/_files/customer_order_with_downloadable_product.php b/dev/tests/integration/testsuite/Magento/Downloadable/_files/customer_order_with_downloadable_product.php new file mode 100644 index 000000000000..74c52d4642a7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Downloadable/_files/customer_order_with_downloadable_product.php @@ -0,0 +1,59 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Quote\Api\Data\AddressInterface; + +$billingAddress = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Sales\Model\Order\Address::class, + [ + 'data' => [ + AddressInterface::KEY_TELEPHONE => 3468676, + AddressInterface::KEY_POSTCODE => 75477, + AddressInterface::KEY_COUNTRY_ID => 'US', + AddressInterface::KEY_CITY => 'CityM', + AddressInterface::KEY_COMPANY => 'CompanyName', + AddressInterface::KEY_STREET => 'Green str, 67', + AddressInterface::KEY_LASTNAME => 'Smith', + AddressInterface::KEY_FIRSTNAME => 'John', + AddressInterface::KEY_REGION_ID => 1, + ] + ] +); +$billingAddress->setAddressType('billing'); + +$payment = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Sales\Model\Order\Payment::class +); +$payment->setMethod('checkmo'); + +/** @var \Magento\Sales\Model\Order\Item $orderItem */ +$orderItem = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Sales\Model\Order\Item::class +); + +/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */ +$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->get(\Magento\Catalog\Api\ProductRepositoryInterface::class); +$product = $productRepository->getById(1); +$link = $product->getExtensionAttributes()->getDownloadableProductLinks()[0]; + +$orderItem->setProductId(1) + ->setProductType(\Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE) + ->setProductOptions(['links' => [$link->getId()]]) + ->setBasePrice(100) + ->setQtyOrdered(1); + +$order = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Sales\Model\Order::class); +$order->setCustomerEmail('customer@example.com') + ->addItem($orderItem) + ->setIncrementId('100000001') + ->setCustomerId(1) + ->setStoreId(1) + ->setEmailSent(1) + ->setBillingAddress($billingAddress) + ->setPayment($payment); +$order->save(); diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/_files/customer_order_with_downloadable_product_rollback.php b/dev/tests/integration/testsuite/Magento/Downloadable/_files/customer_order_with_downloadable_product_rollback.php new file mode 100644 index 000000000000..96e3adb65a7d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Downloadable/_files/customer_order_with_downloadable_product_rollback.php @@ -0,0 +1,8 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +require __DIR__ . '/../../../Magento/Sales/_files/default_rollback.php'; diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php deleted file mode 100644 index e18a19c423ab..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Catalog\Api\Data\ProductInterfaceFactory; -use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Catalog\Model\Product\Attribute\Source\Status; -use Magento\Downloadable\Model\Product\Type; -use Magento\Catalog\Model\Product\Visibility; -use Magento\Framework\Api\DataObjectHelper; -use Magento\TestFramework\Helper\Bootstrap; -use Magento\Downloadable\Api\Data\LinkInterfaceFactory; -use Magento\Downloadable\Api\Data\LinkInterface; -use Magento\Downloadable\Model\Link; -use Magento\Downloadable\Helper\Download; -use Magento\Framework\Api\ExtensionAttributesFactory; - -$objectManager = Bootstrap::getObjectManager(); -/** @var ProductInterfaceFactory $productFactory */ -$productFactory = $objectManager->get(ProductInterfaceFactory::class); -/** @var DataObjectHelper $dataObjectHelper */ -$dataObjectHelper = Bootstrap::getObjectManager()->get(DataObjectHelper::class); -/** @var ProductRepositoryInterface $productRepository */ -$productRepository = $objectManager->get(ProductRepositoryInterface::class); -/** @var LinkInterfaceFactory $linkFactory */ -$linkFactory = $objectManager->get(LinkInterfaceFactory::class); -/** @var ExtensionAttributesFactory $extensionAttributesFactory */ -$extensionAttributesFactory = $objectManager->get(ExtensionAttributesFactory::class); - -$link = $linkFactory->create(); -$linkData = [ - LINK::KEY_TITLE => 'Downloadable Product Link', - LINK::KEY_LINK_TYPE => Download::LINK_TYPE_URL, - LINK::KEY_IS_SHAREABLE => Link::LINK_SHAREABLE_CONFIG, - LINK::KEY_LINK_URL => 'http://example.com/downloadable.txt', - LINK::KEY_PRICE => 0, - LINK::KEY_NUMBER_OF_DOWNLOADS => 0, - LINK::KEY_SORT_ORDER => 1, -]; - -$dataObjectHelper->populateWithArray($link, $linkData, LinkInterface::class); -$extensionAttributes = $extensionAttributesFactory->create(ProductInterface::class); -$extensionAttributes->setDownloadableProductLinks([$link]); - -$product = $productFactory->create(); -$productData = [ - ProductInterface::TYPE_ID => Type::TYPE_DOWNLOADABLE, - ProductInterface::ATTRIBUTE_SET_ID => 4, - ProductInterface::SKU => 'downloadable_product', - ProductInterface::NAME => 'Downloadable Product', - ProductInterface::PRICE => 10, - ProductInterface::VISIBILITY => Visibility::VISIBILITY_BOTH, - ProductInterface::STATUS => Status::STATUS_ENABLED, - ProductInterface::EXTENSION_ATTRIBUTES_KEY => $extensionAttributes -]; - -$dataObjectHelper->populateWithArray($product, $productData, ProductInterface::class); -/** Out of interface */ -$product - ->setWebsiteIds([1]) - ->setStockData( - [ - 'qty' => 85.5, - 'is_in_stock' => true, - 'manage_stock' => true, - 'is_qty_decimal' => true - ] - ); - -$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product_rollback.php deleted file mode 100644 index ddb897340b34..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/downloadable_product_rollback.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Framework\Registry; -use Magento\TestFramework\Helper\Bootstrap; - -$objectManager = Bootstrap::getObjectManager(); -/** @var ProductRepositoryInterface $productRepository */ -$productRepository = $objectManager->get(ProductRepositoryInterface::class); -/** @var Registry $registry */ -$registry = $objectManager->get(Registry::class); - -$currentArea = $registry->registry('isSecureArea'); -$registry->unregister('isSecureArea'); -$registry->register('isSecureArea', true); - -try { - $productRepository->deleteById('downloadable_product'); -} catch (\Magento\Framework\Exception\NoSuchEntityException $e) { - /** - * Tests which are wrapped with MySQL transaction clear all data by transaction rollback. - */ -} - -$registry->unregister('isSecureArea'); -$registry->register('isSecureArea', $currentArea); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_downloadable_product.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_downloadable_product.php deleted file mode 100644 index 9e18720424f5..000000000000 --- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/add_downloadable_product.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -use Magento\Catalog\Api\ProductRepositoryInterface; -use Magento\Quote\Api\CartRepositoryInterface; -use Magento\Quote\Model\QuoteFactory; -use Magento\Quote\Model\ResourceModel\Quote as QuoteResource; -use Magento\TestFramework\Helper\Bootstrap; - -/** @var ProductRepositoryInterface $productRepository */ -$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class); -/** @var QuoteFactory $quoteFactory */ -$quoteFactory = Bootstrap::getObjectManager()->get(QuoteFactory::class); -/** @var QuoteResource $quoteResource */ -$quoteResource = Bootstrap::getObjectManager()->get(QuoteResource::class); -/** @var CartRepositoryInterface $cartRepository */ -$cartRepository = Bootstrap::getObjectManager()->get(CartRepositoryInterface::class); - -$product = $productRepository->get('downloadable_product'); - -$quote = $quoteFactory->create(); -$quoteResource->load($quote, 'test_quote', 'reserved_order_id'); -$quote->addProduct($product, 1); -$cartRepository->save($quote); From 373b56b14025b1b05cdef5d4c2d0c4d26678506b Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Thu, 25 Jul 2019 16:17:29 -0500 Subject: [PATCH 213/230] magento/graphql-ce#702: [Test coverage] Customer Downloadable Products --- .../CustomerDownloadableProductsTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php index a08092d62a28..47fd8d66b92f 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Downloadable/CustomerDownloadableProductsTest.php @@ -59,6 +59,19 @@ public function testCustomerDownloadableProducts() self::assertNotEmpty($response['customerDownloadableProducts']['items'][0]['status']); } + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Downloadable/_files/product_downloadable.php + * @magentoApiDataFixture Magento/Downloadable/_files/customer_order_with_downloadable_product.php + * + * @expectedException \Exception + * @expectedExceptionMessage The current customer isn't authorized. + */ + public function testGuestCannotAccessDownloadableProducts() + { + $this->graphQlQuery($this->getQuery()); + } + /** * @magentoApiDataFixture Magento/Customer/_files/customer.php */ From 5a997fdc2e987c1371c66014be89734798deddd1 Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina <veronika_kurochkina@epam.com> Date: Fri, 26 Jul 2019 19:18:33 +0300 Subject: [PATCH 214/230] MAGETWO-98748: Incorrect behavior in the category menu on the Storefront --- .../Magento/Catalog/Plugin/Block/Topmenu.php | 9 --- .../AdminCategorySidebarTreeSection.xml | 2 - ...egoryIsHighlightedAndProductsDisplayed.xml | 73 ------------------- app/code/Magento/Theme/Block/Html/Topmenu.php | 10 --- 4 files changed, 94 deletions(-) delete mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/CheckCurrentCategoryIsHighlightedAndProductsDisplayed.xml diff --git a/app/code/Magento/Catalog/Plugin/Block/Topmenu.php b/app/code/Magento/Catalog/Plugin/Block/Topmenu.php index 35ce327c74ea..44f9193ab401 100644 --- a/app/code/Magento/Catalog/Plugin/Block/Topmenu.php +++ b/app/code/Magento/Catalog/Plugin/Block/Topmenu.php @@ -14,11 +14,6 @@ */ class Topmenu { - /** - * Cache tag for menu block - */ - private $cacheTag = "top_menu"; - /** * Catalog category * @@ -124,7 +119,6 @@ public function beforeGetIdentities(\Magento\Theme\Block\Html\Topmenu $subject) $subject->addIdentity(Category::CACHE_TAG); $rootId = $this->storeManager->getStore()->getRootCategoryId(); $storeId = $this->storeManager->getStore()->getId(); - $currentCategory = $this->getCurrentCategory(); /** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */ $collection = $this->getCategoryTree($storeId, $rootId); $mapping = [$rootId => $subject->getMenu()]; // use nodes stack to avoid recursion @@ -134,9 +128,6 @@ public function beforeGetIdentities(\Magento\Theme\Block\Html\Topmenu $subject) } $subject->addIdentity(Category::CACHE_TAG . '_' . $category->getId()); } - if ($currentCategory) { - $subject->addIdentity($this->cacheTag . '_' . Category::CACHE_TAG . '_' . $currentCategory->getId()); - } } /** diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml index ce7d962f3ec7..fba28b3feaff 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategorySidebarTreeSection.xml @@ -13,8 +13,6 @@ <element name="expandAll" type="button" selector=".tree-actions a:last-child"/> <element name="categoryTreeRoot" type="text" selector="div.x-tree-root-node>li.x-tree-node:first-of-type>div.x-tree-node-el:first-of-type" timeout="30"/> <element name="categoryInTree" type="text" selector="//a/span[contains(text(), '{{name}}')]" parameterized="true" timeout="30"/> - <element name="categoryHighlighted" type="text" selector="//ul[@id='ui-id-2']//li//a/span[contains(text(),'{{name}}')]/../.." parameterized="true" timeout="30"/> - <element name="categoryNotHighlighted" type="text" selector="ul[id=\'ui-id-2\'] li[class~=\'active\']" timeout="30"/> <element name="categoryInTreeUnderRoot" type="text" selector="//li/ul/li[@class='x-tree-node']/div/a/span[contains(text(), '{{name}}')]" parameterized="true"/> <element name="lastCreatedCategory" type="block" selector=".x-tree-root-ct li li:last-child" /> <element name="treeContainer" type="block" selector=".tree-holder" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckCurrentCategoryIsHighlightedAndProductsDisplayed.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckCurrentCategoryIsHighlightedAndProductsDisplayed.xml deleted file mode 100644 index 7d09cb419f31..000000000000 --- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckCurrentCategoryIsHighlightedAndProductsDisplayed.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?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="CheckCurrentCategoryIsHighlightedAndProductsDisplayed"> - <annotations> - <features value="Catalog"/> - <stories value="Category"/> - <title value="Сheck that current category is highlighted and all products displayed for it"/> - <description value="Сheck that current category is highlighted and all products displayed for it"/> - <severity value="MAJOR"/> - <testCaseId value="MAGETWO-99028"/> - <useCaseId value="MAGETWO-98748"/> - <group value="Catalog"/> - </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - <createData entity="SimpleSubCategory" stepKey="category1"/> - <createData entity="SimpleSubCategory" stepKey="category2"/> - <createData entity="SimpleSubCategory" stepKey="category3"/> - <createData entity="SimpleSubCategory" stepKey="category4"/> - <createData entity="SimpleProduct" stepKey="product1"> - <requiredEntity createDataKey="category1"/> - </createData> - <createData entity="SimpleProduct" stepKey="product2"> - <requiredEntity createDataKey="category1"/> - </createData> - </before> - <after> - <deleteData createDataKey="product1" stepKey="deleteProduct1"/> - <deleteData createDataKey="product2" stepKey="deleteProduct2"/> - <deleteData createDataKey="category1" stepKey="deleteCategory1"/> - <deleteData createDataKey="category2" stepKey="deleteCategory2"/> - <deleteData createDataKey="category3" stepKey="deleteCategory3"/> - <deleteData createDataKey="category4" stepKey="deleteCategory4"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> - <!--Open Storefront home page--> - <comment userInput="Open Storefront home page" stepKey="openStorefrontHomePage"/> - <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontHomePage"/> - <waitForPageLoad stepKey="waitForSimpleProductPage"/> - <!--Click on first category--> - <comment userInput="Click on first category" stepKey="openFirstCategoryPage"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category1.name$$)}}" stepKey="clickCategory1Name"/> - <waitForPageLoad stepKey="waitForCategory1Page"/> - <!--Check if current category is highlighted and the others are not--> - <comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg1NameIsHighlighted"/> - <grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category1.name$$)}}" userInput="class" stepKey="grabCategory1Class"/> - <assertContains expectedType="string" expected="active" actual="$grabCategory1Class" stepKey="assertCategory1IsHighlighted"/> - <executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount"/> - <assertEquals expectedType="int" expected="1" actual="$highlightedAmount" stepKey="assertRestCategories1IsNotHighlighted"/> - <!--See products in the category page--> - <comment userInput="See products in the category page" stepKey="seeProductsInCategoryPage"/> - <seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product1.name$)}}" stepKey="seeProduct1InCategoryPage"/> - <seeElement selector="{{StorefrontCategoryMainSection.specifiedProductItemInfo($product2.name$)}}" stepKey="seeProduct2InCategoryPage"/> - <!--Click on second category--> - <comment userInput="Click on second category" stepKey="openSecondCategoryPage"/> - <click selector="{{AdminCategorySidebarTreeSection.categoryInTree($$category2.name$$)}}" stepKey="clickCategory2Name"/> - <waitForPageLoad stepKey="waitForCategory2Page"/> - <!--Check if current category is highlighted and the others are not--> - <comment userInput="Check if current category is highlighted and the others are not" stepKey="checkCateg2NameIsHighlighted"/> - <grabAttributeFrom selector="{{AdminCategorySidebarTreeSection.categoryHighlighted($$category2.name$$)}}" userInput="class" stepKey="grabCategory2Class"/> - <assertContains expectedType="string" expected="active" actual="$grabCategory2Class" stepKey="assertCategory2IsHighlighted"/> - <executeJS function="return document.querySelectorAll('{{AdminCategorySidebarTreeSection.categoryNotHighlighted}}').length" stepKey="highlightedAmount2"/> - <assertEquals expectedType="int" expected="1" actual="$highlightedAmount2" stepKey="assertRestCategories1IsNotHighlighted2"/> - </test> -</tests> diff --git a/app/code/Magento/Theme/Block/Html/Topmenu.php b/app/code/Magento/Theme/Block/Html/Topmenu.php index fe5fe686e485..fd8aaa7708cf 100644 --- a/app/code/Magento/Theme/Block/Html/Topmenu.php +++ b/app/code/Magento/Theme/Block/Html/Topmenu.php @@ -74,16 +74,6 @@ protected function getCacheLifetime() return parent::getCacheLifetime() ?: 3600; } - /** - * Get cache key informative items - * - * @return array - */ - public function getCacheKeyInfo() - { - return array_merge(parent::getCacheKeyInfo(), $this->getIdentities()); - } - /** * Get top menu html * From 5e345732c27c9e7de467ebdf8155df9931e446ca Mon Sep 17 00:00:00 2001 From: Daniel Renaud <drenaud@magento.com> Date: Fri, 26 Jul 2019 12:17:28 -0500 Subject: [PATCH 215/230] MC-18552: Add api-functional test for querying for all linked categories for product --- .../testsuite/Magento/GraphQl/Catalog/ProductViewTest.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php index 62e34fe25470..e11e2e8d108c 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductViewTest.php @@ -997,8 +997,6 @@ public function testProductInAllAnchoredCategories() QUERY; $response = $this->graphQlQuery($query); $this->assertNotEmpty($response['products']['items'][0]['categories'], "Categories must not be empty"); - /** @var ProductRepositoryInterface $productRepository */ - $productRepository = ObjectManager::getInstance()->get(ProductRepositoryInterface::class); /** @var CategoryRepositoryInterface $categoryRepository */ $categoryRepository = ObjectManager::getInstance()->get(CategoryRepositoryInterface::class); $categoryIds = [3, 4, 5]; From a2d7094de854590b0278d911bb006c2f87cfca4b Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Fri, 26 Jul 2019 12:59:18 -0500 Subject: [PATCH 216/230] MC-18191: Customer cart section on reloads each web transaction --- .../js/model/cart/totals-processor/default.js | 10 ---------- .../model/cart/totals-processor/default.test.js | 17 ----------------- 2 files changed, 27 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js b/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js index 0f0de68f8c62..d8fea6ea329e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js @@ -87,17 +87,7 @@ define([ data.shippingCarrierCode = quote.shippingMethod()['carrier_code']; } - // if (!cartCache.isChanged('cartVersion', customerData.get('cart')()['data_id']) && - // !cartCache.isChanged('shippingMethodCode', data.shippingMethodCode) && - // !cartCache.isChanged('shippingCarrierCode', data.shippingCarrierCode) && - // !cartCache.isChanged('address', address) && - // cartCache.get('totals') && - // !cartCache.isChanged('subtotal', parseFloat(quote.totals().subtotal)) - // ) { - // quote.setTotals(cartCache.get('totals')); - // } else { return loadFromServer(address); - // } } }; }); diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js index 184118f1d02e..2d5289f60be7 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js @@ -98,20 +98,6 @@ define([ describe('Magento_Checkout/js/model/cart/totals-processor/default', function () { - it('estimateTotals if data was cached', function () { - spyOn(mocks['Magento_Checkout/js/model/cart/cache'], 'isChanged').and.returnValue(false); - spyOn(mocks['Magento_Customer/js/customer-data'], 'get').and.returnValue( - ko.observable({ - 'data_id': 1 - }) - ); - spyOn(mocks['Magento_Checkout/js/model/cart/cache'], 'get').and.returnValue(totals); - spyOn(mocks['mage/storage'], 'post'); - expect(defaultProcessor.estimateTotals(address)).toBeUndefined(); - expect(mocks['Magento_Checkout/js/model/quote'].setTotals).toHaveBeenCalledWith(totals); - expect(mocks['mage/storage'].post).not.toHaveBeenCalled(); - }); - it('estimateTotals if data wasn\'t cached and request was successfully sent', function () { var deferral = new $.Deferred(); @@ -133,8 +119,6 @@ define([ expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(0)[0]).toBe(true); expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(1)[0]).toBe(false); expect(mocks['mage/storage'].post).toHaveBeenCalled(); - expect(mocks['Magento_Checkout/js/model/cart/cache'].get).not.toHaveBeenCalled(); - expect(mocks['Magento_Checkout/js/model/cart/cache'].set).toHaveBeenCalledWith('cart-data', data); }); it('estimateTotals if data wasn\'t cached and request returns error', function () { @@ -154,7 +138,6 @@ define([ expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(0)[0]).toBe(true); expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(1)[0]).toBe(false); expect(mocks['mage/storage'].post).toHaveBeenCalled(); - expect(mocks['Magento_Checkout/js/model/cart/cache'].get).not.toHaveBeenCalled(); expect(mocks['Magento_Checkout/js/model/error-processor'].process).toHaveBeenCalledWith('Error Message'); }); }); From a3fafa3f80349f8458eb7df53eeef34897416c18 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Fri, 26 Jul 2019 12:50:28 -0500 Subject: [PATCH 217/230] magento/graphql-ce#698: customizable_options.values contains everything but value(s) --- ...mpleProductWithCustomOptionsToCartTest.php | 31 ++++++++++++++++--- ...tualProductWithCustomOptionsToCartTest.php | 30 +++++++++++++++--- .../_files/product_simple_with_options.php | 22 +++++++++++++ .../_files/product_virtual_with_options.php | 22 +++++++++++++ 4 files changed, 96 insertions(+), 9 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php index 53be8f84ffc8..f60194d8df32 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php @@ -64,9 +64,10 @@ public function testAddSimpleProductWithOptions() $customizableOptionsOutput = $response['addSimpleProductsToCart']['cart']['items'][0]['customizable_options']; $assignedOptionsCount = count($customOptionsValues); for ($counter = 0; $counter < $assignedOptionsCount; $counter++) { + $expectedValues = $this->buildExpectedValuesArray($customOptionsValues[$counter]['value_string']); self::assertEquals( - $customOptionsValues[$counter]['value_string'], - $customizableOptionsOutput[$counter]['values'][0]['value'] + $expectedValues, + $customizableOptionsOutput[$counter]['values'] ); } } @@ -150,18 +151,38 @@ private function getCustomOptionsValuesForQuery(string $sku): array $optionType = $customOption->getType(); if ($optionType == 'field' || $optionType == 'area') { $customOptionsValues[] = [ - 'id' => (int) $customOption->getOptionId(), + 'id' => (int)$customOption->getOptionId(), 'value_string' => 'test' ]; } elseif ($optionType == 'drop_down') { $optionSelectValues = $customOption->getValues(); $customOptionsValues[] = [ - 'id' => (int) $customOption->getOptionId(), + 'id' => (int)$customOption->getOptionId(), 'value_string' => reset($optionSelectValues)->getOptionTypeId() ]; + } elseif ($optionType == 'multiple') { + $customOptionsValues[] = [ + 'id' => (int)$customOption->getOptionId(), + 'value_string' => '[' . implode(',', array_keys($customOption->getValues())) . ']' + ]; } } - return $customOptionsValues; } + + /** + * Build the part of expected response. + * + * @param string $assignedValue + * @return array + */ + private function buildExpectedValuesArray(string $assignedValue) : array + { + $assignedOptionsArray = explode(',', trim($assignedValue, '[]')); + $expectedArray = []; + foreach ($assignedOptionsArray as $assignedOption) { + $expectedArray[] = ['value' => $assignedOption]; + } + return $expectedArray; + } } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php index 7b3c5de4ba61..7c49ab86120d 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php @@ -64,9 +64,10 @@ public function testAddVirtualProductWithOptions() $customizableOptionsOutput = $response['addVirtualProductsToCart']['cart']['items'][0]['customizable_options']; $assignedOptionsCount = count($customOptionsValues); for ($counter = 0; $counter < $assignedOptionsCount; $counter++) { + $expectedValues = $this->buildExpectedValuesArray($customOptionsValues[$counter]['value_string']); self::assertEquals( - $customOptionsValues[$counter]['value_string'], - $customizableOptionsOutput[$counter]['values'][0]['value'] + $expectedValues, + $customizableOptionsOutput[$counter]['values'] ); } } @@ -150,18 +151,39 @@ private function getCustomOptionsValuesForQuery(string $sku): array $optionType = $customOption->getType(); if ($optionType == 'field' || $optionType == 'area') { $customOptionsValues[] = [ - 'id' => (int) $customOption->getOptionId(), + 'id' => (int)$customOption->getOptionId(), 'value_string' => 'test' ]; } elseif ($optionType == 'drop_down') { $optionSelectValues = $customOption->getValues(); $customOptionsValues[] = [ - 'id' => (int) $customOption->getOptionId(), + 'id' => (int)$customOption->getOptionId(), 'value_string' => reset($optionSelectValues)->getOptionTypeId() ]; + } elseif ($optionType == 'multiple') { + $customOptionsValues[] = [ + 'id' => (int)$customOption->getOptionId(), + 'value_string' => '[' . implode(',', array_keys($customOption->getValues())) . ']' + ]; } } return $customOptionsValues; } + + /** + * Build the part of expected response. + * + * @param string $assignedValue + * @return array + */ + private function buildExpectedValuesArray(string $assignedValue) : array + { + $assignedOptionsArray = explode(',', trim($assignedValue, '[]')); + $expectedArray = []; + foreach ($assignedOptionsArray as $assignedOption) { + $expectedArray[] = ['value' => $assignedOption]; + } + return $expectedArray; + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options.php index a401db8eb2bf..93c7ba61c6f4 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options.php @@ -84,6 +84,28 @@ 'sort_order' => 2, ], ], + ], + [ + 'title' => 'multiple option', + 'type' => 'multiple', + 'is_require' => false, + 'sort_order' => 5, + 'values' => [ + [ + 'title' => 'multiple option 1', + 'price' => 10, + 'price_type' => 'fixed', + 'sku' => 'multiple option 1 sku', + 'sort_order' => 1, + ], + [ + 'title' => 'multiple option 2', + 'price' => 20, + 'price_type' => 'fixed', + 'sku' => 'multiple option 2 sku', + 'sort_order' => 2, + ], + ], ] ]; diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options.php index c1f981cefa64..0b79f0f19468 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options.php @@ -84,6 +84,28 @@ 'sort_order' => 2, ], ], + ], + [ + 'title' => 'multiple option', + 'type' => 'multiple', + 'is_require' => false, + 'sort_order' => 5, + 'values' => [ + [ + 'title' => 'multiple option 1', + 'price' => 10, + 'price_type' => 'fixed', + 'sku' => 'multiple option 1 sku', + 'sort_order' => 1, + ], + [ + 'title' => 'multiple option 2', + 'price' => 20, + 'price_type' => 'fixed', + 'sku' => 'multiple option 2 sku', + 'sort_order' => 2, + ], + ], ] ]; From e8c8293b72cec374101bd43603245248fd3b9c42 Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Fri, 26 Jul 2019 14:23:31 -0500 Subject: [PATCH 218/230] MC-18191: Customer cart section on reloads each web transaction --- .../frontend/js/model/cart/totals-processor/default.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js index 2d5289f60be7..9a0d64f40ae8 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js @@ -115,7 +115,7 @@ define([ return deferral.resolve(result); }); expect(defaultProcessor.estimateTotals(address)).toBe(deferral); - expect(mocks['Magento_Checkout/js/model/quote'].setTotals).toHaveBeenCalledWith(totals); + expect(mocks['Magento_Checkout/js/model/quote'].setTotals).toHaveBeenCalledWith(result); expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(0)[0]).toBe(true); expect(mocks['Magento_Checkout/js/model/totals'].isLoading.calls.argsFor(1)[0]).toBe(false); expect(mocks['mage/storage'].post).toHaveBeenCalled(); From 9e5b46e8722a41e52f50f07aec3338c3522bb0c4 Mon Sep 17 00:00:00 2001 From: Vitalii Zabaznov <vzabaznov@magento.com> Date: Fri, 26 Jul 2019 16:44:00 -0500 Subject: [PATCH 219/230] MC-18191: Customer cart section on reloads each web transaction --- .../frontend/js/model/cart/totals-processor/default.test.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js index 9a0d64f40ae8..9e423ae2f266 100644 --- a/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js +++ b/dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/cart/totals-processor/default.test.js @@ -23,9 +23,6 @@ define([ result = { totals: 10 }, - totals = { - grandTotal: 5 - }, address = { countryId: 'US', region: null, From 89ba392798b3e4ea0914e88c3341efb49ba327d3 Mon Sep 17 00:00:00 2001 From: Patrick McLain <pat@pmclain.com> Date: Sat, 27 Jul 2019 07:38:46 -0400 Subject: [PATCH 220/230] Fix static tests --- .../BuyRequest/SuperAttributeDataProvider.php | 3 +++ .../Resolver/ConfigurableCartItemOptions.php | 15 ++++++++++++++- .../ConfigurableProductGraphQl/composer.json | 2 ++ .../Model/Cart/BuyRequest/BuyRequestBuilder.php | 13 +++++++++++++ .../BuyRequestDataProviderInterface.php | 9 +++++++++ .../CustomizableOptionsDataProvider.php | 3 +++ .../Cart/BuyRequest/QuantityDataProvider.php | 3 +++ .../AddConfigurableProductToCartTest.php | 4 ++-- 8 files changed, 49 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php index 12c192352eb6..3216fb69c074 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Cart/BuyRequest/SuperAttributeDataProvider.php @@ -10,6 +10,9 @@ use Magento\Framework\Stdlib\ArrayManager; use Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestDataProviderInterface; +/** + * DataProvider for building super attribute options in buy requests + */ class SuperAttributeDataProvider implements BuyRequestDataProviderInterface { /** diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php index 4dc17759ee08..fed05208e0d5 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableCartItemOptions.php @@ -19,8 +19,14 @@ */ class ConfigurableCartItemOptions implements ResolverInterface { + /** + * @var Configuration + */ private $configurationHelper; + /** + * @param Configuration $configurationHelper + */ public function __construct( Configuration $configurationHelper ) { @@ -30,7 +36,14 @@ public function __construct( /** * Fetch and format configurable variants. * - * {@inheritdoc} + * @param Field $field + * @param \Magento\Framework\GraphQl\Query\Resolver\ContextInterface $context + * @param ResolveInfo $info + * @param array|null $value + * @param array|null $args + * @return array|\Magento\Framework\GraphQl\Query\Resolver\Value|mixed + * @throws LocalizedException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null) { diff --git a/app/code/Magento/ConfigurableProductGraphQl/composer.json b/app/code/Magento/ConfigurableProductGraphQl/composer.json index a22df27734b7..0784aea73b6b 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/composer.json +++ b/app/code/Magento/ConfigurableProductGraphQl/composer.json @@ -7,6 +7,8 @@ "magento/module-catalog": "*", "magento/module-configurable-product": "*", "magento/module-catalog-graph-ql": "*", + "magento/module-quote": "*", + "magento/module-quote-graph-ql": "*", "magento/framework": "*" }, "license": [ diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestBuilder.php b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestBuilder.php index 492dd18f14e0..90f32e96a5fd 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestBuilder.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestBuilder.php @@ -10,6 +10,9 @@ use Magento\Framework\DataObject; use Magento\Framework\DataObjectFactory; +/** + * Build buy request for adding products to cart + */ class BuyRequestBuilder { /** @@ -22,6 +25,10 @@ class BuyRequestBuilder */ private $dataObjectFactory; + /** + * @param DataObjectFactory $dataObjectFactory + * @param array $providers + */ public function __construct( DataObjectFactory $dataObjectFactory, array $providers = [] @@ -30,6 +37,12 @@ public function __construct( $this->providers = $providers; } + /** + * Build buy request for adding product to cart + * + * @param array $cartItemData + * @return DataObject + */ public function build(array $cartItemData): DataObject { $requestData = []; diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestDataProviderInterface.php b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestDataProviderInterface.php index adfc5b13b762..cd61b52db1be 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestDataProviderInterface.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/BuyRequestDataProviderInterface.php @@ -7,7 +7,16 @@ namespace Magento\QuoteGraphQl\Model\Cart\BuyRequest; +/** + * Build buy request for adding products to cart + */ interface BuyRequestDataProviderInterface { + /** + * Build buy request for adding product to cart + * + * @param array $cartItemData + * @return DataObject + */ public function execute(array $cartItemData): array; } diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/CustomizableOptionsDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/CustomizableOptionsDataProvider.php index 62f0e3662a7c..1f953ed5ed3a 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/CustomizableOptionsDataProvider.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/CustomizableOptionsDataProvider.php @@ -9,6 +9,9 @@ use Magento\Framework\Stdlib\ArrayManager; +/** + * Extract buy request elements require for custom options + */ class CustomizableOptionsDataProvider implements BuyRequestDataProviderInterface { /** diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/QuantityDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/QuantityDataProvider.php index b93c2c8f511e..b698a557cf57 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/QuantityDataProvider.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/BuyRequest/QuantityDataProvider.php @@ -10,6 +10,9 @@ use Magento\Framework\GraphQl\Exception\GraphQlInputException; use Magento\Framework\Stdlib\ArrayManager; +/** + * Provides QTY buy request data for adding products to cart + */ class QuantityDataProvider implements BuyRequestDataProviderInterface { /** diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php index 9148539a8cf7..9166ad84be90 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/AddConfigurableProductToCartTest.php @@ -90,7 +90,7 @@ public function testAddProductWithInvalidOptions() 1 ); - $response = $this->graphQlMutation($query); + $this->graphQlMutation($query); } /** @@ -117,7 +117,7 @@ public function testAddProductIfQuantityIsNotAvailable() 2000 ); - $response = $this->graphQlMutation($query); + $this->graphQlMutation($query); } /** From 493e052fdc711ae0167a110b5df19d13a8ff39db Mon Sep 17 00:00:00 2001 From: Patrick McLain <pat@pmclain.com> Date: Sat, 27 Jul 2019 07:45:15 -0400 Subject: [PATCH 221/230] Update resolver for GetCartForUser changes Passes the require storeId parameter --- .../Model/Resolver/AddConfigurableProductsToCart.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/AddConfigurableProductsToCart.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/AddConfigurableProductsToCart.php index ac7aff4f408f..cd7ee3524847 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/AddConfigurableProductsToCart.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/AddConfigurableProductsToCart.php @@ -59,7 +59,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value } $cartItems = $args['input']['cart_items']; - $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId()); + $storeId = (int)$context->getExtensionAttributes()->getStore()->getId(); + $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId); $this->addProductsToCart->execute($cart, $cartItems); return [ From c7d9130289993310992cb3e4a0b5ec7c3dd196bd Mon Sep 17 00:00:00 2001 From: Patrick McLain <pat@pmclain.com> Date: Sat, 27 Jul 2019 09:37:25 -0400 Subject: [PATCH 222/230] Remove looped item save CartItemRepositoryInterface::save trigger quote collection and save. The update cart items resolver accepts multiple quote items and save the quote. Saving each quote item increases the quote save by the number of items passed in the update request. --- app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php b/app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php index b18c6ad66233..81a7779eb98b 100644 --- a/app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php +++ b/app/code/Magento/QuoteGraphQl/Model/Cart/UpdateCartItem.php @@ -117,7 +117,6 @@ private function updateItemQuantity(int $itemId, Quote $cart, float $quantity) } $cartItem->setQty($quantity); $this->validateCartItem($cartItem); - $this->cartItemRepository->save($cartItem); } /** From 3708732c8f64fa9d87b9230e56faaa19de05199a Mon Sep 17 00:00:00 2001 From: Nikita Fomin <nikita.fomin@transoftgroup.com> Date: Mon, 29 Jul 2019 11:06:47 +0300 Subject: [PATCH 223/230] MC-227: Customer should be able to see search results when searching for bundle products by keyword --- .../Bundle/Test/Mftf/Data/ProductData.xml | 31 ++++ ...omerSearchBundleProductsByKeywordsTest.xml | 137 ++++++++++++++++++ .../Test/Mftf/Data/CustomAttributeData.xml | 16 ++ .../StorefrontCatalogSearchActionGroup.xml | 7 + 4 files changed, 191 insertions(+) create mode 100644 app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml index 5034c72b9ee3..6e7e4a7a1657 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml @@ -107,4 +107,35 @@ <requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity> <requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity> </entity> + <entity name="DynamicBundleProductCustomDescription" type="product2"> + <data key="name" unique="suffix">Test 123 Dynamic </data> + <data key="sku" unique="suffix">test-dynamic-bundle-product</data> + <data key="type_id">bundle</data> + <data key="attribute_set_id">4</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="urlKey" unique="suffix">test-dynamic-bundle-product</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute">CustomDynamicProductDescription</requiredEntity> + <requiredEntity type="custom_attribute">CustomDynamicProductShortDescription</requiredEntity> + <requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity> + <requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity> + </entity> + <entity name="FixedBundleProductCustomDescription" type="product2"> + <data key="name" unique="suffix">Test 123 Fixed </data> + <data key="sku" unique="suffix">test-fixed-bundle-product</data> + <data key="type_id">bundle</data> + <data key="attribute_set_id">4</data> + <data key="price">10</data> + <data key="visibility">4</data> + <data key="status">1</data> + <data key="urlKey" unique="suffix">api-fixed-bundle-product</data> + <requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity> + <requiredEntity type="custom_attribute">CustomFixedProductDescription</requiredEntity> + <requiredEntity type="custom_attribute">CustomFixedProductShortDescription</requiredEntity> + <requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity> + <requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity> + <requiredEntity type="custom_attribute">CustomAttributeFixWeight</requiredEntity> + <requiredEntity type="custom_attribute">CustomAttributeFixSku</requiredEntity> + </entity> </entities> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml new file mode 100644 index 000000000000..d27cd0df8823 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontCustomerSearchBundleProductsByKeywordsTest.xml @@ -0,0 +1,137 @@ +<?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="StorefrontCustomerSearchBundleProductsByKeywordsTest"> + <annotations> + <features value="Bundle"/> + <stories value="Bundle products list on Storefront"/> + <title value="Customer should be able to see search results when searching for bundle products by keyword"/> + <description value="Customer should be able to see search results when searching for bundle products by keyword"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-227"/> + <group value="bundle"/> + </annotations> + <before> + <createData entity="SimpleProductNotVisibleIndividually" stepKey="createSimpleProduct"/> + <createData entity="DynamicBundleProductCustomDescription" stepKey="createDynamicBundle"/> + <createData entity="DropDownBundleOption" stepKey="dynamicBundleOption"> + <requiredEntity createDataKey="createDynamicBundle"/> + </createData> + <createData entity="ApiBundleLink" stepKey="createDynamicBundleLink"> + <requiredEntity createDataKey="createDynamicBundle"/> + <requiredEntity createDataKey="dynamicBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + <createData entity="SimpleProductNotVisibleIndividually" stepKey="createSimpleProductTwo"/> + <createData entity="FixedBundleProductCustomDescription" stepKey="createFixedBundle"/> + <createData entity="DropDownBundleOption" stepKey="fixedBundleOption"> + <requiredEntity createDataKey="createFixedBundle"/> + </createData> + <createData entity="ApiBundleLink" stepKey="createFixedBundleLink"> + <requiredEntity createDataKey="createFixedBundle"/> + <requiredEntity createDataKey="fixedBundleOption"/> + <requiredEntity createDataKey="createSimpleProductTwo"/> + </createData> + <magentoCLI command="indexer:reindex" arguments="cataloginventory_stock catalogsearch_fulltext" stepKey="reindex"/> + </before> + <after> + <deleteData createDataKey="createDynamicBundle" stepKey="deleteDynamicBundleProduct"/> + <deleteData createDataKey="createFixedBundle" stepKey="deleteFixedBundleProduct"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <deleteData createDataKey="createSimpleProductTwo" stepKey="createSimpleProductTwo"/> + </after> + <!-- 1. Go to storefront home page --> + <amOnPage url="{{StorefrontHomePage.url}}" stepKey="goToStorefrontPage"/> + <!-- 2. Fill quick search bar with test values unique for dynamic bundle product and click search --> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchDynamic"> + <argument name="phrase" value="Dynamic"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDynamic"> + <argument name="productName" value="$createDynamicBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="assertFixedBundleInSearchResultByDynamic"> + <argument name="productName" value="$createFixedBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescription"> + <argument name="phrase" value="Dynamicscription"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByDescription"> + <argument name="productName" value="$createDynamicBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByDescription"> + <argument name="productName" value="$createFixedBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShortDescription"> + <argument name="phrase" value="Dynamictest"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="assertDynamicBundleInSearchResultByShortDescription"> + <argument name="productName" value="$createDynamicBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeFixedBundleInSearchResultByShortDescription"> + <argument name="productName" value="$createFixedBundle.name$"/> + </actionGroup> + <!-- 3. Fill quick search bar with test values mutual for both products and click search --> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTest123"> + <argument name="phrase" value="Test 123"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTest123"> + <argument name="productName" value="$createDynamicBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTest123"> + <argument name="productName" value="$createFixedBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchTesting321"> + <argument name="phrase" value="Testing 321"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByTesting321"> + <argument name="productName" value="$createDynamicBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByTesting321"> + <argument name="productName" value="$createFixedBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchShort555"> + <argument name="phrase" value="Short 555"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeDynamicBundleByShort555"> + <argument name="productName" value="$createDynamicBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShort555"> + <argument name="productName" value="$createFixedBundle.name$"/> + </actionGroup> + <!-- 4. Fill quick search bar with test values unique for fixed bundle product and click search --> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByFixed"> + <argument name="phrase" value="Fixed"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByFixed"> + <argument name="productName" value="$createFixedBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByFixed"> + <argument name="productName" value="$createDynamicBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByDescriptionForFixed"> + <argument name="phrase" value="Fixedscription"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByDescriptionForFixed"> + <argument name="productName" value="$createFixedBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicProductByDescriptionForFixed"> + <argument name="productName" value="$createDynamicBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontCheckQuickSearchStringActionGroup" stepKey="quickSearchByShortDescriptionForFixed"> + <argument name="phrase" value="Fixedtest"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchSeeProductByName" stepKey="seeFixedBundleByShortDescriptionForFixed"> + <argument name="productName" value="$createFixedBundle.name$"/> + </actionGroup> + <actionGroup ref="StorefrontQuickSearchCheckProductNameNotInGrid" stepKey="dontSeeDynamicBundleByShortDescriptionForFixed"> + <argument name="productName" value="$createDynamicBundle.name$"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/CustomAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/CustomAttributeData.xml index 389c41abf0bd..1684bd0c8a2c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/CustomAttributeData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/CustomAttributeData.xml @@ -35,4 +35,20 @@ <data key="attribute_code">news_from_date</data> <data key="value">2018-05-17 00:00:00</data> </entity> + <entity name="CustomDynamicProductDescription" type="custom_attribute"> + <data key="attribute_code">description</data> + <data key="value">Dynamicscription testing 321</data> + </entity> + <entity name="CustomDynamicProductShortDescription" type="custom_attribute"> + <data key="attribute_code">short_description</data> + <data key="value">Short dynamictest 555</data> + </entity> + <entity name="CustomFixedProductDescription" type="custom_attribute"> + <data key="attribute_code">description</data> + <data key="value">Fixedscription testing 321</data> + </entity> + <entity name="CustomFixedProductShortDescription" type="custom_attribute"> + <data key="attribute_code">short_description</data> + <data key="value">Short Fixedtest 555</data> + </entity> </entities> diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml index 067d76821d68..34e86566d73b 100644 --- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml +++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml @@ -64,6 +64,13 @@ <see selector="{{StorefrontQuickSearchResultsSection.productByIndex(index)}}" userInput="{{productName}}" stepKey="seeProductName"/> </actionGroup> + <actionGroup name="StorefrontQuickSearchSeeProductByName"> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <see selector="{{StorefrontQuickSearchResultsSection.productByName(productName)}}" userInput="{{productName}}" stepKey="seeProductName"/> + </actionGroup> + <actionGroup name="StorefrontQuickSearchCheckProductNameNotInGrid"> <arguments> <argument name="productName" type="string"/> From 98336ee2eeac555d123cb2d39c975a4ea8210720 Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Mon, 29 Jul 2019 11:14:58 +0200 Subject: [PATCH 224/230] MC-16957: Clean up composer.json --- composer.json | 4 -- composer.lock | 107 +++++++++++++++++++++++--------------------------- 2 files changed, 49 insertions(+), 62 deletions(-) diff --git a/composer.json b/composer.json index e4cbc36435d4..6114c27d7bce 100644 --- a/composer.json +++ b/composer.json @@ -338,10 +338,6 @@ { "type": "vcs", "url": "https://github.com/magento/composer" - }, - { - "type": "vcs", - "url": "https://github.com/magento-techdivision/zf1.git" } ], "prefer-stable": true diff --git a/composer.lock b/composer.lock index ece9119f0450..d4acf3898953 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b5611ffe70383d5db27c29933e68f5ee", + "content-hash": "d55d503c59af9e0284df419675ed4114", "packages": [ { "name": "braintree/braintree_php", @@ -1069,22 +1069,15 @@ "version": "1.14.2", "source": { "type": "git", - "url": "https://github.com/magento-techdivision/zf1.git", - "reference": "b93bba50de7535c49bd3fac43578c1261bb3c431" + "url": "https://github.com/magento/zf1.git", + "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento-techdivision/zf1/zipball/b93bba50de7535c49bd3fac43578c1261bb3c431", - "reference": "b93bba50de7535c49bd3fac43578c1261bb3c431", + "url": "https://api.github.com/repos/magento/zf1/zipball/8221062d42a198e431d183bbe672e5e1a2f98c5f", + "reference": "8221062d42a198e431d183bbe672e5e1a2f98c5f", "shasum": "" }, - "archive": { - "exclude": [ - "/demos", - "/documentation", - "/tests" - ] - }, "require": { "php": ">=5.2.11" }, @@ -1103,6 +1096,7 @@ "Zend_": "library/" } }, + "notification-url": "https://packagist.org/downloads/", "include-path": [ "library/" ], @@ -1112,13 +1106,10 @@ "description": "Magento Zend Framework 1", "homepage": "http://framework.zend.com/", "keywords": [ - "framework", - "zf1" + "ZF1", + "framework" ], - "support": { - "source": "https://github.com/magento-techdivision/zf1/tree/1.14.2" - }, - "time": "2019-07-01T09:23:21+00:00" + "time": "2019-07-26T16:43:11+00:00" }, { "name": "monolog/monolog", @@ -2091,7 +2082,7 @@ }, { "name": "symfony/css-selector", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", @@ -2125,14 +2116,14 @@ "MIT" ], "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" @@ -2207,7 +2198,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -2257,16 +2248,16 @@ }, { "name": "symfony/finder", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a" + "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a", - "reference": "33c21f7d5d3dc8a140c282854a7e13aeb5d0f91a", + "url": "https://api.github.com/repos/symfony/finder/zipball/9638d41e3729459860bb96f6247ccb61faaa45f2", + "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2", "shasum": "" }, "require": { @@ -2302,7 +2293,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-06-13T11:03:18+00:00" + "time": "2019-06-28T13:16:30+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8687,7 +8678,7 @@ }, { "name": "symfony/browser-kit", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", @@ -8746,16 +8737,16 @@ }, { "name": "symfony/config", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "9198eea354be75794a7b1064de00d9ae9ae5090f" + "reference": "a17a2aea43950ce83a0603ed301bac362eb86870" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/9198eea354be75794a7b1064de00d9ae9ae5090f", - "reference": "9198eea354be75794a7b1064de00d9ae9ae5090f", + "url": "https://api.github.com/repos/symfony/config/zipball/a17a2aea43950ce83a0603ed301bac362eb86870", + "reference": "a17a2aea43950ce83a0603ed301bac362eb86870", "shasum": "" }, "require": { @@ -8806,20 +8797,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-06-08T06:33:08+00:00" + "time": "2019-07-18T10:34:59+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "b851928be349c065197fdc0832f78d85139e3903" + "reference": "9ad1b83d474ae17156f6914cb81ffe77aeac3a9b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/b851928be349c065197fdc0832f78d85139e3903", - "reference": "b851928be349c065197fdc0832f78d85139e3903", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/9ad1b83d474ae17156f6914cb81ffe77aeac3a9b", + "reference": "9ad1b83d474ae17156f6914cb81ffe77aeac3a9b", "shasum": "" }, "require": { @@ -8879,11 +8870,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-06-15T04:08:07+00:00" + "time": "2019-07-26T07:03:43+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", @@ -8944,16 +8935,16 @@ }, { "name": "symfony/http-foundation", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "e1b507fcfa4e87d192281774b5ecd4265370180d" + "reference": "8b778ee0c27731105fbf1535f51793ad1ae0ba2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e1b507fcfa4e87d192281774b5ecd4265370180d", - "reference": "e1b507fcfa4e87d192281774b5ecd4265370180d", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/8b778ee0c27731105fbf1535f51793ad1ae0ba2b", + "reference": "8b778ee0c27731105fbf1535f51793ad1ae0ba2b", "shasum": "" }, "require": { @@ -8995,20 +8986,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-06-26T09:25:00+00:00" + "time": "2019-07-23T11:21:36+00:00" }, { "name": "symfony/mime", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b" + "reference": "6b7148029b1dd5eda1502064f06d01357b7b2d8b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ec2c5565de60e03f33d4296a655e3273f0ad1f8b", - "reference": "ec2c5565de60e03f33d4296a655e3273f0ad1f8b", + "url": "https://api.github.com/repos/symfony/mime/zipball/6b7148029b1dd5eda1502064f06d01357b7b2d8b", + "reference": "6b7148029b1dd5eda1502064f06d01357b7b2d8b", "shasum": "" }, "require": { @@ -9054,11 +9045,11 @@ "mime", "mime-type" ], - "time": "2019-06-04T09:22:54+00:00" + "time": "2019-07-19T16:21:19+00:00" }, { "name": "symfony/options-resolver", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -9346,7 +9337,7 @@ }, { "name": "symfony/stopwatch", - "version": "v4.3.2", + "version": "v4.3.3", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", @@ -9396,16 +9387,16 @@ }, { "name": "symfony/yaml", - "version": "v3.4.29", + "version": "v3.4.30", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" + "reference": "051d045c684148060ebfc9affb7e3f5e0899d40b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", - "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "url": "https://api.github.com/repos/symfony/yaml/zipball/051d045c684148060ebfc9affb7e3f5e0899d40b", + "reference": "051d045c684148060ebfc9affb7e3f5e0899d40b", "shasum": "" }, "require": { @@ -9451,7 +9442,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-03-25T07:48:46+00:00" + "time": "2019-07-24T13:01:31+00:00" }, { "name": "theseer/fdomdocument", From aff63b3509de228945a11283c7596f09f1ac47de Mon Sep 17 00:00:00 2001 From: Veronika Kurochkina <veronika_kurochkina@epam.com> Date: Mon, 29 Jul 2019 13:25:05 +0300 Subject: [PATCH 225/230] MAGETWO-72172: [2.3] Disabled variation of configurable product can be added to shopping cart via admin --- ...vailableToConfigureDisabledProductTest.xml | 128 ------------------ .../Controller/Adminhtml/Order/Create.php | 1 + .../AdminOrderFormConfigureProductSection.xml | 1 - .../AdminCreateOrderWithBundleProductTest.xml | 6 - 4 files changed, 1 insertion(+), 135 deletions(-) delete mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml deleted file mode 100644 index f52bdb1851b5..000000000000 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/NoOptionAvailableToConfigureDisabledProductTest.xml +++ /dev/null @@ -1,128 +0,0 @@ -<?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="NoOptionAvailableToConfigureDisabledProductTest"> - <annotations> - <stories value="Disabled Product"/> - <title value="Disabled variation of configurable product can't be added to shopping cart via admin"/> - <description value="Disabled variation of configurable product can't be added to shopping cart via admin"/> - <severity value="AVERAGE"/> - <testCaseId value="MC-17373"/> - <useCaseId value="MAGETWO-72172"/> - <group value="ConfigurableProduct"/> - </annotations> - <before> - <actionGroup ref="LoginAsAdmin" stepKey="login"/> - <!--Create category--> - <comment userInput="Create category" stepKey="commentCreateCategory"/> - <createData entity="SimpleSubCategory" stepKey="createCategory"/> - <!-- Create the configurable product based on the data in the data folder --> - <comment userInput="Create the configurable product based on the data in the data folder" stepKey="createConfigurableProduct"/> - <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> - <requiredEntity createDataKey="createCategory"/> - </createData> - <!-- Create the configurable product with two options based on the default attribute set --> - <comment userInput="Create the configurable product with two options based on the default attribute set" stepKey="configurableProductWithTwoOptions"/> - <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> - <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </createData> - <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </getData> - <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </getData> - <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - </getData> - <!-- Create the 2 children that will be a part of the configurable product --> - <comment userInput="Create the 2 children that will be a part of the configurable product" stepKey="createTwoChildrenProducts"/> - <createData entity="ApiSimpleProductWithPrice50" stepKey="createConfigChildProduct1"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption1"/> - </createData> - <createData entity="ApiSimpleProductWithPrice60" stepKey="createConfigChildProduct2"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption2"/> - </createData> - <createData entity="ApiSimpleProductWithPrice70" stepKey="createConfigChildProduct3"> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption3"/> - </createData> - <!-- Assign two products to the configurable product --> - <comment userInput="Assign two products to the configurable product" stepKey="assignToConfigurableProduct"/> - <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigProductAttribute"/> - <requiredEntity createDataKey="getConfigAttributeOption1"/> - <requiredEntity createDataKey="getConfigAttributeOption2"/> - <requiredEntity createDataKey="getConfigAttributeOption3"/> - </createData> - <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigChildProduct1"/> - </createData> - <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigChildProduct2"/> - </createData> - <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> - <requiredEntity createDataKey="createConfigProduct"/> - <requiredEntity createDataKey="createConfigChildProduct3"/> - </createData> - <!--Create Customer--> - <comment userInput="Create customer" stepKey="commentCreateCustomer"/> - <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> - </before> - <after> - <!--Delete created data--> - <comment userInput="Delete created data" stepKey="deleteData"/> - <deleteData createDataKey="createCategory" stepKey="deleteCategory2"/> - <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> - <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/> - <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/> - <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteConfigChildProduct3"/> - <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> - <deleteData createDataKey="createCustomer" stepKey="deleteCreatedCustomer"/> - <actionGroup ref="logout" stepKey="logout"/> - </after> - <!--Disable child product --> - <comment userInput="Disable child product" stepKey="disableChildProduct"/> - <amOnPage url="{{AdminProductEditPage.url($$createConfigChildProduct1.id$$)}}" stepKey="goToEditPage"/> - <waitForPageLoad stepKey="waitForChildProductPageLoad"/> - <click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="disableProduct"/> - <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> - <!--Go to created customer page--> - <comment userInput="Go to created customer page" stepKey="goToCreatedCustomerPage"/> - <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="createNewOrder"> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> - <click selector="{{AdminOrderFormItemsSection.addProducts}}" stepKey="clickToAddProduct"/> - <waitForPageLoad stepKey="waitForProductsOpened"/> - <!--Find created configurable product and click on "Configure" link--> - <comment userInput="Find created configurable product and click on Configure link" stepKey="goToConfigurableLink"/> - <click selector="{{AdminOrderFormConfigureProductSection.configure($$createConfigProduct.id$$)}}" stepKey="clickOnConfigure"/> - <!--Click on attribute drop-down and check no option 1 is available--> - <comment userInput="Click on attribute drop-down and check no option 1 is available" stepKey="commentNoOptionIsAvailable"/> - <waitForElement selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="waitForShippingSectionLoaded"/> - <click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickToSelectOption"/> - <dontSee userInput="$$createConfigProductAttributeOption1.option[store_labels][1][label]$$" stepKey="dontSeeOption1"/> - </test> -</tests> diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php index 6058523ac584..341ee16ae910 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php @@ -55,6 +55,7 @@ public function __construct( ForwardFactory $resultForwardFactory ) { parent::__construct($context); + $productHelper->setSkipSaleableCheck(true); $this->escaper = $escaper; $this->resultPageFactory = $resultPageFactory; $this->resultForwardFactory = $resultForwardFactory; diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml index 4f065ec7eb74..8c093891ac46 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml @@ -9,7 +9,6 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminOrderFormConfigureProductSection"> - <element name="configure" type="button" selector="//a[@product_id='{{productId}}']" parameterized="true"/> <element name="optionSelect" type="select" selector="//div[contains(@class,'product-options')]//select[//label[text() = '{{option}}']]" parameterized="true"/> <element name="optionSelectNew" type="select" selector="//label[text()='{{option1}}']/following-sibling::div/select" parameterized="true"/> <element name="quantity" type="input" selector="#product_composite_configure_input_qty"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml index 5613334c464b..d087b291de87 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml @@ -77,12 +77,6 @@ <field key="qty">2</field> </createData> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> - - <!--Go to bundle product page and save it to force "in stock" status--> - <actionGroup ref="goToProductPageViaID" stepKey="goToBundleProductPage"> - <argument name="productId" value="$product.id$"/> - </actionGroup> - <actionGroup ref="saveProductForm" stepKey="saveBundleProduct"/> </before> <!--Create new customer order--> From 55feda69c097dead6760d52a28d7d09f7c51cc91 Mon Sep 17 00:00:00 2001 From: Stas Puga <stas.puga@transoftgroup.com> Date: Mon, 29 Jul 2019 13:45:16 +0300 Subject: [PATCH 226/230] MC-219: Admin should be able to mass update attributes for bundle products --- ...sUpdateAttributesForBundleProductsTest.xml | 76 +++++++++++++++++++ .../ActionGroup/AdminProductActionGroup.xml | 17 +++++ ...nProductAttributeMassUpdateActionGroup.xml | 29 +++++++ .../Data/ProductAttributeMassUpdateData.xml | 15 ++++ .../Section/AdminUpdateAttributesSection.xml | 1 + 5 files changed, 138 insertions(+) create mode 100644 app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeMassUpdateActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMassUpdateData.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml new file mode 100644 index 000000000000..fe55fda4d0e0 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest.xml @@ -0,0 +1,76 @@ +<?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="AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest"> + <annotations> + <features value="Bundle"/> + <stories value="Admin list bundle products"/> + <title value="Admin should be able to mass update attributes for bundle products"/> + <description value="Admin should be able to mass update attributes for bundle products"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-219"/> + <group value="bundle"/> + <group value="WYSIWYGDisabled"/> + </annotations> + <before> + <!-- Create Simple Product --> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> + <!-- Create Fixed Bundle Product --> + <createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"/> + <!-- Create DropDown Bundle Option --> + <createData entity="DropDownBundleOption" stepKey="createBundleOption"> + <requiredEntity createDataKey="createFixedBundleProduct"/> + </createData> + <!-- Link Simple Product --> + <createData entity="ApiBundleLink" stepKey="createNewBundleLink"> + <requiredEntity createDataKey="createFixedBundleProduct"/> + <requiredEntity createDataKey="createBundleOption"/> + <requiredEntity createDataKey="createSimpleProduct"/> + </createData> + </before> + <after> + <!-- Delete Simple Product --> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <!-- Delete Fixed Bundle Product --> + <deleteData createDataKey="createFixedBundleProduct" stepKey="deleteBundleProduct"/> + <!-- Clear Filter --> + <actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/> + <!--Log Out Admin--> + <actionGroup ref="logout" stepKey="logoutAsAdmin"/> + </after> + <!-- Login as Admin --> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + <!-- Go to Catalog -> Catalog -> Products and Search created product in precondition and choose it --> + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProduct"> + <argument name="product" value="$$createFixedBundleProduct$$"/> + </actionGroup> + <!-- Choose "Update attributes" and Change any product data --> + <actionGroup ref="AdminUpdateProductNameAndDescriptionAttributes" stepKey="updateProductAttribute"> + <argument name="product" value="UpdateAttributeNameAndDescription"/> + </actionGroup> + <!--Run cron twice--> + <magentoCLI command="cron:run" stepKey="cronRun"/> + <magentoCLI command="cron:run" stepKey="cronRunTwice"/> + <!-- Search for a product with a new name and Open Product --> + <actionGroup ref="filterProductGridByName" stepKey="searchWithNewProductName"> + <argument name="product" value="UpdateAttributeNameAndDescription"/> + </actionGroup> + <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage"> + <argument name="product" value="$$createFixedBundleProduct$$"/> + </actionGroup> + <!-- Assert product name and description --> + <actionGroup ref="AssertProductNameInProductEditForm" stepKey="assertProductName"> + <argument name="productName" value="{{UpdateAttributeNameAndDescription.name}}"/> + </actionGroup> + <actionGroup ref="AssertProductDescriptionInProductEditForm" stepKey="assertProductDescription"> + <argument name="productDescription" value="{{UpdateAttributeNameAndDescription.description}}"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml index 5f3614e1ae65..22668e1c7852 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml @@ -542,4 +542,21 @@ <remove keyForRemoval="seeCheckboxForWebsite"/> <seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/> </actionGroup> + <!-- You are on product Edit Page --> + <!-- Assert Product Name in admin Product page --> + <actionGroup name="AssertProductNameInProductEditForm"> + <arguments> + <argument name="productName" type="string"/> + </arguments> + <seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameOnEditProductPage"/> + </actionGroup> + <!-- You are on product Edit Page --> + <!-- Assert Product Description in admin Product page --> + <actionGroup name="AssertProductDescriptionInProductEditForm"> + <arguments> + <argument name="productDescription" type="string"/> + </arguments> + <conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandContentSection"/> + <seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{productDescription}}" stepKey="seeProductDescription"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeMassUpdateActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeMassUpdateActionGroup.xml new file mode 100644 index 000000000000..57b180ada153 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeMassUpdateActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <!-- Update Product Name and Description attribute --> + <actionGroup name="AdminUpdateProductNameAndDescriptionAttributes"> + <arguments> + <argument name="product"/> + </arguments> + <click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox"/> + <click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/> + <click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/> + <waitForPageLoad stepKey="waitForUploadPage"/> + <seeInCurrentUrl url="{{ProductAttributesEditPage.url}}" stepKey="seeAttributePageEditUrl"/> + <click selector="{{AdminUpdateAttributesSection.toggleName}}" stepKey="clickToChangeName"/> + <fillField selector="{{AdminUpdateAttributesSection.name}}" userInput="{{product.name}}" stepKey="fillFieldName"/> + <click selector="{{AdminUpdateAttributesSection.toggleDescription}}" stepKey="clickToChangeDescription"/> + <fillField selector="{{AdminUpdateAttributesSection.description}}" userInput="{{product.description}}" stepKey="fillFieldDescription"/> + <click selector="{{AdminUpdateAttributesSection.saveButton}}" stepKey="save"/> + <waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitVisibleSuccessMessage"/> + <see selector="{{AdminMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeSuccessMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMassUpdateData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMassUpdateData.xml new file mode 100644 index 000000000000..99908f1c9df5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeMassUpdateData.xml @@ -0,0 +1,15 @@ +<?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="UpdateAttributeNameAndDescription" type="productAttributeMassUpdate"> + <data key="name" unique="suffix">New Bundle Product Name</data> + <data key="description" unique="suffix">This is the description</data> + </entity> +</entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminUpdateAttributesSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminUpdateAttributesSection.xml index 53af1d5bd6eb..69d7297628d5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminUpdateAttributesSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminUpdateAttributesSection.xml @@ -36,6 +36,7 @@ <element name="toggleWeight" type="checkbox" selector="#toggle_weight"/> <element name="toggleColor" type="checkbox" selector="#toggle_color"/> + <element name="name" type="input" selector="#name"/> <element name="description" type="input" selector="#description"/> </section> <section name="AdminUpdateAttributesWebsiteSection"> From 33d07de1b9432b3f2d7ccab0a96f2fdf79e4c066 Mon Sep 17 00:00:00 2001 From: Lena Orobei <oorobei@magento.com> Date: Mon, 29 Jul 2019 16:24:24 -0500 Subject: [PATCH 227/230] magento/graphql-ce#167: Add support for '@magentoConfigFixture' annotation on API-functional tests --- .../Magento/TestFramework/Annotation/ApiConfigFixture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php index 22e63dbb66d8..a5be49303283 100644 --- a/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php +++ b/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php @@ -55,7 +55,7 @@ protected function _assignConfigData(TestCase $test) foreach ($annotations['method'][$this->annotation] as $configPathAndValue) { if (preg_match('/^.+?(?=_store\s)/', $configPathAndValue, $matches)) { /* Store-scoped config value */ - $storeCode = $matches[0] != 'current' ? $matches[0] : null; + $storeCode = $matches[0]; $parts = preg_split('/\s+/', $configPathAndValue, 3); list($configScope, $configPath, $requiredValue) = $parts + ['', '', '']; $originalValue = $this->_getConfigValue($configPath, $storeCode); From 75f7f412be50b12b985ca2c5232c6f34a30a317a Mon Sep 17 00:00:00 2001 From: Valerii Naida <vnayda@adobe.com> Date: Mon, 29 Jul 2019 17:34:40 -0500 Subject: [PATCH 228/230] magento/graphql-ce#167: Add support for '@magentoConfigFixture' annotation on API-functional tests --- .../disable_all_active_payment_methods.php | 35 +++++++++++++++++++ ...le_all_active_payment_methods_rollback.php | 34 ++++++++++++++++++ .../Quote/_files/disable_guest_checkout.php | 21 +++++++++++ .../disable_guest_checkout_rollback.php | 17 +++++++++ .../disable_offline_shipping_methods.php | 23 ++++++++++++ ...able_offline_shipping_methods_rollback.php | 19 ++++++++++ .../_files/enable_offline_payment_methods.php | 25 +++++++++++++ ...nable_offline_payment_methods_rollback.php | 21 +++++++++++ .../enable_offline_shipping_methods.php | 23 ++++++++++++ ...able_offline_shipping_methods_rollback.php | 19 ++++++++++ 10 files changed, 237 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php create mode 100644 dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php new file mode 100644 index 000000000000..8e6d4b8f74b8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods.php @@ -0,0 +1,35 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Config\Model\Config; +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Store\Model\Store; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +$paymentMethodList = $objectManager->get(\Magento\Payment\Api\PaymentMethodListInterface::class); +$rollbackConfigKey = 'test/payment/disabled_payment_methods'; +$configData = []; +$disabledPaymentMethods = []; + +// Get all active Payment Methods +foreach ($paymentMethodList->getActiveList(Store::DEFAULT_STORE_ID) as $paymentMethod) { + $configData['payment/' . $paymentMethod->getCode() . '/active'] = 0; + $disabledPaymentMethods[] = $paymentMethod->getCode(); +} +// Remember all manually disabled Payment Methods for rollback +$configData[$rollbackConfigKey] = implode(',', $disabledPaymentMethods); + +/** @var Config $defConfig */ +$defConfig = $objectManager->create(Config::class); +$defConfig->setScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT); + +foreach ($configData as $key => $value) { + $defConfig->setDataByPath($key, $value); + $defConfig->save(); +} diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods_rollback.php new file mode 100644 index 000000000000..092826d1fd3f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_all_active_payment_methods_rollback.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +$rollbackConfigKey = 'test/payment/disabled_payment_methods'; + +$configWriter = $objectManager->create(WriterInterface::class); +$rollbackConfigValue = $objectManager->get(\Magento\Store\Model\StoreManagerInterface::class) + ->getStore(\Magento\Store\Model\Store::DEFAULT_STORE_ID) + ->getConfig($rollbackConfigKey); + +$disabledPaymentMethods = []; +if (!empty($rollbackConfigValue)) { + $disabledPaymentMethods = explode(',', $rollbackConfigValue); +} + +if (count($disabledPaymentMethods)) { + foreach ($disabledPaymentMethods as $keyToRemove) { + $configWriter->delete(sprintf('payment/%s/active', $keyToRemove)); + } +} +$configWriter->delete($rollbackConfigKey); + +$scopeConfig = $objectManager->get(ScopeConfigInterface::class); +$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout.php new file mode 100644 index 000000000000..957c8831a3cb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout.php @@ -0,0 +1,21 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Framework\App\Config\Storage\Writer; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\App\Config\ScopeConfigInterface; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Writer $configWriter */ +$configWriter = $objectManager->get(WriterInterface::class); + +$configWriter->save('checkout/options/guest_checkout', 0); + +$scopeConfig = $objectManager->get(ScopeConfigInterface::class); +$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout_rollback.php new file mode 100644 index 000000000000..ed7941435ddd --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_guest_checkout_rollback.php @@ -0,0 +1,17 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Framework\App\Config\Storage\Writer; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Writer $configWriter */ +$configWriter = $objectManager->create(WriterInterface::class); + +$configWriter->delete('checkout/options/guest_checkout'); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php new file mode 100644 index 000000000000..c5d0468dbfac --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Framework\App\Config\Storage\Writer; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\App\Config\ScopeConfigInterface; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Writer $configWriter */ +$configWriter = $objectManager->get(WriterInterface::class); + +$configWriter->save('carriers/flatrate/active', 0); +$configWriter->save('carriers/tablerate/active', 0); +$configWriter->save('carriers/freeshipping/active', 0); + +$scopeConfig = $objectManager->get(ScopeConfigInterface::class); +$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods_rollback.php new file mode 100644 index 000000000000..384ffbdf51f3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/disable_offline_shipping_methods_rollback.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Framework\App\Config\Storage\Writer; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Writer $configWriter */ +$configWriter = $objectManager->create(WriterInterface::class); + +$configWriter->delete('carriers/flatrate/active'); +$configWriter->delete('carriers/tablerate/active'); +$configWriter->delete('carriers/freeshipping/active'); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php new file mode 100644 index 000000000000..79d61cf32b9f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Framework\App\Config\Storage\Writer; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\App\Config\ScopeConfigInterface; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Writer $configWriter */ +$configWriter = $objectManager->get(WriterInterface::class); + +$configWriter->save('payment/banktransfer/active', 1); +$configWriter->save('payment/cashondelivery/active', 1); +$configWriter->save('payment/checkmo/active', 1); +$configWriter->save('payment/purchaseorder/active', 1); +$configWriter->save('payment/authorizenet_acceptjs/active', 1); + +$scopeConfig = $objectManager->get(ScopeConfigInterface::class); +$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods_rollback.php new file mode 100644 index 000000000000..6c41e3ebabf0 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_payment_methods_rollback.php @@ -0,0 +1,21 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Framework\App\Config\Storage\Writer; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Writer $configWriter */ +$configWriter = $objectManager->create(WriterInterface::class); + +$configWriter->delete('payment/banktransfer/active'); +$configWriter->delete('payment/cashondelivery/active'); +$configWriter->delete('payment/checkmo/active'); +$configWriter->delete('payment/purchaseorder/active'); +$configWriter->delete('payment/authorizenet_acceptjs/active'); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php new file mode 100644 index 000000000000..ebc41da9b1b3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Framework\App\Config\Storage\Writer; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Framework\App\Config\ScopeConfigInterface; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Writer $configWriter */ +$configWriter = $objectManager->get(WriterInterface::class); + +$configWriter->save('carriers/flatrate/active', 1); +$configWriter->save('carriers/tablerate/active', 1); +$configWriter->save('carriers/freeshipping/active', 1); + +$scopeConfig = $objectManager->get(ScopeConfigInterface::class); +$scopeConfig->clean(); diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods_rollback.php new file mode 100644 index 000000000000..384ffbdf51f3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/enable_offline_shipping_methods_rollback.php @@ -0,0 +1,19 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167 +declare(strict_types=1); + +use Magento\Framework\App\Config\Storage\Writer; +use Magento\Framework\App\Config\Storage\WriterInterface; +use Magento\TestFramework\Helper\Bootstrap; + +$objectManager = Bootstrap::getObjectManager(); +/** @var Writer $configWriter */ +$configWriter = $objectManager->create(WriterInterface::class); + +$configWriter->delete('carriers/flatrate/active'); +$configWriter->delete('carriers/tablerate/active'); +$configWriter->delete('carriers/freeshipping/active'); From ea1d1493b00b1fb27aa14ffd2a3a9020109983ae Mon Sep 17 00:00:00 2001 From: Valerii Naida <vnayda@adobe.com> Date: Mon, 29 Jul 2019 18:55:37 -0500 Subject: [PATCH 229/230] magento/graphql-ce#438: Adjust adding configurable products to the shopping cart --- app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls index abf758fe41ca..a7fb82e40220 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls @@ -50,6 +50,7 @@ type AddConfigurableProductsToCartOutput { input ConfigurableProductCartItemInput { data: CartItemInput! + variant_sku: String @deprecated(reason: "Use CartItemInput.sku instead") configurable_attributes: [ConfigurableCartItemAttributesInput]! customizable_options:[CustomizableOptionInput!] } From 5ad41b953337aa2b646040955cb4bab9c0299247 Mon Sep 17 00:00:00 2001 From: Falk Ulbricht <f.ulbricht@techdivision.com> Date: Tue, 30 Jul 2019 09:08:34 +0200 Subject: [PATCH 230/230] MC-16957: PHP 7.3 Cleanup Composer Repositories and Versions --- composer.json | 8 +------- composer.lock | 38 +++++++++++++++++--------------------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/composer.json b/composer.json index 6114c27d7bce..9998cb0b9bf7 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "colinmollenhour/php-redis-session-abstract": "~1.4.0", "composer/composer": "^1.6", "elasticsearch/elasticsearch": "~2.0|~5.1|~6.1", - "magento/composer": "dev-master", + "magento/composer": "~1.5.0", "magento/magento-composer-installer": ">=0.1.11", "magento/zendframework1": "~1.14.2", "monolog/monolog": "^1.17", @@ -334,11 +334,5 @@ "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/" } }, - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/magento/composer" - } - ], "prefer-stable": true } diff --git a/composer.lock b/composer.lock index d4acf3898953..a2ff8dcdcdd6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d55d503c59af9e0284df419675ed4114", + "content-hash": "f08218963fdc3dc7eebdd7ede7fd7236", "packages": [ { "name": "braintree/braintree_php", @@ -399,16 +399,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d" + "reference": "7ac1e6aec371357df067f8a688c3d6974df68fa5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d", - "reference": "a1aa51cf3ab838b83b0867b14e56fc20fbd55b3d", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/7ac1e6aec371357df067f8a688c3d6974df68fa5", + "reference": "7ac1e6aec371357df067f8a688c3d6974df68fa5", "shasum": "" }, "require": { @@ -455,7 +455,7 @@ "spdx", "validator" ], - "time": "2019-03-26T10:23:26+00:00" + "time": "2019-07-29T10:31:59+00:00" }, { "name": "composer/xdebug-handler", @@ -948,16 +948,16 @@ }, { "name": "magento/composer", - "version": "dev-master", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/magento/composer.git", - "reference": "e79070bc6fa9e3967b6db693e425c3f6fa493712" + "reference": "ea12b95be5c0833b3d9497aaefa08816c19e5dcd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/magento/composer/zipball/e79070bc6fa9e3967b6db693e425c3f6fa493712", - "reference": "e79070bc6fa9e3967b6db693e425c3f6fa493712", + "url": "https://api.github.com/repos/magento/composer/zipball/ea12b95be5c0833b3d9497aaefa08816c19e5dcd", + "reference": "ea12b95be5c0833b3d9497aaefa08816c19e5dcd", "shasum": "" }, "require": { @@ -974,16 +974,13 @@ "Magento\\Composer\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "OSL-3.0", "AFL-3.0" ], "description": "Magento composer library helps to instantiate Composer application and run composer commands.", - "support": { - "source": "https://github.com/magento/composer/tree/master", - "issues": "https://github.com/magento/composer/issues" - }, - "time": "2019-05-21T16:27:33+00:00" + "time": "2019-07-29T19:52:05+00:00" }, { "name": "magento/magento-composer-installer", @@ -5565,16 +5562,16 @@ }, { "name": "consolidation/robo", - "version": "1.4.9", + "version": "1.4.10", "source": { "type": "git", "url": "https://github.com/consolidation/Robo.git", - "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345" + "reference": "e5a6ca64cf1324151873672e484aceb21f365681" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/consolidation/Robo/zipball/5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", - "reference": "5c6b3840a45afda1cbffbb3bb1f94dd5f9f83345", + "url": "https://api.github.com/repos/consolidation/Robo/zipball/e5a6ca64cf1324151873672e484aceb21f365681", + "reference": "e5a6ca64cf1324151873672e484aceb21f365681", "shasum": "" }, "require": { @@ -5669,7 +5666,7 @@ } ], "description": "Modern task runner", - "time": "2019-03-19T18:07:19+00:00" + "time": "2019-07-29T15:40:50+00:00" }, { "name": "consolidation/self-update", @@ -9630,7 +9627,6 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "magento/composer": 20, "phpmd/phpmd": 0 }, "prefer-stable": true,