Skip to content

Commit b4b2078

Browse files
authored
Merge branch '2.4-develop' into fix-for-issue-37437
2 parents 0452331 + ca30c47 commit b4b2078

File tree

82 files changed

+2918
-1283
lines changed

Some content is hidden

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

82 files changed

+2918
-1283
lines changed

app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
<data key="fixedPriceFormatted">$10.00</data>
3232
<data key="defaultAttribute">Default</data>
3333
</entity>
34+
<entity name="BundleProductWithSlashSku" type="product">
35+
<data key="name">BundleProduct</data>
36+
<data key="sku">bu/ndle</data>
37+
<data key="status">1</data>
38+
</entity>
3439
<entity name="FixedBundleProduct" type="product2">
3540
<data key="name" unique="suffix">FixedBundleProduct</data>
3641
<data key="sku" unique="suffix">fixed-bundle-product</data>

app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaCheckoutWithEnabledCaptchaTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
</actionGroup>
5858
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckout"/>
5959
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/>
60-
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToReview"/>
60+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToReview"/>
6161
<actionGroup ref="AssertCaptchaVisibleOnSecondCheckoutStepActionGroup" stepKey="assertCaptchaIsVisible"/>
6262
<waitForPageLoad stepKey="waitForSpinner"/>
6363
<actionGroup ref="StorefrontFillCaptchaFieldOnCheckoutActionGroup" stepKey="placeOrderWithIncorrectValue">

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,9 @@ private function getLinkResolver()
448448
}
449449

