/** * @param Link $subject * @param Collection $collection * @return Collection * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetProductCollection(Link $subject, Collection $collection) { if ($this->configuration->isShowOutOfStock() != 1) { $this->stockHelper->addInStockFilterToCollection($collection); } return $collection; }
public function testIsShowOutOfStock() { $store = 1; $this->scopeConfigMock->expects($this->once())->method('isSetFlag')->with(Configuration::XML_PATH_SHOW_OUT_OF_STOCK, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store)->willReturn(1); $this->assertEquals(1, $this->model->isShowOutOfStock($store)); }