Skip to content

Commit 1a11470

Browse files
Merge branch '2.4-develop' into AC-522
2 parents c727b6a + 46679e7 commit 1a11470

File tree

74 files changed

+2329
-243
lines changed

Some content is hidden

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

74 files changed

+2329
-243
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For more detailed information on contribution please read our [beginners guide](
1717

1818
1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.4/coding-standards/bk-coding-standards.html).
1919
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
20-
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/2.3-develop/.github/PULL_REQUEST_TEMPLATE.md) for more information.
20+
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/HEAD/.github/PULL_REQUEST_TEMPLATE.md) for more information.
2121
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
2222
3. PRs which include new logic or new features must be submitted along with:
2323
* Unit/integration test coverage
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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="AdminAwsS3ImportSimpleProductImagesDuplicationTest" extends="AdminImportSimpleProductImagesDuplicationTest">
12+
<annotations>
13+
<features value="AwsS3"/>
14+
<stories value="Import Products"/>
15+
<title value="S3 - Duplicated images should not be created if the CSV file is imported more than once"/>
16+
<description value="Duplicated images should not be created if the CSV file is imported more than once"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-42986"/>
19+
<useCaseId value="MC-42330"/>
20+
<group value="catalog_import_export"/>
21+
<group value="remote_storage_aws_s3"/>
22+
<group value="remote_storage_disabled"/>
23+
</annotations>
24+
25+
<before>
26+
<!-- Locally Copy Import Files to Unique Media Import Directory -->
27+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="createDirectory" stepKey="createDirectoryForImportImages">
28+
<argument name="path">pub/media/import/test_image_duplication</argument>
29+
</helper>
30+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProductBaseImage">
31+
<argument name="source">dev/tests/acceptance/tests/_data/{{placeholderBaseImage.file}}</argument>
32+
<argument name="destination">pub/media/import/test_image_duplication/{{placeholderBaseImage.file}}</argument>
33+
</helper>
34+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProductSmallImage">
35+
<argument name="source">dev/tests/acceptance/tests/_data/{{placeholderSmallImage.file}}</argument>
36+
<argument name="destination">pub/media/import/test_image_duplication/{{placeholderSmallImage.file}}</argument>
37+
</helper>
38+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="copy" stepKey="copyProductThumbImage">
39+
<argument name="source">dev/tests/acceptance/tests/_data/{{placeholderThumbnailImage.file}}</argument>
40+
<argument name="destination">pub/media/import/test_image_duplication/{{placeholderThumbnailImage.file}}</argument>
41+
</helper>
42+
43+
<!-- Enable AWS S3 Remote Storage & Sync -->
44+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" after="copyProductThumbImage"/>
45+
<magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage" after="enableRemoteStorage"/>
46+
47+
<!-- Copy to Import Directory in AWS S3 -->
48+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="createDirectory" stepKey="createDirectoryForImportFilesInS3" after="syncRemoteStorage">
49+
<argument name="path">var/import/images/test_image_duplication</argument>
50+
</helper>
51+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProductBaseImageS3" after="createDirectoryForImportFilesInS3">
52+
<argument name="source">media/import/test_image_duplication/{{placeholderBaseImage.file}}</argument>
53+
<argument name="destination">var/import/images/test_image_duplication/{{placeholderBaseImage.file}}</argument>
54+
</helper>
55+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProductSmallImageS3" after="copyProductBaseImageS3">
56+
<argument name="source">media/import/test_image_duplication/{{placeholderSmallImage.file}}</argument>
57+
<argument name="destination">var/import/images/test_image_duplication/{{placeholderSmallImage.file}}</argument>
58+
</helper>
59+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="copy" stepKey="copyProductThumbImageS3" after="copyProductSmallImageS3">
60+
<argument name="source">media/import/test_image_duplication/{{placeholderThumbnailImage.file}}</argument>
61+
<argument name="destination">var/import/images/test_image_duplication/{{placeholderThumbnailImage.file}}</argument>
62+
</helper>
63+
</before>
64+
65+
<after>
66+
<!-- Delete S3 Data -->
67+
<remove keyForRemoval="deleteProductImageDirectory"/>
68+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryS3" after="deleteCategory">
69+
<argument name="path">media/import/test_image_duplication</argument>
70+
</helper>
71+
<helper class="Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteImportImagesFilesDirectoryS3" after="deleteImportFilesDirectoryS3">
72+
<argument name="path">var/import/images/test_image_duplication</argument>
73+
</helper>
74+
75+
<!-- Disable AWS S3 Remote Storage & Delete Local Data -->
76+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logoutFromAdmin"/>
77+
<helper class="Magento\Catalog\Test\Mftf\Helper\LocalFileAssertions" method="deleteDirectory" stepKey="deleteImportFilesDirectoryLocal" after="disableRemoteStorage">
78+
<argument name="path">pub/media/import/test_image_duplication</argument>
79+
</helper>
80+
</after>
81+
</test>
82+
</tests>

app/code/Magento/Catalog/Model/Category.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ public function getAvailableSortBy()
10371037
{
10381038
$available = $this->getData(self::KEY_AVAILABLE_SORT_BY);
10391039
if (empty($available)) {
1040-
return [];
1040+
return null;
10411041
}
10421042
if ($available && !is_array($available)) {
10431043
$available = explode(',', $available);
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="AdminSetBackordersOnProductAdvancedInventoryActionGroup">
12+
<annotations>
13+
<description>Deselects the "Use Config Settings" checkbox and set the "Backorders" select value to required</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="backorders" type="string" defaultValue="Allow Qty Below 0"/>
17+
</arguments>
18+
19+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettingsForBackorders}}" stepKey="uncheckUseConfigSettings"/>
20+
<selectOption selector="{{AdminProductFormAdvancedInventorySection.backorders}}" userInput="{{backorders}}" stepKey="fillBackorders"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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="StorefrontAddProductWithBackordersAllowedOnProductLevelToCartTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Manage inventory, backorders"/>
15+
<title value="Add Product to Cart, Backorders Allowed On Product Level"/>
16+
<severity value="MAJOR"/>
17+
<description value="Customer should be able to add products to Cart if product qty less or equal 0 and Backorders are allowed on Product level"/>
18+
<group value="catalog"/>
19+
</annotations>
20+
21+
<before>
22+
<createData entity="SimpleProductInStockQuantityZero" stepKey="createProduct"/>
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
</before>
25+
26+
<after>
27+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
28+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
29+
</after>
30+
31+
<actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="openCreatedProductEditPage">
32+
<argument name="product" value="$$createProduct$$"/>
33+
</actionGroup>
34+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/>
35+
<actionGroup ref="AdminSetBackordersOnProductAdvancedInventoryActionGroup" stepKey="allowBackorders"/>
36+
<actionGroup ref="AdminFillAdvancedInventoryQtyActionGroup" stepKey="fillProductQty">
37+
<argument name="qty" value="-5"/>
38+
</actionGroup>
39+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButton"/>
40+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
41+
42+
<actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="gotoAndAddProductToCart">
43+
<argument name="product" value="$$createProduct$$"/>
44+
</actionGroup>
45+
46+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="gotoCart"/>
47+
<actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertProductItemInCheckOutCart">
48+
<argument name="productName" value="$$createProduct.name$$"/>
49+
<argument name="productSku" value="$$createProduct.sku$$"/>
50+
<argument name="productPrice" value="$$createProduct.price$$"/>
51+
<argument name="subtotal" value="$$createProduct.price$$" />
52+
<argument name="qty" value="1"/>
53+
</actionGroup>
54+
</test>
55+
</tests>

0 commit comments

Comments
 (0)