public function testSupportCheckedUponRequestAuthentication() { // the attribute stores the supported authenticators, returning false now
// means support changed between calling supports() and authenticateRequest()
// (which is the case with lazy firewalls)
$authenticator =
$this->
createAuthenticator(false
);
$this->request->attributes->
set('_security_authenticators',
[$authenticator]);
$authenticator->
expects($this->
never())->
method('authenticate'
);
$manager =
$this->
createManager([$authenticator]);
$manager->
authenticateRequest($this->request
);
} /**
* @dataProvider provideMatchingAuthenticatorIndex
*/
public function testAuthenticateRequest($matchingAuthenticatorIndex) { $authenticators =
[$this->
createAuthenticator(0 ===
$matchingAuthenticatorIndex),
$this->
createAuthenticator(1 ===
$matchingAuthenticatorIndex)];
$this->request->attributes->
set('_security_authenticators',
$authenticators);
$matchingAuthenticator =
$authenticators[$matchingAuthenticatorIndex];