Skip to content

Commit 25af4d5

Browse files
committed
ACP2E-4142: Post-Patch ACP2E-4118: Stock Threshold Change in Admin Causes Negative Salable Quantities and Stock Status Mismatch
1 parent 3023688 commit 25af4d5

File tree

1 file changed

+27
-0
lines changed
  • dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest

1 file changed

+27
-0
lines changed

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff 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
*

0 commit comments

Comments
 (0)