Example #1
0
 public function testGetProductInfo()
 {
     $productId = 3;
     $storeId = 1;
     $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue(new \Magento\Framework\Object(['id' => $storeId])));
     $this->requestMock->expects($this->once())->method('getParam')->with('id', false)->willReturn($productId);
     $productMock = $this->getMock('Magento\\Catalog\\Api\\Data\\ProductInterface');
     $this->productRepository->expects($this->once())->method('getById')->with($productId, false, $storeId)->willReturn($productMock);
     $this->assertSame($productMock, $this->object->getProductInfo());
 }