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