/** * {@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); } }
public function testExecuteException() { $email = '*****@*****.**'; $exception = new \Exception(__('Exception')); $this->request->expects($this->once())->method('getPost')->with('email')->willReturn($email); $this->accountManagement->expects($this->once())->method('initiatePasswordReset')->with($email, AccountManagement::EMAIL_RESET)->willThrowException($exception); $this->messageManager->expects($this->once())->method('addExceptionMessage')->with($exception, __('We\'re unable to send the password reset email.'))->willReturnSelf(); $this->resultRedirect->expects($this->once())->method('setPath')->with('*/*/forgotpassword')->willReturnSelf(); $this->controller->execute(); }