Skip to content

Commit b559f56

Browse files
MC-18527: Merge release branch into 2.3-develop
- fix failing tests
1 parent 0d06f1f commit b559f56

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

app/code/Magento/Downloadable/Test/Mftf/Test/StorefrontAdvanceCatalogSearchDownloadableBySkuWithHyphenTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<group value="SearchEngineMysql"/>
2121
</annotations>
2222
<before>
23+
<magentoCLI stepKey="addDownloadableDomain" command="downloadable:domains:add example.com static.magento.com"/>
2324
<createData entity="ApiDownloadableProduct" stepKey="product"/>
2425
<createData entity="ApiDownloadableLink" stepKey="addDownloadableLink1">
2526
<requiredEntity createDataKey="product"/>
@@ -28,5 +29,8 @@
2829
<requiredEntity createDataKey="product"/>
2930
</createData>
3031
</before>
32+
<after>
33+
<magentoCLI stepKey="removeDownloadableDomain" command="downloadable:domains:remove example.com static.magento.com"/>
34+
</after>
3135
</test>
3236
</tests>

dev/tests/api-functional/testsuite/Magento/Catalog/Api/ProductRepositoryInterfaceTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -794,10 +794,9 @@ public function testUpdateWithExtensionAttributes(): void
794794
protected function updateProduct($product)
795795
{
796796
if (isset($product['custom_attributes'])) {
797-
$countOfProductCustomAttributes = sizeof($product['custom_attributes']);
798-
for ($i = 0; $i < $countOfProductCustomAttributes; $i++) {
799-
if ($product['custom_attributes'][$i]['attribute_code'] == 'category_ids'
800-
&& !is_array($product['custom_attributes'][$i]['value'])
797+
foreach ($product['custom_attributes'] as &$customAttribute) {
798+
if ($customAttribute['attribute_code'] == 'category_ids'
799+
&& !is_array($customAttribute['value'])
801800
) {
802801
$customAttribute['value'] = [""];
803802
}
@@ -1240,10 +1239,9 @@ protected function getSimpleProductData($productData = [])
12401239
protected function saveProduct($product, $storeCode = null)
12411240
{
12421241
if (isset($product['custom_attributes'])) {
1243-
$countOfProductCustomAttributes = sizeof($product['custom_attributes']);
1244-
for ($i = 0; $i < $countOfProductCustomAttributes; $i++) {
1245-
if ($product['custom_attributes'][$i]['attribute_code'] == 'category_ids'
1246-
&& !is_array($product['custom_attributes'][$i]['value'])
1242+
foreach ($product['custom_attributes'] as &$customAttribute) {
1243+
if ($customAttribute['attribute_code'] == 'category_ids'
1244+
&& !is_array($customAttribute['value'])
12471245
) {
12481246
$customAttribute['value'] = [""];
12491247
}

dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_with_download_limit.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
use Magento\Downloadable\Model\Link;
1616
use Magento\Downloadable\Model\Product\Type;
1717
use Magento\TestFramework\Helper\Bootstrap;
18+
use Magento\Downloadable\Api\DomainManagerInterface;
19+
20+
/** @var DomainManagerInterface $domainManager */
21+
$domainManager = Bootstrap::getObjectManager()->get(DomainManagerInterface::class);
22+
$domainManager->addDomains(['example.com']);
1823

1924
/** @var ProductRepositoryInterface $productRepository */
2025
$productRepository = Bootstrap::getObjectManager()

0 commit comments

Comments
 (0)