Scheb\TwoFactorBundle\Tests\Security\TwoFactor\EventListener\InteractiveLoginListenerTest::onSecurityInteractiveLogin_tokenClassSupported_beginAuthentication PHP Method

onSecurityInteractiveLogin_tokenClassSupported_beginAuthentication() public method

    public function onSecurityInteractiveLogin_tokenClassSupported_beginAuthentication()
    {
        $token = new UsernamePasswordToken('user', array(), 'key');
        $event = $this->createEvent($token, self::NON_WHITELISTED_IP);
        //Expect TwoFactorProvider to be called
        $expectedContext = new AuthenticationContext($this->request, $token);
        $this->authenticationContextFactory->expects($this->once())->method('create')->willReturn($expectedContext);
        $this->authHandler->expects($this->once())->method('beginAuthentication')->with($expectedContext);
        $this->listener->onSecurityInteractiveLogin($event);
    }