Skip to content

Commit 7efce59

Browse files
Merge pull request #6593 from magento-tsg/2.4-develop-pr122
[Arrows] Fixes for 2.4 (pr122) (2.4-develop)
2 parents 9941d17 + 49190bb commit 7efce59

File tree

23 files changed

+456
-114
lines changed

23 files changed

+456
-114
lines changed

app/code/Magento/Catalog/Model/Api/SearchCriteria/CollectionProcessor/ConditionProcessor/ConditionBuilder/EavAttributeCondition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ public function build(Filter $filter): string
6464
->select()
6565
->from(
6666
[Collection::MAIN_TABLE_ALIAS => $entityResourceModel->getEntityTable()],
67-
Collection::MAIN_TABLE_ALIAS . '.' . $entityResourceModel->getEntityIdField()
67+
Collection::MAIN_TABLE_ALIAS . '.' . $attribute->getEntityIdField()
6868
)->joinLeft(
6969
[$tableAlias => $attribute->getBackendTable()],
7070
$tableAlias . '.' . $attribute->getEntityIdField() . '=' . Collection::MAIN_TABLE_ALIAS .
71-
'.' . $entityResourceModel->getEntityIdField() . ' AND ' . $tableAlias . '.' .
71+
'.' . $attribute->getEntityIdField() . ' AND ' . $tableAlias . '.' .
7272
$attribute->getIdFieldName() . '=' . $attribute->getAttributeId(),
7373
''
7474
)->where($tableAlias . '.value is null');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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="StorefrontAssertRelatedProductOnProductPageActionGroup">
12+
<annotations>
13+
<description>Validates that the provided Product Name is present on Product details page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string" defaultValue="{{_defaultProduct.name}}"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{StorefrontProductRelatedProductsSection.relatedProductsListSectionText}}" stepKey="waitForRelatedProductsList"/>
20+
<see selector="{{StorefrontProductRelatedProductsSection.relatedProductsListSectionText}}" userInput="{{productName}}" stepKey="seeRelatedProduct"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchSimpleProductTest/AdvanceCatalogSearchSimpleProductByShortDescriptionTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<group value="Catalog"/>
1919
</annotations>
2020
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
<actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteAllProducts"/>
2123
<createData entity="ApiProductWithDescription" stepKey="product"/>
2224
</before>
2325
<after>

app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Magento\Store\Model\StoreManagerInterface;
2222
use Magento\Store\Model\Website;
2323
use PHPUnit\Framework\MockObject\MockObject;
24+
use PHPUnit\Framework\MockObject\RuntimeException;
2425
use PHPUnit\Framework\TestCase;
2526

2627
/**
@@ -110,7 +111,7 @@ protected function setUp(): void
110111
$this->groupManagementMock->expects($this->any())->method('getAllCustomersGroup')
111112
->willReturn($group);
112113
$this->tierPriceExtensionFactoryMock = $this->getMockBuilder(ProductTierPriceExtensionFactory::class)
113-
->setMethods(['create'])
114+
->onlyMethods(['create'])
114115
->disableOriginalConstructor()
115116
->getMock();
116117
$this->model = $this->objectManagerHelper->getObject(
@@ -182,9 +183,7 @@ function () {
182183
);
183184

184185
// create sample TierPrice objects that would be coming from a REST call
185-
$tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class)
186-
->setMethods(['getWebsiteId', 'setWebsiteId', 'getPercentageValue', 'setPercentageValue'])
187-
->getMockForAbstractClass();
186+
$tierPriceExtensionMock = $this->getProductTierPriceExtensionInterfaceMock();
188187
$tierPriceExtensionMock->expects($this->any())->method('getWebsiteId')->willReturn($expectedWebsiteId);
189188
$tierPriceExtensionMock->expects($this->any())->method('getPercentageValue')->willReturn(null);
190189
$tp1 = $this->objectManagerHelper->getObject(TierPrice::class);
@@ -226,9 +225,7 @@ function () {
226225
$this->assertEquals($tps[$i]->getQty(), $tpData['price_qty'], 'Qty does not match');
227226
}
228227

229-
$tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class)
230-
->setMethods(['getWebsiteId', 'setWebsiteId', 'getPercentageValue', 'setPercentageValue'])
231-
->getMockForAbstractClass();
228+
$tierPriceExtensionMock = $this->getProductTierPriceExtensionInterfaceMock();
232229
$tierPriceExtensionMock->expects($this->any())->method('getPercentageValue')->willReturn(50);
233230
$tierPriceExtensionMock->expects($this->any())->method('setWebsiteId');
234231
$this->tierPriceExtensionFactoryMock->expects($this->any())
@@ -289,14 +286,30 @@ function () {
289286
return $this->objectManagerHelper->getObject(TierPrice::class);
290287
}
291288
);
292-
$tierPriceExtensionMock = $this->getMockBuilder(ProductTierPriceExtensionInterface::class)
293-
->onlyMethods(['getPercentageValue', 'setPercentageValue'])
294-
->getMockForAbstractClass();
289+
$tierPriceExtensionMock = $this->getProductTierPriceExtensionInterfaceMock();
295290
$tierPriceExtensionMock->method('getPercentageValue')
296291
->willReturn(50);
297292
$this->tierPriceExtensionFactoryMock->method('create')
298293
->willReturn($tierPriceExtensionMock);
299294

300295
$this->assertInstanceOf(TierPrice::class, $this->model->getTierPrices($this->product)[0]);
301296
}
297+
298+
/**
299+
* Build ProductTierPriceExtensionInterface mock.
300+
*
301+
* @return MockObject
302+
*/
303+
private function getProductTierPriceExtensionInterfaceMock(): MockObject
304+
{
305+
$mockBuilder = $this->getMockBuilder(ProductTierPriceExtensionInterface::class)
306+
->disableOriginalConstructor();
307+
try {
308+
$mockBuilder->addMethods(['getPercentageValue', 'setPercentageValue', 'setWebsiteId', 'getWebsiteId']);
309+
} catch (RuntimeException $e) {
310+
// ProductTierPriceExtensionInterface already generated and has all necessary methods.
311+
}
312+
313+
return $mockBuilder->getMock();
314+
}
302315
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<requiredEntity createDataKey="createSimpleProduct"/>
4040
</createData>
4141
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
42-
<argument name="indices" value="cataloginventory_stock"/>
42+
<argument name="indices" value=""/>
4343
</actionGroup>
4444
</before>
4545
<after>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<requiredEntity createDataKey="createSimpleProduct"/>
3838
</createData>
3939
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
40-
<argument name="indices" value="cataloginventory_stock"/>
40+
<argument name="indices" value=""/>
4141
</actionGroup>
4242
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
4343
<argument name="tags" value=""/>

