public function testExecuteWithException() { $this->scopeConfigInterface->expects($this->once())->method('getValue')->will($this->returnValue(true)); $dataProvider = $this->getMock('Magento\\Framework\\App\\Rss\\DataProviderInterface'); $dataProvider->expects($this->once())->method('isAllowed')->will($this->returnValue(true)); $rssModel = $this->getMock('Magento\\Rss\\Model\\Rss', ['setDataProvider'], [], '', false); $rssModel->expects($this->once())->method('setDataProvider')->will($this->returnSelf()); $this->response->expects($this->once())->method('setHeader')->will($this->returnSelf()); $this->rssFactory->expects($this->once())->method('create')->will($this->returnValue($rssModel)); $this->rssManager->expects($this->once())->method('getProvider')->will($this->returnValue($dataProvider)); $this->setExpectedException('\\Zend_Feed_Builder_Exception'); $this->controller->execute(); }
/** * {@inheritdoc} */ public function dispatch(\Magento\Framework\App\RequestInterface $request) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch'); if (!$pluginInfo) { return parent::dispatch($request); } else { return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo); } }
/** * @return void */ public function execute() { $this->getRequest()->setParam('type', 'articles'); parent::execute(); }