Skip to content

Commit fd2200a

Browse files
committed
Merge branch '2.3-develop' into hotfix/admin-payment-js
2 parents 8e5c631 + 4ee3bb3 commit fd2200a

File tree

127 files changed

+2766
-729
lines changed

Some content is hidden

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

127 files changed

+2766
-729
lines changed

app/code/Magento/AdminNotification/Model/System/Message/Media/Synchronization/Error.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
namespace Magento\AdminNotification\Model\System\Message\Media\Synchronization;
88

99
/**
10+
* Media synchronization error message class.
11+
*
1012
* @api
1113
* @since 100.0.2
1214
*/
@@ -27,7 +29,7 @@ class Error extends \Magento\AdminNotification\Model\System\Message\Media\Abstra
2729
protected function _shouldBeDisplayed()
2830
{
2931
$data = $this->_syncFlag->getFlagData();
30-
return isset($data['has_errors']) && true == $data['has_errors'];
32+
return !empty($data['has_errors']);
3133
}
3234

3335
/**

app/code/Magento/AdminNotification/Model/System/Message/Media/Synchronization/Success.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\AdminNotification\Model\System\Message\Media\Synchronization;
77

88
/**
9+
* Media synchronization success message class.
10+
*
911
* @api
1012
* @since 100.0.2
1113
*/
@@ -27,8 +29,8 @@ protected function _shouldBeDisplayed()
2729
{
2830
$state = $this->_syncFlag->getState();
2931
$data = $this->_syncFlag->getFlagData();
30-
$hasErrors = isset($data['has_errors']) && true == $data['has_errors'] ? true : false;
31-
return false == $hasErrors && \Magento\MediaStorage\Model\File\Storage\Flag::STATE_FINISHED == $state;
32+
$hasErrors = !empty($data['has_errors']);
33+
return !$hasErrors && \Magento\MediaStorage\Model\File\Storage\Flag::STATE_FINISHED == $state;
3234
}
3335

3436
/**

app/code/Magento/Analytics/ReportXml/DB/ColumnsResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getColumns(SelectBuilder $selectBuilder, $entityConfig)
7676
$columnName = $this->nameResolver->getName($attributeData);
7777
if (isset($attributeData['function'])) {
7878
$prefix = '';
79-
if (isset($attributeData['distinct']) && $attributeData['distinct'] == true) {
79+
if (!empty($attributeData['distinct'])) {
8080
$prefix = ' DISTINCT ';
8181
}
8282
$expression = new ColumnValueExpression(

app/code/Magento/Analytics/Test/Unit/Model/ExportDataHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public function testPrepareExportData($isArchiveSourceDirectory)
191191
->with(
192192
$archiveSource,
193193
$archiveAbsolutePath,
194-
$isArchiveSourceDirectory ? true : false
194+
$isArchiveSourceDirectory
195195
);
196196

197197
$fileContent = 'Some text';
@@ -222,7 +222,7 @@ public function prepareExportDataDataProvider()
222222
{
223223
return [
224224
'Data source for archive is directory' => [true],
225-
'Data source for archive doesn\'t directory' => [false],
225+
'Data source for archive isn\'t directory' => [false],
226226
];
227227
}
228228

app/code/Magento/Authorizenet/Model/Directpost.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ protected function processOrder(\Magento\Sales\Model\Order $order)
707707
//decline the order (in case of wrong response code) but don't return money to customer.
708708
$message = $e->getMessage();
709709
$this->declineOrder($order, $message, false);
710+
710711
throw $e;
711712
}
712713

@@ -777,7 +778,7 @@ protected function processPaymentFraudStatus(\Magento\Sales\Model\Order\Payment
777778
}
778779

779780
/**
780-
* Add status comment
781+
* Add status comment to history
781782
*
782783
* @param \Magento\Sales\Model\Order\Payment $payment
783784
* @return $this
@@ -832,6 +833,7 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = ''
832833
->void($response);
833834
}
834835
$order->registerCancellation($message)->save();
836+
$this->_eventManager->dispatch('order_cancel_after', ['order' => $order ]);
835837
} catch (\Exception $e) {
836838
//quiet decline
837839
$this->getPsrLogger()->critical($e);
@@ -866,7 +868,7 @@ public function getConfigInterface()
866868
* Getter for specified value according to set payment method code
867869
*
868870
* @param mixed $key
869-
* @param int|string|null|\Magento\Store\Model\Store $storeId
871+
* @param mixed $storeId
870872
* @return mixed
871873
*/
872874
public function getValue($key, $storeId = null)
@@ -930,7 +932,7 @@ public function fetchTransactionInfo(\Magento\Payment\Model\InfoInterface $payme
930932
}
931933

