@@ -38,11 +38,11 @@ class SimpleAuthenticationHandlerTest extends TestCase
3838
3939 protected function setUp (): void
4040 {
41- $ this ->successHandler = $ this ->getMockBuilder (' Symfony\Component\Security\Http\Authentication\ AuthenticationSuccessHandlerInterface' )->getMock ();
42- $ this ->failureHandler = $ this ->getMockBuilder (' Symfony\Component\Security\Http\Authentication\ AuthenticationFailureHandlerInterface' )->getMock ();
41+ $ this ->successHandler = $ this ->getMockBuilder (AuthenticationSuccessHandlerInterface::class )->getMock ();
42+ $ this ->failureHandler = $ this ->getMockBuilder (AuthenticationFailureHandlerInterface::class )->getMock ();
4343
44- $ this ->request = $ this ->getMockBuilder (' Symfony\Component\HttpFoundation\Request ' )->getMock ();
45- $ this ->token = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\Token\TokenInterface ' )->getMock ();
44+ $ this ->request = $ this ->getMockBuilder (\ Symfony \Component \HttpFoundation \Request::class )->getMock ();
45+ $ this ->token = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \Token \TokenInterface::class )->getMock ();
4646 // No methods are invoked on the exception; we just assert on its class
4747 $ this ->authenticationException = new AuthenticationException ();
4848
@@ -51,7 +51,7 @@ protected function setUp(): void
5151
5252 public function testOnAuthenticationSuccessFallsBackToDefaultHandlerIfSimpleIsNotASuccessHandler ()
5353 {
54- $ authenticator = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\ SimpleAuthenticatorInterface' )->getMock ();
54+ $ authenticator = $ this ->getMockBuilder (SimpleAuthenticatorInterface::class )->getMock ();
5555
5656 $ this ->successHandler ->expects ($ this ->once ())
5757 ->method ('onAuthenticationSuccess ' )
@@ -69,7 +69,7 @@ public function testOnAuthenticationSuccessCallsSimpleAuthenticator()
6969 $ this ->successHandler ->expects ($ this ->never ())
7070 ->method ('onAuthenticationSuccess ' );
7171
72- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestSuccessHandlerInterface ' );
72+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestSuccessHandlerInterface::class );
7373 $ authenticator ->expects ($ this ->once ())
7474 ->method ('onAuthenticationSuccess ' )
7575 ->with ($ this ->request , $ this ->token )
@@ -83,12 +83,12 @@ public function testOnAuthenticationSuccessCallsSimpleAuthenticator()
8383
8484 public function testOnAuthenticationSuccessThrowsAnExceptionIfNonResponseIsReturned ()
8585 {
86- $ this ->expectException (' UnexpectedValueException ' );
86+ $ this ->expectException (\ UnexpectedValueException::class );
8787 $ this ->expectExceptionMessage ('onAuthenticationSuccess()" method must return null to use the default success handler, or a Response object ' );
8888 $ this ->successHandler ->expects ($ this ->never ())
8989 ->method ('onAuthenticationSuccess ' );
9090
91- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestSuccessHandlerInterface ' );
91+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestSuccessHandlerInterface::class );
9292 $ authenticator ->expects ($ this ->once ())
9393 ->method ('onAuthenticationSuccess ' )
9494 ->with ($ this ->request , $ this ->token )
@@ -105,7 +105,7 @@ public function testOnAuthenticationSuccessFallsBackToDefaultHandlerIfNullIsRetu
105105 ->with ($ this ->request , $ this ->token )
106106 ->willReturn ($ this ->response );
107107
108- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestSuccessHandlerInterface ' );
108+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestSuccessHandlerInterface::class );
109109 $ authenticator ->expects ($ this ->once ())
110110 ->method ('onAuthenticationSuccess ' )
111111 ->with ($ this ->request , $ this ->token )
@@ -119,7 +119,7 @@ public function testOnAuthenticationSuccessFallsBackToDefaultHandlerIfNullIsRetu
119119
120120 public function testOnAuthenticationFailureFallsBackToDefaultHandlerIfSimpleIsNotAFailureHandler ()
121121 {
122- $ authenticator = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\ SimpleAuthenticatorInterface' )->getMock ();
122+ $ authenticator = $ this ->getMockBuilder (SimpleAuthenticatorInterface::class )->getMock ();
123123
124124 $ this ->failureHandler ->expects ($ this ->once ())
125125 ->method ('onAuthenticationFailure ' )
@@ -137,7 +137,7 @@ public function testOnAuthenticationFailureCallsSimpleAuthenticator()
137137 $ this ->failureHandler ->expects ($ this ->never ())
138138 ->method ('onAuthenticationFailure ' );
139139
140- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestFailureHandlerInterface ' );
140+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestFailureHandlerInterface::class );
141141 $ authenticator ->expects ($ this ->once ())
142142 ->method ('onAuthenticationFailure ' )
143143 ->with ($ this ->request , $ this ->authenticationException )
@@ -151,12 +151,12 @@ public function testOnAuthenticationFailureCallsSimpleAuthenticator()
151151
152152 public function testOnAuthenticationFailureThrowsAnExceptionIfNonResponseIsReturned ()
153153 {
154- $ this ->expectException (' UnexpectedValueException ' );
154+ $ this ->expectException (\ UnexpectedValueException::class );
155155 $ this ->expectExceptionMessage ('onAuthenticationFailure()" method must return null to use the default failure handler, or a Response object ' );
156156 $ this ->failureHandler ->expects ($ this ->never ())
157157 ->method ('onAuthenticationFailure ' );
158158
159- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestFailureHandlerInterface ' );
159+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestFailureHandlerInterface::class );
160160 $ authenticator ->expects ($ this ->once ())
161161 ->method ('onAuthenticationFailure ' )
162162 ->with ($ this ->request , $ this ->authenticationException )
@@ -173,7 +173,7 @@ public function testOnAuthenticationFailureFallsBackToDefaultHandlerIfNullIsRetu
173173 ->with ($ this ->request , $ this ->authenticationException )
174174 ->willReturn ($ this ->response );
175175
176- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestFailureHandlerInterface ' );
176+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestFailureHandlerInterface::class );
177177 $ authenticator ->expects ($ this ->once ())
178178 ->method ('onAuthenticationFailure ' )
179179 ->with ($ this ->request , $ this ->authenticationException )
0 commit comments