@@ -121,12 +121,12 @@ public function testCheckCredentialsReturningFalseFailsAuthentication()
121
121
122
122
public function testGuardWithNoLongerAuthenticatedTriggersLogout ()
123
123
{
124
- $ this ->expectException (' Symfony\Component\Security\Core\Exception\AuthenticationExpiredException ' );
124
+ $ this ->expectException (\ Symfony \Component \Security \Core \Exception \AuthenticationExpiredException::class );
125
125
$ providerKey = 'my_firewall_abc ' ;
126
126
127
127
// create a token and mark it as NOT authenticated anymore
128
128
// this mimics what would happen if a user "changed" between request
129
- $ mockedUser = $ this ->getMockBuilder (' Symfony\Component\Security\Core\User\ UserInterface' )->getMock ();
129
+ $ mockedUser = $ this ->getMockBuilder (UserInterface::class )->getMock ();
130
130
$ token = new PostAuthenticationGuardToken ($ mockedUser , $ providerKey , ['ROLE_USER ' ]);
131
131
$ token ->setAuthenticated (false );
132
132
@@ -140,7 +140,7 @@ public function testSupportsChecksGuardAuthenticatorsTokenOrigin()
140
140
$ authenticatorB = $ this ->getMockBuilder (AuthenticatorInterface::class)->getMock ();
141
141
$ authenticators = [$ authenticatorA , $ authenticatorB ];
142
142
143
- $ mockedUser = $ this ->getMockBuilder (' Symfony\Component\Security\Core\User\ UserInterface' )->getMock ();
143
+ $ mockedUser = $ this ->getMockBuilder (UserInterface::class )->getMock ();
144
144
$ provider = new GuardAuthenticationProvider ($ authenticators , $ this ->userProvider , 'first_firewall ' , $ this ->userChecker );
145
145
146
146
$ token = new PreAuthenticationGuardToken ($ mockedUser , 'first_firewall_1 ' );
@@ -154,12 +154,12 @@ public function testSupportsChecksGuardAuthenticatorsTokenOrigin()
154
154
155
155
public function testAuthenticateFailsOnNonOriginatingToken ()
156
156
{
157
- $ this ->expectException (' Symfony\Component\Security\Core\Exception\AuthenticationException ' );
157
+ $ this ->expectException (\ Symfony \Component \Security \Core \Exception \AuthenticationException::class );
158
158
$ this ->expectExceptionMessageMatches ('/second_firewall_0/ ' );
159
159
$ authenticatorA = $ this ->getMockBuilder (AuthenticatorInterface::class)->getMock ();
160
160
$ authenticators = [$ authenticatorA ];
161
161
162
- $ mockedUser = $ this ->getMockBuilder (' Symfony\Component\Security\Core\User\ UserInterface' )->getMock ();
162
+ $ mockedUser = $ this ->getMockBuilder (UserInterface::class )->getMock ();
163
163
$ provider = new GuardAuthenticationProvider ($ authenticators , $ this ->userProvider , 'first_firewall ' , $ this ->userChecker );
164
164
165
165
$ token = new PreAuthenticationGuardToken ($ mockedUser , 'second_firewall_0 ' );
@@ -168,9 +168,9 @@ public function testAuthenticateFailsOnNonOriginatingToken()
168
168
169
169
protected function setUp (): void
170
170
{
171
- $ this ->userProvider = $ this ->getMockBuilder (' Symfony\Component\Security\Core\User\UserProviderInterface ' )->getMock ();
172
- $ this ->userChecker = $ this ->getMockBuilder (' Symfony\Component\Security\Core\User\UserCheckerInterface ' )->getMock ();
173
- $ this ->preAuthenticationToken = $ this ->getMockBuilder (' Symfony\Component\Security\Guard\Token\ PreAuthenticationGuardToken' )
171
+ $ this ->userProvider = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \User \UserProviderInterface::class )->getMock ();
172
+ $ this ->userChecker = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \User \UserCheckerInterface::class )->getMock ();
173
+ $ this ->preAuthenticationToken = $ this ->getMockBuilder (PreAuthenticationGuardToken::class )
174
174
->disableOriginalConstructor ()
175
175
->getMock ();
176
176
}
0 commit comments