Neos\Flow\Tests\Unit\Security\Authentication\AuthenticationProviderManagerTest::authenticateThrowsAnExceptionIfNoTokenCouldBeAuthenticated PHP Method

authenticateThrowsAnExceptionIfNoTokenCouldBeAuthenticated() public method

    public function authenticateThrowsAnExceptionIfNoTokenCouldBeAuthenticated()
    {
        $token1 = $this->createMock(TokenInterface::class);
        $token2 = $this->createMock(TokenInterface::class);
        $token1->expects($this->atLeastOnce())->method('isAuthenticated')->will($this->returnValue(false));
        $token2->expects($this->atLeastOnce())->method('isAuthenticated')->will($this->returnValue(false));
        $this->mockSecurityContext->expects($this->atLeastOnce())->method('getAuthenticationTokens')->will($this->returnValue([$token1, $token2]));
        $this->inject($this->authenticationProviderManager, 'providers', []);
        $this->authenticationProviderManager->authenticate();
    }