Skip to content

Commit 01d54f0

Browse files
author
Mariana Lashch
committed
Merge branch 'MAGETWO-94437' of github.com:magento-mpi/magento2ce into MAGETWO-94437
2 parents 1c16d68 + 512c17c commit 01d54f0

File tree

79 files changed

+1135
-276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1135
-276
lines changed

app/autoload.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
/* 'composer install' validation */
2929
if (file_exists($vendorAutoload)) {
3030
$composerAutoloader = include $vendorAutoload;
31+
} else if (file_exists("{$vendorDir}/autoload.php")) {
32+
$vendorAutoload = "{$vendorDir}/autoload.php";
33+
$composerAutoloader = include $vendorAutoload;
3134
} else {
3235
throw new \Exception(
3336
'Vendor autoload is not found. Please run \'composer install\' under application root directory.'

app/bootstrap.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
#ini_set('display_errors', 1);
1212

1313
/* PHP version validation */
14-
if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID === 70002 || PHP_VERSION_ID === 70004 || PHP_VERSION_ID >= 70006)) {
14+
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70103) {
1515
if (PHP_SAPI == 'cli') {
16-
echo 'Magento supports 7.0.2, 7.0.4, and 7.0.6 or later. ' .
17-
'Please read http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html';
16+
echo 'Magento supports PHP 7.1.3 or later. ' .
17+
'Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html';
1818
} else {
1919
echo <<<HTML
2020
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
21-
<p>Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later. Please read
22-
<a target="_blank" href="http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html">
21+
<p>Magento supports PHP 7.1.3 or later. Please read
22+
<a target="_blank" href="https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html">
2323
Magento System Requirements</a>.
2424
</div>
2525
HTML;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
11+
<actionGroup name="AdminOrderBraintreeFillActionGroup">
12+
<!--Select Braintree Payment method on Admin Order Create Page-->
13+
<click stepKey="chooseBraintree" selector="{{NewOrderSection.creditCardBraintree}}"/>
14+
<waitForPageLoad stepKey="waitForBraintreeConfigs" time="5"/>
15+
<click stepKey="openCardTypes" selector="{{NewOrderSection.openCardTypes}}"/>
16+
<waitForPageLoad stepKey="waitForCardTypes" time="3"/>
17+
<click stepKey="chooseCardType" selector="{{NewOrderSection.masterCard}}"/>
18+
<waitForPageLoad stepKey="waitForCardSelected" time="3"/>
19+
20+
<!--Choose Master Card from drop-down list-->
21+
<switchToIFrame stepKey="switchToCardNumber" selector="{{NewOrderSection.cardFrame}}"/>
22+
<fillField stepKey="fillCardNumber" selector="{{NewOrderSection.creditCardNumber}}" userInput="{{PaymentAndShippingInfo.cardNumber}}"/>
23+
<waitForPageLoad stepKey="waitForFillCardNumber" time="1"/>
24+
<switchToIFrame stepKey="switchBackFromCard"/>
25+
26+
<!--Fill expire date-->
27+
<switchToIFrame stepKey="switchToExpirationMonth" selector="{{NewOrderSection.monthFrame}}"/>
28+
<fillField stepKey="fillMonth" selector="{{NewOrderSection.expirationMonth}}" userInput="{{PaymentAndShippingInfo.month}}"/>
29+
<waitForPageLoad stepKey="waitForFillMonth" time="1"/>
30+
<switchToIFrame stepKey="switchBackFromMonth"/>
31+
<switchToIFrame stepKey="switchToExpirationYear" selector="{{NewOrderSection.yearFrame}}"/>
32+
<fillField stepKey="fillYear" selector="{{NewOrderSection.expirationYear}}" userInput="{{PaymentAndShippingInfo.year}}"/>
33+
<waitForPageLoad stepKey="waitForFillYear" time="1"/>
34+
<switchToIFrame stepKey="switchBackFromYear"/>
35+
36+
<!--Fill CVW code-->
37+
<switchToIFrame stepKey="switchToCVV" selector="{{NewOrderSection.cvvFrame}}"/>
38+
<fillField stepKey="fillCVV" selector="{{NewOrderSection.cvv}}" userInput="{{PaymentAndShippingInfo.cvv}}"/>
39+
<wait stepKey="waitForFillCVV" time="1"/>
40+
<switchToIFrame stepKey="switchBackFromCVV"/>
41+
</actionGroup>
42+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<requiredEntity type="merchant_id">MerchantId</requiredEntity>
4343
<requiredEntity type="public_key">PublicKey</requiredEntity>
4444
<requiredEntity type="private_key">PrivateKey</requiredEntity>
45+
<requiredEntity type="active">Status</requiredEntity>
4546
</entity>
4647
<entity name="BraintreeTitle" type="title">
4748
<data key="value">Credit Card (Braintree)</data>

app/code/Magento/Braintree/Test/Mftf/Section/AdminMenuSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<element name="sales" type="button" selector="//li[@id='menu-magento-sales-sales']"/>
1414
<element name="catalog" type="button" selector="//li[@id='menu-magento-catalog-catalog']"/>
1515
<element name="customers" type="button" selector="//li[@id='menu-magento-customer-customer']"/>
16-
<element name="marketing" type="button" selector="//li[@id='//li[@id='menu-magento-backend-marketing']']"/>
16+
<element name="marketing" type="button" selector="//li[@id='menu-magento-backend-marketing']"/>
1717
<element name="content" type="button" selector="//li[@id='menu-magento-backend-content']"/>
1818
<element name="reports" type="button" selector="//li[@id='menu-magento-reports-report']"/>
1919
<element name="stores" type="button" selector="//li[@id='menu-magento-backend-stores']"/>
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="CreateAdminOrderPayedWithOnlinePaymentIncludingTaxAndDiscount">
12+
<annotations>
13+
<features value="Braintree"/>
14+
<stories value="Get access to a New Credit Memo Page from Invocie for Order payed with online payment via Admin"/>
15+
<title value="Admin should be able to open a New Credit Memo Page from Invoice Page for Order with tax and discount and payed using online payment method"/>
16+
<description value="Admin should be able to open a New Credit Memo Page from Invoice Page for Order with tax and discount and payed using online payment method"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-94472"/>
19+
<group value="braintree"/>
20+
</annotations>
21+
22+
<before>
23+
<!--Create Default Category-->
24+
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
25+
26+
<!--Create Simple product-->
27+
<createData entity="_defaultProduct" stepKey="simpleProduct">
28+
<requiredEntity createDataKey="createCategory"/>
29+
</createData>
30+
31+
<!--Create Tax Rule is based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 -->
32+
<createData entity="SimpleTaxRule" stepKey="createTaxRule"/>
33+
34+
<!--Configure Braintree Payment method-->
35+
<createData entity="BraintreeConfig" stepKey="BraintreeConfigurationData"/>
36+
<createData entity="CustomBraintreeConfigurationData" stepKey="enableBraintree"/>
37+
38+
<!--Create Retailer Customer with US_CA address-->
39+
<createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer">
40+
<field key="group_id">3</field>
41+
</createData>
42+
43+
<!--Login as Admin User-->
44+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
45+
</before>
46+
47+
<after>
48+
<!--Delete Cart Price Rule-->
49+
<actionGroup ref="AdminDeleteCartPriceRuleForRetailerActionGroup" stepKey="deleteSalesRule"/>
50+
51+
<!--Set to default configuration Tax Shipping Class-->
52+
<actionGroup ref="setDefaultShippingTaxClass" stepKey="setdefaultClass"/>
53+
54+
<!--Delete Simple Sub Category-->
55+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
56+
57+
<!--Delete Simple Product-->
58+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
59+
60+
<!-- Delete Tax Rule -->
61+
<deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/>
62+
63+
<!-- Rollback Braintree to Default -->
64+
<createData entity="RollBackCustomBraintreeConfigurationData" stepKey="rollbackBraintreeConfig"/>
65+
66+
<!--Delete Customer-->
67+
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
68+
69+
<!--Log Out-->
70+
<actionGroup ref="logout" stepKey="logout"/>
71+
</after>
72+
73+
<!-- Create a cart price rule with 10% discount for whole cart -->
74+
<click selector="{{AdminMenuSection.marketing}}" stepKey="clickOnMarketing" />
75+
<waitForPageLoad stepKey="waitForMarketing" time="3"/>
76+
<click selector="{{CartPriceRulesSubmenuSection.cartPriceRules}}" stepKey="clickOnCartPriceRules"/>
77+
<waitForPageLoad stepKey="waitForCartPriceRules" time="3"/>
78+
<click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/>
79+
<fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/>
80+
<selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/>
81+
<actionGroup ref="selectRetailerCustomerGroup" stepKey="selectRetailerCustomerGroup"/>
82+
<click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/>
83+
<selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/>
84+
<fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="10" stepKey="fillDiscountAmount"/>
85+
<click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/>
86+
<waitForPageLoad stepKey="waitForCartRuleLoad" time="3"/>
87+
<see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/>
88+
89+
<!--Set Taxable Goods for Shipping Tax Class-->
90+
<actionGroup ref="changeShippingTaxClass" stepKey="changeShippingTaxClass"/>
91+
92+
<!--Adding Special price to product-->
93+
<amOnPage url="{{AdminProductEditPage.url($$simpleProduct.id$$)}}" stepKey="openAdminProductEditPage"/>
94+
<actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPrice"/>
95+
<actionGroup ref="saveProductForm" stepKey="saveProductForm"/>
96+
97+
<!--Create New Order-->
98+
<actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer">
99+
<argument name="customer" value="$$simpleCustomer$$"/>
100+
</actionGroup>
101+
102+
<!--Add a product to order-->
103+
<actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder">
104+
<argument name="product" value="$$simpleProduct$$"/>
105+
</actionGroup>
106+
107+
<!--Select FlatRate shipping method-->
108+
<actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/>
109+
110+
<!--Select Braintree online Payment method -->
111+
<actionGroup ref="AdminOrderBraintreeFillActionGroup" stepKey="selectCreditCardPayment"/>
112+
113+
<!--Submit Order-->
114+
<click stepKey="submitOrder" selector="{{NewOrderSection.submitOrder}}"/>
115+
<waitForPageLoad stepKey="waitForSubmitOrder" time="5"/>
116+
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeOrderSuccessMessage" after="waitForSubmitOrder"/>
117+
118+
<!-- Create New invoice-->
119+
<actionGroup ref="adminFastCreateInvoice" stepKey="createInvoice"/>
120+
121+
<!--Get access to Credit Memo page from Invoice page-->
122+
<click selector="{{AdminInvoiceMainActionsSection.openNewCreditMemoFromInvoice}}" stepKey="clickCreateNewCreditMemo"/>
123+
<waitForPageLoad stepKey="waitForLoadNewCreditMemoPage" time="5"/>
124+
<see selector="{{AdminCreditMemoOrderInformationSection.orderStatus}}" userInput="Processing" stepKey="seeNewCreditMemo"/>
125+
</test>
126+
</tests>

app/code/Magento/Catalog/Model/Category/Link/SaveHandler.php

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace Magento\Catalog\Model\Category\Link;
77

88
use Magento\Catalog\Api\Data\CategoryLinkInterface;
9-
use Magento\Catalog\Model\Indexer\Product\Category;
109
use Magento\Framework\EntityManager\Operation\ExtensionInterface;
1110

1211
/**
@@ -40,6 +39,8 @@ public function __construct(
4039
}
4140

4241
/**
42+
* Execute
43+
*
4344
* @param object $entity
4445
* @param array $arguments
4546
* @return object
@@ -78,6 +79,8 @@ public function execute($entity, $arguments = [])
7879
}
7980

8081
/**
82+
* Get category links positions
83+
*
8184
* @param object $entity
8285
* @return array
8386
*/
@@ -106,27 +109,19 @@ private function getCategoryLinksPositions($entity)
106109
*/
107110
private function mergeCategoryLinks($newCategoryPositions, $oldCategoryPositions)
108111
{
109-
$result = [];
110112
if (empty($newCategoryPositions)) {
111-
return $result;
113+
return [];
112114
}
113115

116+
$categoryPositions = array_combine(array_column($oldCategoryPositions, 'category_id'), $oldCategoryPositions);
114117
foreach ($newCategoryPositions as $newCategoryPosition) {
115-
$key = array_search(
116-
$newCategoryPosition['category_id'],
117-
array_column($oldCategoryPositions, 'category_id')
118-
);
119-
120-
if ($key === false) {
121-
$result[] = $newCategoryPosition;
122-
} elseif (isset($oldCategoryPositions[$key])
123-
&& $oldCategoryPositions[$key]['position'] != $newCategoryPosition['position']
124-
) {
125-
$result[] = $newCategoryPositions[$key];
126-
unset($oldCategoryPositions[$key]);
118+
$categoryId = $newCategoryPosition['category_id'];
119+
if (!isset($categoryPositions[$categoryId])) {
120+
$categoryPositions[$categoryId] = ['category_id' => $categoryId];
127121
}
122+
$categoryPositions[$categoryId]['position'] = $newCategoryPosition['position'];
128123
}
129-
$result = array_merge($result, $oldCategoryPositions);
124+
$result = array_values($categoryPositions);
130125

131126
return $result;
132127
}

app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Eraser.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,10 @@ public function removeDisabledProducts(array &$ids, $storeId)
118118
private function getSelectForProducts(array $ids)
119119
{
120120
$productTable = $this->productIndexerHelper->getTable('catalog_product_entity');
121-
$select = $this->connection->select()->from($productTable)
121+
$select = $this->connection->select()
122+
->from(['product_table' => $productTable])
122123
->columns('entity_id')
123-
->where('entity_id IN(?)', $ids);
124+
->where('product_table.entity_id IN(?)', $ids);
124125
return $select;
125126
}
126127

0 commit comments

Comments
 (0)