Skip to content

Commit

Permalink
Added regression test for AccountStatusException behavior (ref #36822)
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed May 15, 2020
1 parent d8d0624 commit 24d8cde
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tests/Authentication/AuthenticationProviderManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,16 @@ public function testAuthenticateWhenNoProviderSupportsToken()

public function testAuthenticateWhenProviderReturnsAccountStatusException()
{
$secondAuthenticationProvider = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface')->getMock();

$manager = new AuthenticationProviderManager([
$this->getAuthenticationProvider(true, null, 'Symfony\Component\Security\Core\Exception\AccountStatusException'),
$secondAuthenticationProvider,
]);

// AccountStatusException stops authentication
$secondAuthenticationProvider->expects($this->never())->method('supports');

try {
$manager->authenticate($token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock());
$this->fail();
Expand Down

0 comments on commit 24d8cde

Please sign in to comment.