932934
/**
933-
* Add statuc comment on update.
935+
* Add status comment on update
934936
*
935937
* @param \Magento\Sales\Model\Order\Payment $payment
936938
* @param \Magento\Framework\DataObject $response

app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
namespace Magento\Backend\Block\Widget\Form\Element;
8+
79
/**
810
* Form element dependencies mapper
911
* Assumes that one element may depend on other element values.
1012
* Will toggle as "enabled" only if all elements it depends from toggle as true.
11-
*/
12-
namespace Magento\Backend\Block\Widget\Form\Element;
13-
14-
/**
13+
*
1514
* @api
1615
* @since 100.0.2
1716
*/
@@ -117,6 +116,7 @@ public function addConfigOptions(array $options)
117116

118117
/**
119118
* HTML output getter
119+
*
120120
* @return string
121121
*/
122122
protected function _toHtml()
@@ -139,7 +139,8 @@ protected function _toHtml()
139139
}
140140

141141
/**
142-
* Field dependences JSON map generator
142+
* Field dependencies JSON map generator
143+
*
143144
* @return string
144145
*/
145146
protected function _getDependsJson()

app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Backend\Block\Widget\Grid\Massaction;
88

99
use Magento\Backend\Block\Widget\Grid\Massaction\VisibilityCheckerInterface as VisibilityChecker;
10+
use Magento\Framework\Data\Collection\AbstractDb;
1011
use Magento\Framework\DataObject;
1112

1213
/**
@@ -52,7 +53,7 @@ public function __construct(
5253
}
5354

5455
/**
55-
* @return void
56+
* @inheritdoc
5657
*/
5758
protected function _construct()
5859
{
@@ -217,6 +218,7 @@ public function getGridJsObjectName()
217218
* Retrieve JSON string of selected checkboxes
218219
*
219220
* @return string
221+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
220222
*/
221223
public function getSelectedJson()
222224
{
@@ -231,6 +233,7 @@ public function getSelectedJson()
231233
* Retrieve array of selected checkboxes
232234
*
233235
* @return string[]
236+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
234237
*/
235238
public function getSelected()
236239
{
@@ -252,6 +255,8 @@ public function getApplyButtonHtml()
252255
}
253256

254257
/**
258+
* Get mass action javascript code.
259+
*
255260
* @return string
256261
*/
257262
public function getJavaScript()
@@ -268,6 +273,8 @@ public function getJavaScript()
268273
}
269274

270275
/**
276+
* Get grid ids in JSON format.
277+
*
271278
* @return string
272279
*/
273280
public function getGridIdsJson()
@@ -284,6 +291,11 @@ public function getGridIdsJson()
284291
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
285292
}
286293

294+
if ($allIdsCollection instanceof AbstractDb) {
295+
$allIdsCollection->getSelect()->limit();
296+
$allIdsCollection->clear();
297+
}
298+
287299
$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
288300
if (!empty($gridIds)) {
289301
return join(",", $gridIds);
@@ -292,6 +304,8 @@ public function getGridIdsJson()
292304
}
293305

294306
/**
307+
* Get Html id.
308+
*
295309
* @return string
296310
*/
297311
public function getHtmlId()

