Ejemplo n.º 1
0
 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());
 }
Ejemplo n.º 2
0
 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());
 }