Esempio n. 1
0
 /**
  * @return Status
  */
 protected function getStockStatusResource()
 {
     if (empty($this->stockStatusResource)) {
         $this->stockStatusResource = $this->stockStatusFactory->create();
     }
     return $this->stockStatusResource;
 }
Esempio n. 2
0
 public function testAddIsInStockFilterToCollection()
 {
     $collectionMock = $this->getMockBuilder('Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection')->disableOriginalConstructor()->getMock();
     $stockStatusMock = $this->getMockBuilder('Magento\\CatalogInventory\\Model\\ResourceModel\\Stock\\Status')->disableOriginalConstructor()->setMethods(['addStockDataToCollection'])->getMock();
     $stockStatusMock->expects($this->once())->method('addStockDataToCollection')->with($collectionMock);
     $this->statusFactoryMock->expects($this->once())->method('create')->willReturn($stockStatusMock);
     $this->assertNull($this->stock->addIsInStockFilterToCollection($collectionMock));
 }