450450
/**
451-
* Remove ids of non selected websites from $websiteIds array and return filtered data
451+
* Remove ids of non-selected websites from $websiteIds array and return filtered data
452452
*
453-
* $websiteIds parameter expects array with website ids as keys and 1 (selected) or 0 (non selected) as values
453+
* $websiteIds parameter expects array with website ids as keys and id (selected) or 0 (non-selected) as values
454454
* Only one id (default website ID) will be set to $websiteIds array when the single store mode is turned on
455455
*
456456
* @param array $websiteIds
@@ -461,7 +461,8 @@ private function filterWebsiteIds($websiteIds)
461461
if (!$this->storeManager->isSingleStoreMode()) {
462462
$websiteIds = array_filter((array) $websiteIds);
463463
} else {
464-
$websiteIds[$this->storeManager->getWebsite(true)->getId()] = 1;
464+
$websiteId = $this->storeManager->getWebsite(true)->getId();
465+
$websiteIds[$websiteId] = $websiteId;
465466
}
466467

467468
return $websiteIds;

app/code/Magento/Catalog/Model/Product/Price/Validation/TierPriceValidator.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,19 @@ private function retrieveGroupValue(string $code)
476476
$item = array_shift($items);
477477

478478
if (!$item) {
479+
$this->customerGroupsByCode[$code] = false;
479480
return false;
480481
}
481482

482-
$this->customerGroupsByCode[strtolower($item->getCode())] = $item->getId();
483+
$itemCode = $item->getCode();
484+
$itemId = $item->getId();
485+
486+
if (strtolower($itemCode) !== $code) {
487+
$this->customerGroupsByCode[$code] = false;
488+
return false;
489+
}
490+
491+
$this->customerGroupsByCode[strtolower($itemCode)] = $itemId;
483492
}
484493

485494
return $this->customerGroupsByCode[$code];

app/code/Magento/Catalog/Test/Mftf/Test/AdminProductCategoryIndexerInUpdateOnScheduleModeTest.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@
9494

9595
<!-- 4. Run cron to reindex -->
9696
<wait time="60" stepKey="waitForChanges"/>
97-
<magentoCLI command="cron:run --group index" stepKey="runCron"/>
98-
<magentoCLI command="cron:run --group index" stepKey="runCronTwice"/>
97+
<magentoCron groups="index" stepKey="runCron" />
98+
<magentoCron groups="index" stepKey="runCronTwice" />
9999

100100
<!-- 5. Open category A on Storefront again -->
101101
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadCategoryA"/>
@@ -124,8 +124,8 @@
124124

125125
<!-- 8. Run cron reindex (Ensure that at least one minute passed since last cron run) -->
126126
<wait time="60" stepKey="waitOneMinute"/>
127-
<magentoCLI command="cron:run --group index" stepKey="runCron1"/>
128-
<magentoCLI command="cron:run --group index" stepKey="runCronTwice1"/>
127+
<magentoCron groups="index" stepKey="runCron1" />
128+
<magentoCron groups="index" stepKey="runCronTwice1" />
129129

130130
<!-- 9. Open category A on Storefront again -->
131131
<actionGroup ref="ReloadPageActionGroup" stepKey="refreshCategoryAPage"/>
@@ -180,8 +180,8 @@
180180

181181
<!-- 14. Run cron to reindex (Ensure that at least one minute passed since last cron run) -->
182182
<wait time="60" stepKey="waitMinute"/>
183-
<magentoCLI command="cron:run --group index" stepKey="runCron2"/>
184-
<magentoCLI command="cron:run --group index" stepKey="runCronTwice2"/>
183+
<magentoCron groups="index" stepKey="runCron2" />
184+
<magentoCron groups="index" stepKey="runCronTwice2" />
185185

186186
<!-- 15. Open category B on Storefront -->
187187
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="onPageCategoryB">
@@ -240,8 +240,8 @@
240240

241241
<!-- 17.14. Run cron to reindex (Ensure that at least one minute passed since last cron run) -->
242242
<wait time="60" stepKey="waitForOneMinute"/>
243-
<magentoCLI command="cron:run --group index" stepKey="runCron3"/>
244-
<magentoCLI command="cron:run --group index" stepKey="runCronTwice3"/>
243+
<magentoCron groups="index" stepKey="runCron3" />
244+
<magentoCron groups="index" stepKey="runCronTwice3" />
245245

246246
<!-- 17.15. Open category B on Storefront -->
247247
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openPageCategoryB">
@@ -302,8 +302,8 @@
302302

303303
<!-- 18.14. Run cron to reindex (Ensure that at least one minute passed since last cron run) -->
304304
<wait time="60" stepKey="waitExtraMinute"/>
305-
<magentoCLI command="cron:run --group index" stepKey="runCron4"/>
306-
<magentoCLI command="cron:run --group index" stepKey="runCronTwice4"/>
305+
<magentoCron groups="index" stepKey="runCron4" />
306+
<magentoCron groups="index" stepKey="runCronTwice4" />
307307

308308
<!-- 18.15. Open category B on Storefront -->
309309
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="navigateToPageCategoryB">

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontVerifyProductAfterPartialReindexOnSeveralWebsitesTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
</actionGroup>
8383

8484
<!-- Run cron -->
85-
<magentoCLI command="cron:run" stepKey="runCron"/>
85+
<magentoCron stepKey="runCron" />
86+
<magentoCron stepKey="runCronTwice" />
8687

8788
<!-- Check product is present in category after cron run -->
8889
<actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1">

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ public function initializeDataProvider()
388388
return [
389389
[
390390
'single_store' => false,
391-
'website_ids' => ['1' => 1, '2' => 1],
392-
'expected_website_ids' => ['1' => 1, '2' => 1],
391+
'website_ids' => ['1' => 1, '2' => 2],
392+
'expected_website_ids' => ['1' => 1, '2' => 2],
393393
'links' => [],
394394
'linkTypes' => ['related', 'upsell', 'crosssell'],
395395
'expected_links' => [],
@@ -423,8 +423,8 @@ public function initializeDataProvider()
423423
// Related links
424424
[
425425
'single_store' => false,
426-
'website_ids' => ['1' => 1, '2' => 1],
427-
'expected_website_ids' => ['1' => 1, '2' => 1],
426+
'website_ids' => ['1' => 1, '2' => 2],
427+
'expected_website_ids' => ['1' => 1, '2' => 2],
428428
'links' => [
429429
'related' => [
430430
0 => [
@@ -449,8 +449,8 @@ public function initializeDataProvider()
449449
// Custom link
450450
[
451451
'single_store' => false,
452-
'website_ids' => ['1' => 1, '2' => 1],
453-
'expected_website_ids' => ['1' => 1, '2' => 1],
452+
'website_ids' => ['1' => 1, '2' => 2],
453+
'expected_website_ids' => ['1' => 1, '2' => 2],
454454
'links' => [
455455
'customlink' => [
456456
0 => [
@@ -475,8 +475,8 @@ public function initializeDataProvider()
475475
// Both links
476476
[
477477
'single_store' => false,
478-
'website_ids' => ['1' => 1, '2' => 1],
479-
'expected_website_ids' => ['1' => 1, '2' => 1],
478+
'website_ids' => ['1' => 1, '2' => 2],
479+
'expected_website_ids' => ['1' => 1, '2' => 2],
480480
'links' => [
481481
'related' => [
482482
0 => [
@@ -515,8 +515,8 @@ public function initializeDataProvider()
515515
// Undefined link type
516516
[
517517
'single_store' => false,
518-
'website_ids' => ['1' => 1, '2' => 1],
519-
'expected_website_ids' => ['1' => 1, '2' => 1],
518+
'website_ids' => ['1' => 1, '2' => 2],
519+
'expected_website_ids' => ['1' => 1, '2' => 2],
520520
'links' => [
521521
'related' => [
522522
0 => [

app/code/Magento/CatalogGraphQl/DataProvider/Product/SearchCriteriaBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function __construct(
9898
public function build(array $args, bool $includeAggregation): SearchCriteriaInterface
9999
{
100100
$searchCriteria = $this->builder->build('products', $args);
101-
$isSearch = !empty($args['search']);
101+
$isSearch = isset($args['search']);
102102
$this->updateRangeFilters($searchCriteria);
103103
if ($includeAggregation) {
104104
$attributeData = $this->eavConfig->getAttribute(Product::ENTITY, 'price');
@@ -122,7 +122,7 @@ public function build(array $args, bool $includeAggregation): SearchCriteriaInte
122122
}
123123

124124
$this->addEntityIdSort($searchCriteria);
125-
$this->addVisibilityFilter($searchCriteria, $isSearch, !empty($args['filter']));
125+
$this->addVisibilityFilter($searchCriteria, $isSearch, !empty($args['filter']['category_id']));
126126

127127
$searchCriteria->setCurrentPage($args['currentPage']);
128128
$searchCriteria->setPageSize($args['pageSize']);

app/code/Magento/CatalogGraphQl/Test/Unit/DataProvider/Product/SearchCriteriaBuilderTest.php

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -97,51 +97,63 @@ public function testBuild(): void
9797
$filter = $this->createMock(Filter::class);
9898

9999
$searchCriteria = $this->getMockBuilder(SearchCriteriaInterface::class)
100-
->disableOriginalConstructor()
101-
->getMockForAbstractClass();
100+
->disableOriginalConstructor()
101+
->getMockForAbstractClass();
102102
$attributeInterface = $this->getMockBuilder(Attribute::class)
103-
->disableOriginalConstructor()
104-
->getMockForAbstractClass();
103+
->disableOriginalConstructor()
104+
->getMockForAbstractClass();
105105

106106
$attributeInterface->setData(['is_filterable' => 0]);
107107

108108
$this->builder->expects($this->any())
109-
->method('build')
110-
->with('products', $args)
111-
->willReturn($searchCriteria);
109+
->method('build')
110+
->with('products', $args)
111+
->willReturn($searchCriteria);
112112
$searchCriteria->expects($this->any())->method('getFilterGroups')->willReturn([]);
113113
$this->eavConfig->expects($this->any())
114-
->method('getAttribute')
115-
->with(Product::ENTITY, 'price')
116-
->willReturn($attributeInterface);
117-
118-
$this->sortOrderBuilder->expects($this->once())
119-
->method('setField')
120-
->with('_id')
121-
->willReturnSelf();
122-
$this->sortOrderBuilder->expects($this->once())
123-
->method('setDirection')
124-
->with('DESC')
125-
->willReturnSelf();
126-
$this->sortOrderBuilder->expects($this->any())
127-
->method('create')
128-
->willReturn([]);
129-
130-
$this->filterBuilder->expects($this->once())
131-
->method('setField')
132-
->with('visibility')
133-
->willReturnSelf();
134-
$this->filterBuilder->expects($this->once())
135-
->method('setValue')
136-
->with("")
137-
->willReturnSelf();
138-
$this->filterBuilder->expects($this->once())
139-
->method('setConditionType')
140-
->with('in')
141-
->willReturnSelf();
142-
143-
$this->filterBuilder->expects($this->once())->method('create')->willReturn($filter);
144-
114+
->method('getAttribute')
115+
->with(Product::ENTITY, 'price')
116+
->willReturn($attributeInterface);
117+
$sortOrderList = ['relevance','_id'];
118+
$sortIncrementIndex = 0;
119+
foreach ($sortOrderList as $sortList) {
120+
$this->sortOrderBuilder->expects($this->at($sortIncrementIndex++))
121+
->method('setField')
122+
->with($sortList)
123+
->willReturnSelf();
124+
$this->sortOrderBuilder->expects($this->at($sortIncrementIndex++))
125+
->method('setDirection')
126+
->with('DESC')
127+
->willReturnSelf();
128+
$this->sortOrderBuilder->expects($this->at($sortIncrementIndex++))
129+
->method('create')
130+
->willReturn([]);
131+
}
132+
$filterOrderList = [1=>'search_term', 2=>'visibility'];
133+
$filterIncrementIndex = 0;
134+
foreach ($filterOrderList as $index => $filterList) {
135+
$this->filterBuilder->expects($this->at($filterIncrementIndex++))
136+
->method('setField')
137+
->with($filterList)
138+
->willReturnSelf();
139+
$this->filterBuilder->expects($this->at($filterIncrementIndex++))
140+
->method('setValue')
141+
->with('')
142+
->willReturnSelf();
143+
if ($index==2) {
144+
$this->filterBuilder->expects($this->at($filterIncrementIndex++))
145+
->method('setConditionType')
146+
->with('in')
147+
->willReturnSelf();
148+
} else {
149+
$this->filterBuilder->expects($this->at($filterIncrementIndex++))
150+
->method('setConditionType')
151+
->with('')
152+
->willReturnSelf();
153+
}
154+
155+
$this->filterBuilder->expects($this->at($filterIncrementIndex++))->method('create')->willReturn($filter);
156+
}
145157
$this->filterGroupBuilder->expects($this->any())
146158
->method('addFilter')
147159
->with($filter)

app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator/QuoteItemQtyList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class QuoteItemQtyList
3333
public function getQty($productId, $quoteItemId, $quoteId, $itemQty)
3434
{
3535
$qty = $itemQty;
36-
if (isset($this->_checkedQuoteItems[$quoteId][$productId]['qty']) && !in_array(
36+
if (isset($this->_checkedQuoteItems[$quoteId][$productId]['qty']) && $quoteItemId !== null && !in_array(
3737
$quoteItemId,
3838
$this->_checkedQuoteItems[$quoteId][$productId]['items']
3939
)

app/code/Magento/CatalogInventory/Test/Unit/Model/Quote/Item/QuantityValidator/QuoteItemQtyListTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public function testSingleQuoteItemQty()
4949

5050
$qty = $this->quoteItemQtyList->getQty(125, 1, 11232, 1);
5151
$this->assertEquals($this->itemQtyTestValue, $qty);
52+
53+
$this->itemQtyTestValue = 2;
54+
$qty = $this->quoteItemQtyList->getQty(125, null, 11232, 1);
55+
$this->assertNotEquals($this->itemQtyTestValue, $qty);
5256
}
5357

5458
/**

app/code/Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewShippingAddressActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<fillField selector="{{CheckoutShippingSection.emailAddress}}" userInput="{{customer.email}}" stepKey="fillEmailField"/>
2121
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customer.firstName}}" stepKey="fillFirstName"/>
2222
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customer.lastName}}" stepKey="fillLastName"/>
23-
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{address.street}}" stepKey="fillStreet"/>
23+
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{address.street[0]}}" stepKey="fillStreet"/>
2424
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{address.city}}" stepKey="fillCity"/>
2525
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{address.state}}" stepKey="selectRegion"/>
2626
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{address.postcode}}" stepKey="fillZipCode"/>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutClickNextOnShippingStepActionGroup.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="StorefrontCheckoutClickNextOnShippingStepActionGroup" extends="StorefrontCheckoutForwardFromShippingStepActionGroup">
11+
<actionGroup name="StorefrontCheckoutClickNextOnShippingStepActionGroup">
1212
<annotations>
1313
<description>Scrolls and clicks next on Checkout Shipping step</description>
1414
</annotations>
15-
<scrollTo selector="{{CheckoutShippingSection.next}}" before="clickNext" stepKey="scrollToNextButton"/>
15+
<waitForElement selector="{{CheckoutShippingSection.next}}" stepKey="waitForNextButtonElement"/>
16+
<scrollTo selector="{{CheckoutShippingSection.next}}" stepKey="scrollToNextButton"/>
17+
<waitForElementClickable selector="{{CheckoutShippingSection.next}}" stepKey="waitForNextButton"/>
18+
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
1619
<waitForPageLoad stepKey="waitForLoadingMaskToDisappear"/>
1720
</actionGroup>
1821
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontCheckoutForwardFromShippingStepActionGroup.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="StorefrontCheckoutForwardFromShippingStepActionGroup">
11+
<actionGroup name="StorefrontCheckoutForwardFromShippingStepActionGroup" deprecated="[DEPRECATED] Please use StorefrontCheckoutClickNextOnShippingStepActionGroup">
1212
<annotations>
1313
<description>Clicks next on Checkout Shipping step</description>
1414
</annotations>
1515
<waitForElementClickable selector="{{CheckoutShippingSection.next}}" time="30" stepKey="waitForNextButton"/>
1616
<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNext"/>
17+
<waitForPageLoad stepKey="waitForLoadingMaskToDisappear"/>
1718
</actionGroup>
1819
</actionGroups>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCheckoutWithEnabledMinimumOrderAmountOptionTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/>
6868
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/>
6969
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/>
70-
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToReview"/>
70+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToReview"/>
7171
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
7272
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder">
7373
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest/StorefrontCustomerCheckoutTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
5656
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/>
57-
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToReview"/>
57+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToReview"/>
5858
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
5959
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder">
6060
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>

0 commit comments

Comments
 (0)