public function testGetAddToCartUrl() { $url = 'http://magento.com/wishlist/index/index/wishlist_id/1/?___store=default'; $this->store->expects($this->once())->method('getUrl')->with('wishlist/index/cart', ['item' => '%item%'])->will($this->returnValue($url)); $this->urlBuilder->expects($this->any())->method('getUrl')->with('wishlist/index/index', ['_current' => true, '_use_rewrite' => true, '_scope_to_url' => true])->will($this->returnValue($url)); $this->assertEquals($url, $this->model->getAddToCartUrl('%item%')); }
/** * Configure product view blocks * * @return $this */ protected function _prepareLayout() { // Set custom add to cart url $block = $this->getLayout()->getBlock('product.info'); if ($block && $this->getWishlistItem()) { $url = $this->_wishlistData->getAddToCartUrl($this->getWishlistItem()); $block->setCustomAddToCartUrl($url); } return parent::_prepareLayout(); }
public function testGetAddToCartUrl() { $this->assertEquals($this->url, $this->wishlistHelper->getAddToCartUrl('%item%')); }