Exemple #1
0
 public function testGetRssData()
 {
     $this->rssUrlBuilder->expects($this->once())->method('getUrl')->will($this->returnValue('http://magento.com/rss/feeds/index/type/notifystock'));
     $item = $this->getMockBuilder('\\Magento\\Catalog\\Model\\Product')->setMethods(['__sleep', '__wakeup', 'getId', 'getQty', 'getName'])->disableOriginalConstructor()->getMock();
     $item->expects($this->once())->method('getId')->will($this->returnValue(1));
     $item->expects($this->once())->method('getQty')->will($this->returnValue(1));
     $item->expects($this->any())->method('getName')->will($this->returnValue('Low Stock Product'));
     $this->rssModel->expects($this->once())->method('getProductsCollection')->will($this->returnValue([$item]));
     $this->urlBuilder->expects($this->once())->method('getUrl')->with('catalog/product/edit', ['id' => 1, '_secure' => true, '_nosecret' => true])->will($this->returnValue('http://magento.com/catalog/product/edit/id/1'));
     $this->assertEquals($this->rssFeed, $this->block->getRssData());
 }