Skip to content

Commit 86b6f19

Browse files
committed
MC-24260: Automate (convert) integration test MC-26219
1 parent 416de14 commit 86b6f19

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_varchar_attribute.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,17 @@
55
*/
66
declare(strict_types=1);
77

8-
use Magento\Catalog\Api\Data\ProductAttributeInterface;
9-
use Magento\Catalog\Api\Data\ProductInterface;
108
use Magento\Eav\Model\Config;
119

1210
require __DIR__ . '/product_varchar_attribute.php';
1311
require __DIR__ . '/product_simple.php';
1412

1513
/** @var Config $eavConfig */
16-
$eavConfig = $objectManager->create(Config::class);
17-
18-
$attributeCode = 'varchar_attribute';
19-
/** @var ProductAttributeInterface $varcharAttribute */
20-
$varcharAttribute = $attributeRepository->get($attributeCode);
21-
$varcharAttribute->setDefaultValue('Varchar default value');
22-
$attributeRepository->save($varcharAttribute);
14+
$eavConfig = $objectManager->get(Config::class);
2315
$eavConfig->clear();
2416

25-
/** @var ProductInterface $simpleProduct */
26-
$simpleProduct = $productRepository->get('simple');
27-
$simpleProduct->setCustomAttribute($attributeCode, $attributeRepository->get($attributeCode)->getDefaultValue());
28-
$productRepository->save($simpleProduct);
17+
$attribute->setDefaultValue('Varchar default value');
18+
$attributeRepository->save($attribute);
19+
20+
$product->setCustomAttribute('varchar_attribute', $attribute->getDefaultValue());
21+
$productRepository->save($product);

dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3038,7 +3038,8 @@ public function testProductStockStatusShouldBeUpdatedOnSchedule()
30383038
*/
30393039
public function testEmptyAttributeValueShouldBeIgnoredAfterUpdateProductByImport()
30403040
{
3041-
$pathToFile = __DIR__ . '/_files/' . 'import_product_with_empty_attribute_value.csv';
3041+
$pathToFile = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR
3042+
. 'import_product_with_empty_attribute_value.csv';
30423043
/** @var ImportProduct $importModel */
30433044
$importModel = $this->createImportModel($pathToFile);
30443045
/** @var ProcessingErrorAggregatorInterface $errors */

0 commit comments

Comments
 (0)