Added regression test for AccountStatusException behavior (ref #36822)
This commit is contained in:
parent
8f2c68fc60
commit
08fbfcf5a0
@ -54,10 +54,16 @@ class AuthenticationProviderManagerTest extends TestCase
|
|||||||
|
|
||||||
public function testAuthenticateWhenProviderReturnsAccountStatusException()
|
public function testAuthenticateWhenProviderReturnsAccountStatusException()
|
||||||
{
|
{
|
||||||
|
$secondAuthenticationProvider = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface')->getMock();
|
||||||
|
|
||||||
$manager = new AuthenticationProviderManager([
|
$manager = new AuthenticationProviderManager([
|
||||||
$this->getAuthenticationProvider(true, null, 'Symfony\Component\Security\Core\Exception\AccountStatusException'),
|
$this->getAuthenticationProvider(true, null, 'Symfony\Component\Security\Core\Exception\AccountStatusException'),
|
||||||
|
$secondAuthenticationProvider,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// AccountStatusException stops authentication
|
||||||
|
$secondAuthenticationProvider->expects($this->never())->method('supports');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$manager->authenticate($token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock());
|
$manager->authenticate($token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock());
|
||||||
$this->fail();
|
$this->fail();
|
||||||
|
Reference in New Issue
Block a user