Skip to content

Commit 3f99d89

Browse files
author
Oleksandr Iegorov
committed
MAGETWO-99941: Configuarable product stock status stays 'In Stock'
1 parent 4350971 commit 3f99d89

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

app/code/Magento/ConfigurableProduct/Model/Inventory/ParentItemProcessor.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ class ParentItemProcessor implements ParentItemProcessorInterface
4040
*/
4141
private $stockConfiguration;
4242

43+
/**
44+
* @param Configurable $configurableType
45+
* @param StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory
46+
* @param StockItemRepositoryInterface $stockItemRepository
47+
* @param StockConfigurationInterface $stockConfiguration
48+
*/
4349
public function __construct(
4450
Configurable $configurableType,
4551
StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory,

dev/tests/integration/testsuite/Magento/CatalogInventory/Observer/SaveInventoryDataObserverTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected function setUp()
5151
*
5252
* @magentoAppArea adminhtml
5353
* @magentoAppIsolation enabled
54+
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
5455
* @magentoDataFixture Magento/CatalogInventory/_files/configurable_options_with_low_stock.php
5556
* @throws NoSuchEntityException
5657
* @throws InputException

dev/tests/integration/testsuite/Magento/CatalogInventory/_files/configurable_options_with_low_stock.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
use Magento\CatalogInventory\Api\Data\StockItemInterface;
1010
use Magento\CatalogInventory\Api\StockItemRepositoryInterface;
1111
use Magento\TestFramework\Helper\Bootstrap;
12-
13-
require __DIR__ . '/../../../Magento/ConfigurableProduct/_files/product_configurable.php';
12+
use Magento\Catalog\Api\ProductRepositoryInterface;
1413

1514
$objectManager = Bootstrap::getObjectManager();
1615

16+
/** @var ProductRepositoryInterface $productRepository */
17+
$productRepository = $objectManager->create(ProductRepositoryInterface::class);
18+
1719
/** @var StockItemRepositoryInterface $stockItemRepository */
1820
$stockItemRepository = $objectManager->get(StockItemRepositoryInterface::class);
1921

@@ -34,4 +36,3 @@
3436
$stockItem->setIsInStock(false)
3537
->setQty(0);
3638
$stockItemRepository->save($stockItem);
37-

0 commit comments

Comments
 (0)