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

If the authentication strategy is set to "allTokens", all tokens have to be authenticated. If the strategy is set to "oneToken", only one token needs to be authenticated, but the authentication will stop after the first authenticated token. The strategy "atLeastOne" will try to authenticate at least one and as many tokens as possible.
public authenticate ( ) : void
Результат void
 /**
  * @test
  * @expectedException \Neos\Flow\Security\Exception\AuthenticationRequiredException
  */
 public function authenticateThrowsAnExceptionIfAuthenticateAllTokensIsTrueButATokenCouldNotBeAuthenticated()
 {
     $token1 = $this->createMock(TokenInterface::class);
     $token2 = $this->createMock(TokenInterface::class);
     $token1->expects($this->atLeastOnce())->method('isAuthenticated')->will($this->returnValue(true));
     $token2->expects($this->atLeastOnce())->method('isAuthenticated')->will($this->returnValue(false));
     $this->mockSecurityContext->expects($this->atLeastOnce())->method('getAuthenticationTokens')->will($this->returnValue([$token1, $token2]));
     $this->mockSecurityContext->expects($this->atLeastOnce())->method('getAuthenticationStrategy')->will($this->returnValue(Context::AUTHENTICATE_ALL_TOKENS));
     $this->inject($this->authenticationProviderManager, 'providers', []);
     $this->authenticationProviderManager->authenticate();
 }