Skip to content

Commit f16c97e

Browse files
authored
Merge branch '2.4-develop' into hotfix/26607-ci-failure
2 parents 322e9d8 + 15b5c60 commit f16c97e

File tree

113 files changed

+2482
-397
lines changed

Some content is hidden

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

113 files changed

+2482
-397
lines changed

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ define(
1818
'Magento_Vault/js/view/payment/vault-enabler',
1919
'Magento_Braintree/js/view/payment/kount',
2020
'mage/translate',
21-
'prototype',
2221
'domReady!'
2322
],
2423
function (

app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public function getCurrentPage()
263263
}
264264

265265
/**
266-
* Get grit products sort order field
266+
* Get grid products sort order field
267267
*
268268
* @return string
269269
*/

app/code/Magento/Catalog/Model/Product/Attribute/Backend/TierPrice/UpdateHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private function updateValues(array $valuesToUpdate, array $oldValues): bool
129129
{
130130
$isChanged = false;
131131
foreach ($valuesToUpdate as $key => $value) {
132-
if ((!empty($value['value'])
132+
if ((($value['value'])!== null
133133
&& (float)$oldValues[$key]['price'] !== $this->localeFormat->getNumber($value['value'])
134134
) || $this->getPercentage($oldValues[$key]) !== $this->getPercentage($value)
135135
) {

app/code/Magento/Catalog/Test/Unit/Model/Attribute/Backend/TierPrice/UpdateHandlerTest.php

Lines changed: 116 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
namespace Magento\Catalog\Test\Unit\Model\Attribute\Backend\TierPrice;
99

10-
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
11-
use Magento\Catalog\Model\Product\Attribute\Backend\TierPrice\UpdateHandler;
12-
use Magento\Store\Model\StoreManagerInterface;
1310
use Magento\Catalog\Api\ProductAttributeRepositoryInterface;
11+
use Magento\Catalog\Model\Product\Attribute\Backend\TierPrice\UpdateHandler;
12+
use Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice;
1413
use Magento\Customer\Api\GroupManagementInterface;
1514
use Magento\Framework\EntityManager\MetadataPool;
16-
use Magento\Catalog\Model\ResourceModel\Product\Attribute\Backend\Tierprice;
15+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
16+
use Magento\Store\Model\StoreManagerInterface;
1717

1818
/**
1919
* Unit tests for \Magento\Catalog\Model\Product\Attribute\Backend\TierPrice\UpdateHandler
@@ -95,20 +95,27 @@ protected function setUp()
9595
);
9696
}
9797

98-
public function testExecute(): void
99-
{
100-
$newTierPrices = [
101-
['website_id' => 0, 'price_qty' => 2, 'cust_group' => 0, 'price' => 15],
102-
['website_id' => 0, 'price_qty' => 3, 'cust_group' => 3200, 'price' => null, 'percentage_value' => 20]
103-
];
104-
$priceIdToDelete = 2;
105-
$originalTierPrices = [
106-
['price_id' => 1, 'website_id' => 0, 'price_qty' => 2, 'cust_group' => 0, 'price' => 10],
107-
['price_id' => $priceIdToDelete, 'website_id' => 0, 'price_qty' => 4, 'cust_group' => 0, 'price' => 20],
108-
];
109-
$linkField = 'entity_id';
110-
$productId = 10;
111-
$originalProductId = 11;
98+
/**
99+
* Verify update handle.
100+
*
101+
* @param array $newTierPrices
102+
* @param array $originalTierPrices
103+
* @param int $priceIdToDelete
104+
* @param string $linkField
105+
* @param int $productId
106+
* @param int $originalProductId
107+
* @throws \Magento\Framework\Exception\InputException
108+
*
109+
* @dataProvider configDataProvider
110+
*/
111+
public function testExecute(
112+
$newTierPrices,
113+
$originalTierPrices,
114+
$priceIdToDelete,
115+
$linkField,
116+
$productId,
117+
$originalProductId
118+
): void {
112119

113120
/** @var \PHPUnit_Framework_MockObject_MockObject $product */
114121
$product = $this->getMockBuilder(\Magento\Catalog\Api\Data\ProductInterface::class)
@@ -128,8 +135,12 @@ public function testExecute(): void
128135
['entity_id', $originalProductId]
129136
]
130137
);
138+
131139
$product->expects($this->atLeastOnce())->method('getStoreId')->willReturn(0);
132-
$product->expects($this->atLeastOnce())->method('setData')->with('tier_price_changed', 1);
140+
141+
$product->expects($this->atLeastOnce())
142+
->method('setData')
143+
->with('tier_price_changed', 1);
133144
$store = $this->getMockBuilder(\Magento\Store\Api\Data\StoreInterface::class)
134145
->disableOriginalConstructor()
135146
->setMethods(['getWebsiteId'])
@@ -163,11 +174,12 @@ public function testExecute(): void
163174
$this->tierPriceResource->expects($this->exactly(2))->method('savePriceData')->willReturnSelf();
164175
$this->tierPriceResource->expects($this->once())->method('deletePriceData')
165176
->with($productId, null, $priceIdToDelete);
166-
167177
$this->assertEquals($product, $this->updateHandler->execute($product));
168178
}
169179

170180
/**
181+
* Verify update handle with exception.
182+
*
171183
* @expectedException \Magento\Framework\Exception\InputException
172184
* @expectedExceptionMessage Tier prices data should be array, but actually other type is received
173185
*/
@@ -190,4 +202,88 @@ public function testExecuteWithException(): void
190202

191203
$this->updateHandler->execute($product);
192204
}
205+
206+
/**
207+
* Returns test parameters.
208+
*
209+
* @return array
210+
*/
211+
public function configDataProvider()
212+
{
213+
return [
214+
[
215+
[
216+
[
217+
'website_id' => 0,
218+
'price_qty' => 2,
219+
'cust_group' => 0,
220+
'price' => 15
221+
],
222+
[
223+
'website_id' => 0,
224+
'price_qty' => 3,
225+
'cust_group' => 3200,
226+
'price' => null,
227+
'percentage_value' => 20
228+
]
229+
],
230+
[
231+
[
232+
'price_id' => 1,
233+
'website_id' => 0,
234+
'price_qty' => 2,
235+
'cust_group' => 0,
236+
'price' => 10],
237+
[
238+
'price_id' => 2,
239+
'website_id' => 0,
240+
'price_qty' => 4,
241+
'cust_group' => 0,
242+
'price' => 20
243+
],
244+
],
245+
2,
246+
'entity_id',
247+
10,
248+
11
249+
],
250+
[
251+
[
252+
[
253+
'website_id' => 0,
254+
'price_qty' => 2,
255+
'cust_group' => 0,
256+
'price' => 0
257+
],
258+
[
259+
'website_id' => 0,
260+
'price_qty' => 3,
261+
'cust_group' => 3200,
262+
'price' => null,
263+
'percentage_value' => 20
264+
]
265+
],
266+
[
267+
[
268+
'price_id' => 1,
269+
'website_id' => 0,
270+
'price_qty' => 2,
271+
'cust_group' => 0,
272+
'price' => 10
273+
],
274+
[
275+
'price_id' => 2,
276+
'website_id' => 0,
277+
'price_qty' => 4,
278+
'cust_group' => 0,
279+
'price' => 20
280+
],
281+
],
282+
2,
283+
'entity_id',
284+
10,
285+
11
286+
]
287+
];
288+
}
193289
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToPageGridActionGroup">
12+
<annotations>
13+
<description>Navigates to CMS page grid.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/>
17+
<waitForPageLoad stepKey="waitForPageLoad1"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CreateNewPageWithBasicValues">
12+
<annotations>
13+
<description>Click Add new page button and fills basic information in cms page. Values are hardcoded from _defaultCmsPage.</description>
14+
</annotations>
15+
16+
<click selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="clickAddNewPage"/>
17+
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/>
18+
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/>
19+
<fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{_defaultCmsPage.content_heading}}" stepKey="fillFieldContentHeading"/>
20+
<fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{_defaultCmsPage.content}}" stepKey="fillFieldContent"/>
21+
<click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/>
22+
<fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="VerifyCreatedCmsPage">
12+
<annotations>
13+
<description>Verify created cms page in store front. Values are hardcoded from _defaultCmsPage.</description>
14+
</annotations>
15+
16+
<amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/>
17+
<waitForPageLoad stepKey="waitForPageLoad2"/>
18+
<see userInput="{{_defaultCmsPage.content_heading}}" stepKey="seeContentHeading"/>
19+
<see userInput="{{_defaultCmsPage.content}}" stepKey="seeContent"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Cms/Test/Mftf/Test/AdminCreateCmsPageTest.xml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,10 @@
2525
<after>
2626
<actionGroup ref="logout" stepKey="adminLogout"/>
2727
</after>
28-
<amOnPage url="{{CmsPagesPage.url}}" stepKey="amOnPagePagesGrid"/>
29-
<waitForPageLoad stepKey="waitForPageLoad1"/>
30-
<click selector="{{CmsPagesPageActionsSection.addNewPageButton}}" stepKey="clickAddNewPage"/>
31-
<fillField selector="{{CmsNewPagePageBasicFieldsSection.pageTitle}}" userInput="{{_defaultCmsPage.title}}" stepKey="fillFieldTitle"/>
32-
<click selector="{{CmsNewPagePageContentSection.header}}" stepKey="clickExpandContent"/>
33-
<fillField selector="{{CmsNewPagePageContentSection.contentHeading}}" userInput="{{_defaultCmsPage.content_heading}}" stepKey="fillFieldContentHeading"/>
34-
<!-- As of 2017/11/15, this test is failing here (Jenkins only, works locally). See MQE-282. -->
35-
<fillField selector="{{CmsNewPagePageContentSection.content}}" userInput="{{_defaultCmsPage.content}}" stepKey="fillFieldContent"/>
36-
<click selector="{{CmsNewPagePageSeoSection.header}}" stepKey="clickExpandSearchEngineOptimisation"/>
37-
<fillField selector="{{CmsNewPagePageSeoSection.urlKey}}" userInput="{{_defaultCmsPage.identifier}}" stepKey="fillFieldUrlKey"/>
38-
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.saveAndContinueEdit}}" stepKey="waitForSaveButtonVisible"/>
39-
<click selector="{{CmsNewPagePageActionsSection.expandSplitButton}}" stepKey="expandButtonMenu"/>
40-
<waitForElementVisible selector="{{CmsNewPagePageActionsSection.splitButtonMenu}}" stepKey="waitForSplitButtonMenuVisible"/>
41-
<click selector="{{CmsNewPagePageActionsSection.savePage}}" stepKey="clickSavePage"/>
42-
<see userInput="You saved the page." stepKey="seeSuccessMessage"/>
43-
<amOnPage url="{{_defaultCmsPage.identifier}}" stepKey="amOnPageTestPage"/>
44-
<waitForPageLoad stepKey="waitForPageLoad2"/>
45-
<see userInput="{{_defaultCmsPage.content_heading}}" stepKey="seeContentHeading"/>
46-
<see userInput="{{_defaultCmsPage.content}}" stepKey="seeContent"/>
28+
<actionGroup ref="AdminNavigateToPageGridActionGroup" stepKey="navigateToCmsPageGrid" />
29+
<actionGroup ref="CreateNewPageWithBasicValues" stepKey="createNewPageWithBasicValues" />
30+
<actionGroup ref="SaveCmsPageActionGroup" stepKey="clickSaveCmsPageButton" />
31+
<actionGroup ref="VerifyCreatedCmsPage" stepKey="verifyCmsPage" />
4732
</test>
4833
<test name="AdminConfigDefaultCMSPageLayoutFromConfigurationSettingTest">
4934
<annotations>

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/dynamic-rows-configurable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ define([
219219
_.each(tmpData, function (row, index) {
220220
path = this.dataScope + '.' + this.index + '.' + (this.startIndex + index);
221221
row.attributes = $('<i></i>').text(row.attributes).html();
222-
row.sku = $('<i></i>').text(row.sku).html();
222+
row.sku = row.sku;
223223
this.source.set(path, row);
224224
}, this);
225225

@@ -405,7 +405,7 @@ define([
405405
'id': row.productId,
406406
'product_link': row.productUrl,
407407
'name': $('<i></i>').text(row.name).html(),
408-
'sku': $('<i></i>').text(row.sku).html(),
408+
'sku': row.sku,
409409
'status': row.status,
410410
'price': row.price,
411411
'price_currency': row.priceCurrency,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToCurrencySymbolsPageActionGroup">
12+
<amOnPage url="{{AdminCurrencySymbolsPage.url}}" stepKey="navigateToCurrencySymbolsPage"/>
13+
<waitForPageLoad stepKey="waitForPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>

0 commit comments

Comments
 (0)