app/code/Magento/Backend/Test/Mftf/ActionGroup/LoginAsAdminActionGroup.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
<argument name="adminUser" defaultValue="_ENV"/>
1414
</arguments>
1515
<amOnPage url="{{AdminLoginPage.url}}" stepKey="navigateToAdmin"/>
16-
<waitForPageLoad stepKey="waitForAdminLoginPageLoad"/>
1716
<fillField selector="{{AdminLoginFormSection.username}}" userInput="{{adminUser.MAGENTO_ADMIN_USERNAME}}" stepKey="fillUsername"/>
1817
<fillField selector="{{AdminLoginFormSection.password}}" userInput="{{adminUser.MAGENTO_ADMIN_PASSWORD}}" stepKey="fillPassword"/>
1918
<click selector="{{AdminLoginFormSection.signIn}}" stepKey="clickLogin"/>
2019
<closeAdminNotification stepKey="closeAdminNotification"/>
2120
</actionGroup>
22-
</actionGroups>
21+
</actionGroups>

app/code/Magento/Braintree/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
*/
77
-->
88
<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">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1010
<actionGroup name="DeleteCustomerActionGroup">
1111
<arguments>
1212
<argument name="lastName" defaultValue=""/>
1313
</arguments>
14-
<click stepKey="openCustomers" selector="{{AdminMenuSection.customers}}"/>
15-
<waitForPageLoad stepKey="waitForCatalogSubmenu" time="10"/>
16-
<click stepKey="clickOnAllCustomers" selector="{{CustomersSubmenuSection.allCustomers}}"/>
17-
<waitForPageLoad stepKey="waitForProductsPage" time="10"/>
14+
<!--Clear filter if exist-->
15+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
16+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingCustomerFilters"/>
17+
1818
<click stepKey="chooseCustomer" selector="{{CustomersPageSection.customerCheckbox(lastName)}}"/>
1919
<waitForAjaxLoad stepKey="waitForThick" time="2"/>
2020
<click stepKey="OpenActions" selector="{{CustomersPageSection.actions}}"/>
@@ -23,6 +23,5 @@
2323
<waitForPageLoad stepKey="waitForDeleteItemPopup" time="10"/>
2424
<click stepKey="clickOnOk" selector="{{CustomersPageSection.ok}}"/>
2525
<waitForElementVisible stepKey="waitForSuccessfullyDeletedMessage" selector="{{CustomersPageSection.deletedSuccessMessage}}" time="10"/>
26-
2726
</actionGroup>
28-
</actionGroups>
27+
</actionGroups>

app/code/Magento/Bundle/Pricing/Adjustment/Calculator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ protected function getSelectionAmounts(Product $bundleProduct, $searchMin, $useR
198198
}
199199

200200
/**
201+
* Get selection price list provider.
202+
*
201203
* @return SelectionPriceListProviderInterface
202204
* @deprecated 100.2.0
203205
*/
@@ -281,7 +283,7 @@ public function calculateBundleAmount($basePriceValue, $bundleProduct, $selectio
281283
* @param float $basePriceValue
282284
* @param Product $bundleProduct
283285
* @param \Magento\Bundle\Pricing\Price\BundleSelectionPrice[] $selectionPriceList
284-
* @param null|bool|string|arrayy $exclude
286+
* @param null|bool|string|array $exclude
285287
* @return \Magento\Framework\Pricing\Amount\AmountInterface
286288
*/
287289
protected function calculateFixedBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude)

