/** * Wishlist rss feed action * Show all public wishlists and private wishlists that belong to current user * * @return void */ public function execute() { if (!$this->rssWishlistHelper->isRssAllow()) { $this->_forward('noroute'); return; } /** @var \Magento\Wishlist\Model\Wishlist $wishlist */ $wishlist = $this->wishlistProvider->getWishlist(); if ($wishlist && ($wishlist->getVisibility() || $this->customerSession->authenticate($this) && $wishlist->getCustomerId() == $this->rssWishlistHelper->getCustomer()->getId())) { $this->getResponse()->setHeader('Content-Type', 'text/xml; charset=UTF-8'); $this->_view->loadLayout(false); $this->_view->renderLayout(); return; } /** @var \Magento\Rss\Helper\Data $rssHelper */ $rssHelper = $this->rssHelperFactory->create(); $rssHelper->sendEmptyRssFeed($this->getResponse()); }
/** * @param bool $isModuleEnabled * @param bool $isWishlistActive * @param bool $result * @dataProvider dataProviderIsRssAllow */ public function testIsRssAllow($isModuleEnabled, $isWishlistActive, $result) { $this->moduleManagerMock->expects($this->once())->method('isEnabled')->with('Magento_Rss')->willReturn($isModuleEnabled); $this->scopeConfigMock->expects($this->any())->method('isSetFlag')->with('rss/wishlist/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)->willReturn($isWishlistActive); $this->assertEquals($result, $this->model->isRssAllow()); }