39 $this->config = $this->getMockForAbstractClass(
45 $this->scopeConfig = $this->getMockForAbstractClass(
46 \
Magento\Framework\
App\Config\ScopeConfigInterface::class,
52 $this->minsaleqtyHelper = $this->createMock(\
Magento\CatalogInventory\Helper\Minsaleqty::class);
54 $this->objectManagerHelper =
new ObjectManagerHelper($this);
55 $this->stockConfiguration = $this->objectManagerHelper->getObject(
56 \
Magento\CatalogInventory\Model\Configuration::class,
58 'config' => $this->config,
59 'scopeConfig' => $this->scopeConfig,
60 'minsaleqtyHelper' => $this->minsaleqtyHelper
74 'enable_qty_increments',
78 $this->assertSame($configOptions, $this->stockConfiguration->getConfigItemOptions());
84 $this->scopeConfig->expects($this->once())
87 \
Magento\CatalogInventory\Model\Configuration::XML_PATH_SHOW_OUT_OF_STOCK,
88 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
91 ->will($this->returnValue(
true));
92 $this->assertTrue($this->stockConfiguration->isShowOutOfStock());
98 $this->scopeConfig->expects($this->once())
101 \
Magento\CatalogInventory\Model\Configuration::XML_PATH_ITEM_AUTO_RETURN,
102 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
105 ->will($this->returnValue(
true));
106 $this->assertTrue($this->stockConfiguration->isAutoReturnEnabled());
112 $this->scopeConfig->expects($this->once())
113 ->method(
'isSetFlag')
115 \
Magento\CatalogInventory\Model\Configuration::XML_PATH_DISPLAY_PRODUCT_STOCK_STATUS,
116 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
119 ->will($this->returnValue(
true));
120 $this->assertTrue($this->stockConfiguration->isDisplayProductStockStatus());
testGetConfigItemOptions()
testIsAutoReturnEnabled()
testIsDisplayProductStockStatus()