/**
  * {@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);
     }
 }
Beispiel #2
-1
 /**
  * @param array $exceptionData
  *
  * @dataProvider exceptionDataProvider
  */
 public function testExecuteWithException($exceptionData)
 {
     $username = '******';
     $password = '******';
     $this->session->expects($this->once())->method('isLoggedIn')->willReturn(false);
     $this->formkeyValidator->expects($this->once())->method('validate')->with($this->request)->willReturn(true);
     $this->request->expects($this->once())->method('isPost')->willReturn(true);
     $this->request->expects($this->once())->method('getPost')->with('login')->willReturn(['username' => $username, 'password' => $password]);
     $exception = new $exceptionData['exception'](__($exceptionData['message']));
     $this->accountManagement->expects($this->once())->method('authenticate')->with($username, $password)->willThrowException($exception);
     $this->mockExceptions($exceptionData['exception'], $username);
     $this->accountRedirect->expects($this->once())->method('getRedirect')->willReturn($this->redirect);
     $this->assertSame($this->redirect, $this->controller->executeInternal());
 }
 /**
  * Product edit form
  *
  * @return \Magento\Framework\Controller\ResultInterface
  */
 public function execute()
 {
     $this->messageManager->addSuccess('Message from new controller.');
     return parent::execute();
 }