Listen for successful login events.
public onSecurityInteractiveLogin ( Symfony\Component\Security\Http\Event\InteractiveLoginEvent $event ) | ||
$event | Symfony\Component\Security\Http\Event\InteractiveLoginEvent |
/** * @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); }
/** * @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); }