File tree Expand file tree Collapse file tree 2 files changed +8
-14
lines changed
dev/tests/integration/testsuite/Magento
CatalogImportExport/Model/Import Expand file tree Collapse file tree 2 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
declare (strict_types=1 );
7
7
8
- use Magento \Catalog \Api \Data \ProductAttributeInterface ;
9
- use Magento \Catalog \Api \Data \ProductInterface ;
10
8
use Magento \Eav \Model \Config ;
11
9
12
10
require __DIR__ . '/product_varchar_attribute.php ' ;
13
11
require __DIR__ . '/product_simple.php ' ;
14
12
15
13
/** @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);
23
15
$ eavConfig ->clear ();
24
16
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 );
Original file line number Diff line number Diff line change @@ -3038,7 +3038,8 @@ public function testProductStockStatusShouldBeUpdatedOnSchedule()
3038
3038
*/
3039
3039
public function testEmptyAttributeValueShouldBeIgnoredAfterUpdateProductByImport ()
3040
3040
{
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 ' ;
3042
3043
/** @var ImportProduct $importModel */
3043
3044
$ importModel = $ this ->createImportModel ($ pathToFile );
3044
3045
/** @var ProcessingErrorAggregatorInterface $errors */
You can’t perform that action at this time.
0 commit comments