File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,33 @@ public function testStockState()
153153 $ this ->_model ->importData ();
154154 }
155155
156+ /**
157+ * Test that imported product stock status with backorders functionality enabled can be set to 'out of stock'.
158+ *
159+ * @magentoDbIsolation enabled
160+ *
161+ * @return void
162+ */
163+ public function testImportWithBackordersEnabled (): void
164+ {
165+ $ this ->importFile ('products_to_import_with_backorders_enabled_and_0_qty.csv ' );
166+ $ product = $ this ->getProductBySku ('simple_new ' );
167+ $ this ->assertFalse ($ product ->getDataByKey ('quantity_and_stock_status ' )['is_in_stock ' ]);
168+ }
169+
170+ /**
171+ * Test that imported product stock status with stock quantity > 0 and backorders functionality disabled
172+ * can be set to 'out of stock'.
173+ *
174+ * @magentoDbIsolation enabled
175+ */
176+ public function testImportWithBackordersDisabled (): void
177+ {
178+ $ this ->importFile ('products_to_import_with_backorders_disabled_and_not_0_qty.csv ' );
179+ $ product = $ this ->getProductBySku ('simple_new ' );
180+ $ this ->assertFalse ($ product ->getDataByKey ('quantity_and_stock_status ' )['is_in_stock ' ]);
181+ }
182+
156183 /**
157184 * Test that product stock status is updated after import
158185 *
You can’t perform that action at this time.
0 commit comments