app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@
198198
</array>
199199
<data key="state">California</data>
200200
</entity>
201+
<entity name="US_With_Vat_Number" type="address" extends="US_Address_CA">
202+
<data key="vat_id">U1234567891</data>
203+
</entity>
201204
<entity name="US_Default_Billing_Address_TX" type="address" extends="US_Address_TX">
202205
<data key="default_billing">false</data>
203206
<data key="default_shipping">true</data>

app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@
233233
<data key="website_id">0</data>
234234
<requiredEntity type="address">UK_Not_Default_Address</requiredEntity>
235235
</entity>
236+
<entity name="Customer_With_Vat_Number" type="customer" extends="Simple_Customer_Without_Address">
237+
<requiredEntity type="address">US_With_Vat_Number</requiredEntity>
238+
</entity>
236239
<entity name="Customer_With_Different_Default_Billing_Shipping_Addresses" type="customer">
237240
<data key="group_id">1</data>
238241
<data key="email" unique="prefix">John.Doe@example.com</data>

app/code/Magento/Multishipping/Model/Cart/Controller/CartPlugin.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function beforeDispatch(Cart $subject, RequestInterface $request)
7373
{
7474
/** @var Quote $quote */
7575
$quote = $this->checkoutSession->getQuote();
76-
if ($quote->isMultipleShippingAddresses() && $this->isCheckoutComplete()) {
76+
if ($quote->isMultipleShippingAddresses()) {
7777
$this->disableMultishipping->execute($quote);
7878
foreach ($quote->getAllShippingAddresses() as $address) {
7979
$quote->removeAddress($address->getId());
@@ -92,16 +92,6 @@ public function beforeDispatch(Cart $subject, RequestInterface $request)
9292
}
9393
}
9494

95-
/**
96-
* Checks whether the checkout flow is complete
97-
*
98-
* @return bool
99-
*/
100-
private function isCheckoutComplete() : bool
101-
{
102-
return (bool) ($this->checkoutSession->getStepData(State::STEP_SHIPPING)['is_complete'] ?? true);
103-
}
104-
10595
/**
10696
* Checks whether quote has virtual items
10797
*

app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontProcessMultishippingCheckoutWhenCartPageIsOpenedInAnotherTabTest.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@
8585
</actionGroup>
8686
<switchToNextTab stepKey="switchToNextTab"/>
8787
<!-- Click 'Continue to Billing Information' and 'Go to Review Your Order' -->
88+
<actionGroup ref="StorefrontGoToBillingInformationActionGroup" stepKey="redirectToSelectAddressAfterReset"/>
89+
<seeOptionIsSelected selector="{{StorefrontCheckoutShippingMultipleAddressesSection.selectedMultipleShippingAddress('1')}}" userInput="{{US_Address_NY.street[1]}}" stepKey="checkAddressIsReset"/>
90+
<actionGroup ref="StorefrontCheckoutShippingSelectMultipleAddressesActionGroup" stepKey="selectMultipleAddressesAfterReset">
91+
<argument name="firstAddress" value="{{UK_Not_Default_Address.street[0]}}"/>
92+
<argument name="secondAddress" value="{{US_Address_NY.street[1]}}"/>
93+
</actionGroup>
8894
<actionGroup ref="StorefrontGoToBillingInformationActionGroup" stepKey="goToBillingInformation"/>
8995
<see selector="{{ShipmentFormSection.shippingAddress}}" userInput="{{US_Address_NY.city}}" stepKey="seeBillingAddress"/>
9096
<waitForElementVisible selector="{{StorefrontMultipleShippingMethodSection.goToReviewYourOrderButton}}" stepKey="waitForGoToReviewYourOrderVisible" />

0 commit comments

Comments
 (0)