app/code/Magento/Bundle/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,18 @@
2424
<waitForPageLoad time="30" stepKey="waitForPageLoad3"/>
2525
<waitForText userInput="{{quantity}}" selector="{{StorefrontMinicartSection.productCount}}" time="30" stepKey="assertProductCount"/>
2626
</actionGroup>
27+
28+
<!-- Add Bundle Product to Cart from the category page -->
29+
<actionGroup name="StorefrontAddBundleProductFromCategoryToCartActionGroup">
30+
<arguments>
31+
<argument name="productName" type="string"/>
32+
</arguments>
33+
<moveMouseOver selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="moveMouseOverProduct"/>
34+
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productName)}}" stepKey="openProductPage"/>
35+
<waitForPageLoad time="30" stepKey="waitForBundleProductPageLoad"/>
36+
<click selector="{{StorefrontBundledSection.addToCart}}" stepKey="clickCustomizeAndAddToCart"/>
37+
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="clickAddBundleProductToCart"/>
38+
<waitForElementVisible selector="{{StorefrontMinicartSection.productCount}}" stepKey="waitProductCount"/>
39+
<see userInput="You added {{productName}} to your shopping cart." selector="{{StorefrontMessagesSection.success}}" stepKey="seeSuccessMessage"/>
40+
</actionGroup>
2741
</actionGroups>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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="StorefrontAddBundleProductWithZeroPriceToShoppingCartTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Add Bundle product with zero price to shopping cart"/>
15+
<title value="Add Bundle product with zero price to shopping cart"/>
16+
<description value="Add Bundle product with zero price to shopping cart"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-95167"/>
19+
<group value="bundle"/>
20+
</annotations>
21+
<before>
22+
<!--Enable freeShipping-->
23+
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShipping"/>
24+
<!--Create category-->
25+
<createData entity="SimpleSubCategory" stepKey="createSubCategory"/>
26+
<!--Create simple with zero price product-->
27+
<createData entity="ApiProductWithDescription" stepKey="apiSimple">
28+
<field key="price">0</field>
29+
</createData>
30+
<!--Create Bundle product-->
31+
<createData entity="ApiBundleProductPriceViewRange" stepKey="apiBundleProduct">
32+
<requiredEntity createDataKey="createSubCategory"/>
33+
</createData>
34+
<!--Create Attribute-->
35+
<createData entity="DropDownBundleOption" stepKey="bundleOption">
36+
<requiredEntity createDataKey="apiBundleProduct"/>
37+
</createData>
38+
<createData entity="ApiBundleLink" stepKey="createBundleLink">
39+
<requiredEntity createDataKey="apiBundleProduct"/>
40+
<requiredEntity createDataKey="bundleOption"/>
41+
<requiredEntity createDataKey="apiSimple"/>
42+
</createData>
43+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
44+
</before>
45+
<after>
46+
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShipping"/>
47+
<deleteData createDataKey="apiSimple" stepKey="deleteSimple"/>
48+
<deleteData createDataKey="apiBundleProduct" stepKey="deleteBundleProduct"/>
49+
<deleteData createDataKey="createSubCategory" stepKey="deleteCategory"/>
50+
<actionGroup ref="AdminOrdersGridClearFiltersActionGroup" stepKey="clearFilters"/>
51+
<actionGroup ref="logout" stepKey="logout"/>
52+
</after>
53+
<!--Open category page-->
54+
<amOnPage url="{{StorefrontCategoryPage.url($$createSubCategory.custom_attributes[url_key]$$)}}" stepKey="amOnCategoryPage"/>
55+
<!--Add bundle product to cart-->
56+
<actionGroup ref="StorefrontAddBundleProductFromCategoryToCartActionGroup" stepKey="addBundleProductToCart">
57+
<argument name="productName" value="$$apiBundleProduct.name$$"/>
58+
</actionGroup>
59+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
60+
61+
<!--Place order-->
62+
<actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping">
63+
<argument name="shippingMethod" value="Free Shipping"/>
64+
</actionGroup>
65+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="checkoutPlaceOrder"/>
66+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/>
67+
68+
<!--Check subtotal in created order-->
69+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
70+
<actionGroup ref="filterOrderGridById" stepKey="filterOrderById">
71+
<argument name="orderId" value="$grabOrderNumber"/>
72+
</actionGroup>
73+
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRow"/>
74+
<waitForPageLoad stepKey="waitForAdminOrderPageLoad"/>
75+
<scrollTo selector="{{AdminOrderTotalSection.subTotal}}" stepKey="scrollToOrderTotalSection"/>
76+
<see selector="{{AdminOrderTotalSection.subTotal}}" userInput="$0.00" stepKey="checkSubtotal"/>
77+
</test>
78+
</tests>

0 commit comments

Comments
 (0)