Contao\CoreBundle\Test\Security\ContaoAuthenticatorTest::testAuthenticateToken PHP Method

testAuthenticateToken() public method

Tests authenticating a token.
    public function testAuthenticateToken()
    {
        $authenticator = new ContaoAuthenticator();
        $authenticator->setContainer($this->mockContainerWithContaoScopes(ContaoCoreBundle::SCOPE_FRONTEND));
        $provider = $this->mockUserProvider();
        $this->assertInstanceOf('Contao\\CoreBundle\\Security\\Authentication\\ContaoToken', $authenticator->authenticateToken(new ContaoToken($this->mockUser()), $provider, 'frontend'));
        $this->assertInstanceOf('Contao\\CoreBundle\\Security\\Authentication\\ContaoToken', $authenticator->authenticateToken(new AnonymousToken('frontend', 'anon.'), $provider, 'frontend'));
        $this->assertEquals(new AnonymousToken('console', 'anon.'), $authenticator->authenticateToken(new AnonymousToken('console', 'anon.'), $provider, 'console'));
    }