public function testSetLayoutWithNoBlockAndItem() { $layoutMock = $this->getMock('Magento\\Framework\\View\\LayoutInterface', [], [], '', false); $layoutMock->expects($this->once())->method('getBlock')->with('product.info')->willReturn(null); $this->_mockRegistry->expects($this->never())->method('registry'); $this->_mockWishlistData->expects($this->never())->method('getAddToCartUrl'); $this->assertEquals($this->_model, $this->_model->setLayout($layoutMock)); $this->assertEquals($layoutMock, $this->_model->getLayout()); }
public function testGetProduct() { $product = 'some test product'; $this->_mockRegistry->expects($this->once())->method('registry')->with($this->equalTo('product'))->will($this->returnValue($product)); $this->assertEquals($product, $this->_model->getProduct()); }