/**
  * @return void
  */
 public function testBeforeExecute()
 {
     $logoutReasonCode = 2;
     $uri = '/uri/';
     $errorMessage = 'Error Message';
     $this->securityCookieHelperMock->expects($this->once())->method('getLogoutReasonCookie')->willReturn($logoutReasonCode);
     $this->backendControllerAuthLoginMock->expects($this->once())->method('getRequest')->willReturn($this->requestMock);
     $this->requestMock->expects($this->once())->method('getUri')->willReturn($uri);
     $this->backendControllerAuthLoginMock->expects($this->once())->method('getUrl')->willReturn($uri);
     $this->adminSessionsManagerMock->expects($this->once())->method('getLogoutReasonMessageByStatus')->with($logoutReasonCode)->willReturn($errorMessage);
     $this->messageManagerMock->expects($this->once())->method('addError')->with($errorMessage);
     $this->securityCookieHelperMock->expects($this->once())->method('deleteLogoutReasonCookie')->willReturnSelf();
     $this->controller->beforeExecute($this->backendControllerAuthLoginMock);
 }
Esempio n. 2
0
 /**
  * {@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);
     }
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function getResponse()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getResponse');
     if (!$pluginInfo) {
         return parent::getResponse();
     } else {
         return $this->___callPlugins('getResponse', func_get_args(), $pluginInfo);
     }
 }
 /**
  * Check if the login form action is requested directly
  *
  * @param Login $login
  * @return bool
  */
 protected function isLoginForm(Login $login)
 {
     return $login->getRequest()->getUri() == $login->getUrl('*');
 }