From 08fbfcf5a00b31fb37463503af1c808d0308aafa Mon Sep 17 00:00:00 2001 From: Wouter J Date: Fri, 15 May 2020 23:08:40 +0200 Subject: [PATCH] Added regression test for AccountStatusException behavior (ref #36822) --- .../Authentication/AuthenticationProviderManagerTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationProviderManagerTest.php b/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationProviderManagerTest.php index edc1897914..3e1910a1b0 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationProviderManagerTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authentication/AuthenticationProviderManagerTest.php @@ -54,10 +54,16 @@ class AuthenticationProviderManagerTest extends TestCase 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();