File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
app/code/Magento/CatalogImportExport/Model/Import
dev/tests/integration/testsuite/Magento
CatalogImportExport/Model/Import Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -2869,14 +2869,12 @@ private function formatStockDataForRow(array $rowData): array
2869
2869
2870
2870
if ($ this ->stockConfiguration ->isQty ($ this ->skuProcessor ->getNewSku ($ sku )['type_id ' ])) {
2871
2871
$ stockItemDo ->setData ($ row );
2872
- $ row ['is_in_stock ' ] = $ stockItemDo -> getBackorders () && isset ($ row ['is_in_stock ' ])
2872
+ $ row ['is_in_stock ' ] = isset ($ row ['is_in_stock ' ]) && $ stockItemDo -> getBackorders ( )
2873
2873
? $ row ['is_in_stock ' ]
2874
2874
: $ this ->stockStateProvider ->verifyStock ($ stockItemDo );
2875
2875
if ($ this ->stockStateProvider ->verifyNotification ($ stockItemDo )) {
2876
- $ row ['low_stock_date ' ] = $ this ->dateTime ->gmDate (
2877
- 'Y-m-d H:i:s ' ,
2878
- (new \DateTime ())->getTimestamp ()
2879
- );
2876
+ $ row ['low_stock_date ' ] =
2877
+ gmdate (\Magento \Framework \Stdlib \DateTime::DATETIME_PHP_FORMAT , (new \DateTime ())->getTimestamp ());
2880
2878
}
2881
2879
$ row ['stock_status_changed_auto ' ] = (int )!$ this ->stockStateProvider ->verifyStock ($ stockItemDo );
2882
2880
} else {
Original file line number Diff line number Diff line change 18
18
$ product = $ objectManager ->create (\Magento \Catalog \Model \Product::class);
19
19
$ product ->isObjectNew (true );
20
20
$ product ->setTypeId (\Magento \Catalog \Model \Product \Type::TYPE_SIMPLE )
21
- ->setId (1 )
22
- ->setAttributeSetId (4 )
21
+ ->setAttributeSetId ($ product ->getDefaultAttributeSetId ())
23
22
->setWebsiteIds ([1 ])
24
23
->setName ('Simple Product ' )
25
24
->setSku ('simple-out-of-stock ' )
40
39
'is_qty_decimal ' => 0 ,
41
40
'is_in_stock ' => 0 ,
42
41
]
43
- )->setCanSaveCustomOptions (true )
42
+ )
43
+ ->setCanSaveCustomOptions (true )
44
44
->setHasOptions (true );
45
45
46
46
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepositoryFactory */
Original file line number Diff line number Diff line change @@ -2185,7 +2185,7 @@ public function testProductsWithMultipleStoresWhenMediaIsDisabled(): void
2185
2185
/**
2186
2186
* Test that imported product stock status with backorders functionality enabled can be set to 'out of stock'.
2187
2187
*
2188
- * @magentoDataIsolation enabled
2188
+ * @magentoDbIsolation enabled
2189
2189
* @magentoAppIsolation enabled
2190
2190
*
2191
2191
* @return void
@@ -2220,7 +2220,9 @@ private function importFile(string $fileName): void
2220
2220
'entity ' => 'catalog_product ' ,
2221
2221
\Magento \ImportExport \Model \Import::FIELDS_ENCLOSURE => 1 ,
2222
2222
]
2223
- )->setSource ($ source )->validateData ();
2223
+ )
2224
+ ->setSource ($ source )
2225
+ ->validateData ();
2224
2226
2225
2227
$ this ->assertTrue ($ errors ->getErrorsCount () == 0 );
2226
2228
You can’t perform that action at this time.
0 commit comments