@@ -38,11 +38,11 @@ class SimpleAuthenticationHandlerTest extends TestCase
38
38
39
39
protected function setUp (): void
40
40
{
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 ();
43
43
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 ();
46
46
// No methods are invoked on the exception; we just assert on its class
47
47
$ this ->authenticationException = new AuthenticationException ();
48
48
@@ -51,7 +51,7 @@ protected function setUp(): void
51
51
52
52
public function testOnAuthenticationSuccessFallsBackToDefaultHandlerIfSimpleIsNotASuccessHandler ()
53
53
{
54
- $ authenticator = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\ SimpleAuthenticatorInterface' )->getMock ();
54
+ $ authenticator = $ this ->getMockBuilder (SimpleAuthenticatorInterface::class )->getMock ();
55
55
56
56
$ this ->successHandler ->expects ($ this ->once ())
57
57
->method ('onAuthenticationSuccess ' )
@@ -69,7 +69,7 @@ public function testOnAuthenticationSuccessCallsSimpleAuthenticator()
69
69
$ this ->successHandler ->expects ($ this ->never ())
70
70
->method ('onAuthenticationSuccess ' );
71
71
72
- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestSuccessHandlerInterface ' );
72
+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestSuccessHandlerInterface::class );
73
73
$ authenticator ->expects ($ this ->once ())
74
74
->method ('onAuthenticationSuccess ' )
75
75
->with ($ this ->request , $ this ->token )
@@ -83,12 +83,12 @@ public function testOnAuthenticationSuccessCallsSimpleAuthenticator()
83
83
84
84
public function testOnAuthenticationSuccessThrowsAnExceptionIfNonResponseIsReturned ()
85
85
{
86
- $ this ->expectException (' UnexpectedValueException ' );
86
+ $ this ->expectException (\ UnexpectedValueException::class );
87
87
$ this ->expectExceptionMessage ('onAuthenticationSuccess()" method must return null to use the default success handler, or a Response object ' );
88
88
$ this ->successHandler ->expects ($ this ->never ())
89
89
->method ('onAuthenticationSuccess ' );
90
90
91
- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestSuccessHandlerInterface ' );
91
+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestSuccessHandlerInterface::class );
92
92
$ authenticator ->expects ($ this ->once ())
93
93
->method ('onAuthenticationSuccess ' )
94
94
->with ($ this ->request , $ this ->token )
@@ -105,7 +105,7 @@ public function testOnAuthenticationSuccessFallsBackToDefaultHandlerIfNullIsRetu
105
105
->with ($ this ->request , $ this ->token )
106
106
->willReturn ($ this ->response );
107
107
108
- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestSuccessHandlerInterface ' );
108
+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestSuccessHandlerInterface::class );
109
109
$ authenticator ->expects ($ this ->once ())
110
110
->method ('onAuthenticationSuccess ' )
111
111
->with ($ this ->request , $ this ->token )
@@ -119,7 +119,7 @@ public function testOnAuthenticationSuccessFallsBackToDefaultHandlerIfNullIsRetu
119
119
120
120
public function testOnAuthenticationFailureFallsBackToDefaultHandlerIfSimpleIsNotAFailureHandler ()
121
121
{
122
- $ authenticator = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\ SimpleAuthenticatorInterface' )->getMock ();
122
+ $ authenticator = $ this ->getMockBuilder (SimpleAuthenticatorInterface::class )->getMock ();
123
123
124
124
$ this ->failureHandler ->expects ($ this ->once ())
125
125
->method ('onAuthenticationFailure ' )
@@ -137,7 +137,7 @@ public function testOnAuthenticationFailureCallsSimpleAuthenticator()
137
137
$ this ->failureHandler ->expects ($ this ->never ())
138
138
->method ('onAuthenticationFailure ' );
139
139
140
- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestFailureHandlerInterface ' );
140
+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestFailureHandlerInterface::class );
141
141
$ authenticator ->expects ($ this ->once ())
142
142
->method ('onAuthenticationFailure ' )
143
143
->with ($ this ->request , $ this ->authenticationException )
@@ -151,12 +151,12 @@ public function testOnAuthenticationFailureCallsSimpleAuthenticator()
151
151
152
152
public function testOnAuthenticationFailureThrowsAnExceptionIfNonResponseIsReturned ()
153
153
{
154
- $ this ->expectException (' UnexpectedValueException ' );
154
+ $ this ->expectException (\ UnexpectedValueException::class );
155
155
$ this ->expectExceptionMessage ('onAuthenticationFailure()" method must return null to use the default failure handler, or a Response object ' );
156
156
$ this ->failureHandler ->expects ($ this ->never ())
157
157
->method ('onAuthenticationFailure ' );
158
158
159
- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestFailureHandlerInterface ' );
159
+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestFailureHandlerInterface::class );
160
160
$ authenticator ->expects ($ this ->once ())
161
161
->method ('onAuthenticationFailure ' )
162
162
->with ($ this ->request , $ this ->authenticationException )
@@ -173,7 +173,7 @@ public function testOnAuthenticationFailureFallsBackToDefaultHandlerIfNullIsRetu
173
173
->with ($ this ->request , $ this ->authenticationException )
174
174
->willReturn ($ this ->response );
175
175
176
- $ authenticator = $ this ->getMockForAbstractClass (' Symfony\Component\Security\Http\Tests\Authentication\TestFailureHandlerInterface ' );
176
+ $ authenticator = $ this ->getMockForAbstractClass (\ Symfony \Component \Security \Http \Tests \Authentication \TestFailureHandlerInterface::class );
177
177
$ authenticator ->expects ($ this ->once ())
178
178
->method ('onAuthenticationFailure ' )
179
179
->with ($ this ->request , $ this ->authenticationException )
0 commit comments