File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
tests/Security/Http/Authenticator Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 3131use Symfony \Component \Security \Http \Authenticator \Passport \Passport ;
3232use Symfony \Contracts \EventDispatcher \EventDispatcherInterface ;
3333use function assert ;
34- use function method_exists ;
3534
3635class TwoFactorAuthenticatorTest extends TestCase
3736{
@@ -125,19 +124,15 @@ private function stubRememberMeSetsTrusted(bool $rememberMeSetsTrusted): void
125124 private function createTwoFactorToken (TokenInterface |null $ authenticatedToken = null , bool $ allProvidersAuthenticated = false ): MockObject |TwoFactorTokenInterface
126125 {
127126 $ user = $ this ->createMock (UserInterface::class);
128- // Compatibility for Symfony < 6.0
129- if (method_exists (UserInterface::class, 'getUserIdentifier ' )) {
130- $ user
131- ->expects ($ this ->any ())
132- ->method ('getUserIdentifier ' )
133- ->willReturn (self ::USERNAME );
134- }
135-
136127 $ token = $ this ->createMock (TwoFactorTokenInterface::class);
137128 $ token
138129 ->expects ($ this ->any ())
139130 ->method ('getUser ' )
140131 ->willReturn ($ user );
132+ $ token
133+ ->expects ($ this ->any ())
134+ ->method ('getUserIdentifier ' )
135+ ->willReturn (self ::USERNAME );
141136 $ token
142137 ->expects ($ this ->any ())
143138 ->method ('getAuthenticatedToken ' )
You can’t perform that action at this time.
0 commit comments