public function testSetPath() { $path = 'test/path'; $params = ['one' => 1, 'two' => 2]; $this->redirectInterface->expects($this->once())->method('updatePathParams')->with($params)->will($this->returnValue($params)); $this->assertInstanceOf('Magento\\Framework\\Controller\\Result\\Redirect', $this->redirect->setPath($path, $params)); }
/** * Get back result redirect after add/edit. * * @param \Magento\Framework\Controller\Result\Redirect $resultRedirect * @param null $paramCrudId * * @return \Magento\Framework\Controller\Result\Redirect */ protected function _getBackResultRedirect(\Magento\Framework\Controller\Result\Redirect $resultRedirect, $paramCrudId = null) { switch ($this->getRequest()->getParam('back')) { case 'edit': $resultRedirect->setPath('*/*/edit', [static::PARAM_CRUD_ID => $paramCrudId, '_current' => true, 'store' => $this->getRequest()->getParam('store'), 'current_slider_id' => $this->getRequest()->getParam('current_slider_id'), 'saveandclose' => $this->getRequest()->getParam('saveandclose')]); break; case 'new': $resultRedirect->setPath('*/*/new', ['_current' => true]); break; default: $resultRedirect->setPath('*/*/'); } return $resultRedirect; }
/** * {@inheritdoc} */ public function setPath($path, array $params = array()) { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setPath'); if (!$pluginInfo) { return parent::setPath($path, $params); } else { return $this->___callPlugins('setPath', func_get_args(), $pluginInfo); } }