Example #1
0
 public function testGetHrefWithForProductWithCategoryIdParameter()
 {
     $storeId = 15;
     $this->block->setData('id_path', ProductUrlRewriteGenerator::ENTITY_TYPE . '/entity_id/category_id');
     $store = $this->getMock('Magento\\Store\\Model\\Store', ['getId', '__wakeUp'], [], '', false);
     $store->expects($this->any())->method('getId')->will($this->returnValue($storeId));
     $this->storeManager->expects($this->any())->method('getStore')->will($this->returnValue($store));
     $this->urlFinder->expects($this->once())->method('findOneByData')->with([UrlRewrite::ENTITY_ID => 'entity_id', UrlRewrite::ENTITY_TYPE => ProductUrlRewriteGenerator::ENTITY_TYPE, UrlRewrite::STORE_ID => $storeId, UrlRewrite::METADATA => ['category_id' => 'category_id']])->will($this->returnValue(false));
     $this->block->getHref();
 }