onSecurityInteractiveLogin() public method

Listen for successful login events.
public onSecurityInteractiveLogin ( Symfony\Component\Security\Http\Event\InteractiveLoginEvent $event )
$event Symfony\Component\Security\Http\Event\InteractiveLoginEvent
コード例 #1
0
 /**
  * @test
  */
 public function onSecurityInteractiveLogin_tokenClassNotSupported_doNothing()
 {
     $token = $this->getMock("Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface");
     $event = $this->createEvent($token);
     //Expect TwoFactorProvider not to be called
     $this->authHandler->expects($this->never())->method("beginAuthentication");
     $this->listener->onSecurityInteractiveLogin($event);
 }
コード例 #2
0
 /**
  * @test
  */
 public function onSecurityInteractiveLogin_NotLoggedInUser_notRequestAuthenticationCode()
 {
     // simulate a not logged in user
     $event = $this->createEvent(null, self::NON_WHITELISTED_IP);
     //Expect TwoFactorProvider not to be called
     $this->authHandler->expects($this->never())->method('beginAuthentication');
     $this->listener->onSecurityInteractiveLogin($event);
 }