Neos\Flow\Tests\Unit\Security\Authentication\AuthenticationProviderManagerTest::isAuthenticatedReturnsTrueIfAtLeastOneTokenIsAuthenticated PHP Méthode

isAuthenticatedReturnsTrueIfAtLeastOneTokenIsAuthenticated() public méthode

    public function isAuthenticatedReturnsTrueIfAtLeastOneTokenIsAuthenticated()
    {
        $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(true));
        $authenticationTokens = [$token1, $token2];
        $this->mockSecurityContext->expects($this->atLeastOnce())->method('getAuthenticationTokens')->will($this->returnValue($authenticationTokens));
        $this->assertTrue($this->authenticationProviderManager->isAuthenticated());
    }