Neos\Flow\Tests\Unit\Security\Authentication\AuthenticationProviderManagerTest::isAuthenticatedReturnsFalseIfNoTokenIsAuthenticatedWithStrategyAnyToken PHP Метод

isAuthenticatedReturnsFalseIfNoTokenIsAuthenticatedWithStrategyAnyToken() публичный Метод

    public function isAuthenticatedReturnsFalseIfNoTokenIsAuthenticatedWithStrategyAnyToken()
    {
        $token1 = $this->createMock(TokenInterface::class);
        $token1->expects($this->once())->method('isAuthenticated')->will($this->returnValue(false));
        $token2 = $this->createMock(TokenInterface::class);
        $token2->expects($this->once())->method('isAuthenticated')->will($this->returnValue(false));
        $authenticationTokens = [$token1, $token2];
        $this->mockSecurityContext->expects($this->any())->method('getAuthenticationStrategy')->will($this->returnValue(Context::AUTHENTICATE_ANY_TOKEN));
        $this->mockSecurityContext->expects($this->atLeastOnce())->method('getAuthenticationTokens')->will($this->returnValue($authenticationTokens));
        $this->assertFalse($this->authenticationProviderManager->isAuthenticated());
    }