コード例 #1
0
 public function testForwardWithParams()
 {
     $action = 'test_action';
     $params = ['param1', 'param2', 3];
     $controller = 'test_controller';
     $module = 'test_module';
     $this->forward->setModule($module);
     $this->forward->setParams($params);
     $this->forward->setController($controller);
     $this->requestInterface->expects($this->once())->method('setParams')->with($params);
     $this->requestInterface->expects($this->once())->method('setControllerName')->with($controller);
     $this->requestInterface->expects($this->once())->method('setModuleName')->with($module);
     $this->requestInterface->expects($this->once())->method('initForward');
     $this->requestInterface->expects($this->once())->method('setActionName')->with($action);
     $this->requestInterface->expects($this->once())->method('setDispatched');
     $this->assertInstanceOf('Magento\\Framework\\Controller\\Result\\Forward', $this->forward->forward($action));
 }
コード例 #2
0
ファイル: Forward.php プロジェクト: pradeep-wagento/magento2
 /**
  * @param string $action
  * @return $this
  */
 public function forward($action)
 {
     $this->session->setIsUrlNotice($this->actionFlag->get('', AbstractAction::FLAG_IS_URLS_CHECKED));
     return parent::forward($action);
 }