Skip to content

Commit e4d4c2f

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-59315: Non consistent save Product Stock Item via Web API and repository directly
1 parent 59d4251 commit e4d4c2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dev/tests/integration/testsuite/Magento/CatalogInventory/Api/StockItemSaveTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ public function testSave()
2020
/** @var ProductRepositoryInterface $productRepository */
2121
$productRepository = $objectManager->get(ProductRepositoryInterface::class);
2222
/** @var ProductInterface $product */
23-
$product = $productRepository->get('simple');
23+
$product = $productRepository->get('simple', false, null, true);
2424

2525
/** @var ProductExtensionInterface $ea */
2626
$ea = $product->getExtensionAttributes();
2727
$ea->getStockItem()->setQty(555);
2828
$productRepository->save($product);
2929

30-
$product = $productRepository->get('simple');
30+
$product = $productRepository->get('simple', false, null, true);
3131
$this->assertEquals(555, $product->getExtensionAttributes()->getStockItem()->getQty());
3232

3333
$stockItem = $product->getExtensionAttributes()->getStockItem();
@@ -37,7 +37,7 @@ public function testSave()
3737
$stockItemRepository->save($stockItem);
3838
$this->assertEquals(200, $product->getExtensionAttributes()->getStockItem()->getQty());
3939

40-
$product = $productRepository->get('simple');
40+
$product = $productRepository->get('simple', false, null, true);
4141
$this->assertEquals(200, $product->getExtensionAttributes()->getStockItem()->getQty());
4242
}
4343
}

0 commit comments

Comments
 (0)