Skip to content

Commit 7991d93

Browse files
authored
Merge branch '2.4-develop' into issue-36591
2 parents f7eee62 + ca30c47 commit 7991d93

File tree

82 files changed

+2976
-1213
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

+2976
-1213
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/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"/>

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

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

6666
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/>
6767
<actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/>
68-
<actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToReview"/>
68+
<actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToReview"/>
6969
<actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/>
7070
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder">
7171
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/>

app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ define([
374374
*/
375375
_sortImages: function (images) {
376376
return _.sortBy(images, function (image) {
377-
return image.position;
377+
return parseInt(image.position, 10);
378378
});
379379
},
380380

app/code/Magento/Customer/Controller/Adminhtml/Group/Save.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ public function execute()
9191
? [] : $this->getRequest()->getParam('customer_group_excluded_websites');
9292
$resultRedirect = $this->resultRedirectFactory->create();
9393
try {
94-
$customerGroupCode = (string)$this->getRequest()->getParam('code');
95-
94+
$customerGroupCode = trim((string)$this->getRequest()->getParam('code'));
9695
if ($id !== null) {
9796
$customerGroup = $this->groupRepository->getById((int)$id);
9897
$customerGroupCode = $customerGroupCode ?: $customerGroup->getCode();

app/code/Magento/Customer/Model/Vat.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,11 @@ public function checkVatNumber($countryCode, $vatNumber, $requesterCountryCode =
212212
$gatewayResponse->setRequestMessage(__('Please enter a valid VAT number.'));
213213
}
214214
} catch (\Exception $exception) {
215+
$this->logger->error(
216+
sprintf('VAT Number validation failed with message: %s', $exception->getMessage()),
217+
['exception' => $exception]
218+
);
219+
215220
$gatewayResponse->setIsValid(false);
216221
$gatewayResponse->setRequestDate('');
217222
$gatewayResponse->setRequestIdentifier('');
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Customer\Test\Unit\ViewModel\Customer;
9+
10+
use Magento\Customer\ViewModel\Customer\Auth;
11+
use Magento\Framework\App\Http\Context;
12+
use PHPUnit\Framework\MockObject\MockObject;
13+
use PHPUnit\Framework\TestCase;
14+
15+
class AuthTest extends TestCase
16+
{
17+
/**
18+
* @var Context|MockObject
19+
*/
20+
private mixed $contextMock;
21+
22+
/**
23+
* @var Auth
24+
*/
25+
private Auth $model;
26+
27+
/**
28+
* @inheritdoc
29+
*/
30+
protected function setUp(): void
31+
{
32+
$this->contextMock = $this->getMockBuilder(Context::class)
33+
->disableOriginalConstructor()
34+
->getMock();
35+
36+
$this->model = new Auth(
37+
$this->contextMock
38+
);
39+
parent::setUp();
40+
}
41+
42+
/**
43+
* Test is logged in value.
44+
*
45+
* @return void
46+
*/
47+
public function testIsLoggedIn(): void
48+
{
49+
$this->contextMock->expects($this->once())
50+
->method('getValue')
51+
->willReturn(true);
52+
53+
$this->assertEquals(
54+
true,
55+
$this->model->isLoggedIn()
56+
);
57+
}
58+
}

0 commit comments

Comments
 (0)