/** * Detects whether product status should be shown * * @param EventObserver $observer * @return void */ public function displayProductStatusInfo($observer) { $info = $observer->getEvent()->getStatus(); $info->setDisplayStatus($this->stockConfiguration->isDisplayProductStockStatus()); }
public function testIsDisplayProductStockStatus() { $store = 0; $this->scopeConfig->expects($this->once())->method('isSetFlag')->with(\Magento\CatalogInventory\Model\Configuration::XML_PATH_DISPLAY_PRODUCT_STOCK_STATUS, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store)->will($this->returnValue(true)); $this->assertTrue($this->stockConfiguration->isDisplayProductStockStatus()); }