@@ -33,9 +33,9 @@ class UsernamePasswordFormAuthenticationListenerTest extends TestCase
3333 public function testHandleWhenUsernameLength ($ username , $ ok )
3434 {
3535 $ request = Request::create ('/login_check ' , 'POST ' , ['_username ' => $ username ]);
36- $ request ->setSession ($ this ->getMockBuilder (' Symfony\Component\HttpFoundation\Session\SessionInterface ' )->getMock ());
36+ $ request ->setSession ($ this ->getMockBuilder (\ Symfony \Component \HttpFoundation \Session \SessionInterface::class )->getMock ());
3737
38- $ httpUtils = $ this ->getMockBuilder (' Symfony\Component\Security\Http\ HttpUtils' )->getMock ();
38+ $ httpUtils = $ this ->getMockBuilder (HttpUtils::class )->getMock ();
3939 $ httpUtils
4040 ->expects ($ this ->any ())
4141 ->method ('checkRequestPath ' )
@@ -46,24 +46,24 @@ public function testHandleWhenUsernameLength($username, $ok)
4646 ->willReturn (new RedirectResponse ('/hello ' ))
4747 ;
4848
49- $ failureHandler = $ this ->getMockBuilder (' Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface ' )->getMock ();
49+ $ failureHandler = $ this ->getMockBuilder (\ Symfony \Component \Security \Http \Authentication \AuthenticationFailureHandlerInterface::class )->getMock ();
5050 $ failureHandler
5151 ->expects ($ ok ? $ this ->never () : $ this ->once ())
5252 ->method ('onAuthenticationFailure ' )
5353 ->willReturn (new Response ())
5454 ;
5555
56- $ authenticationManager = $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager ' )->disableOriginalConstructor ()->getMock ();
56+ $ authenticationManager = $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \AuthenticationProviderManager::class )->disableOriginalConstructor ()->getMock ();
5757 $ authenticationManager
5858 ->expects ($ ok ? $ this ->once () : $ this ->never ())
5959 ->method ('authenticate ' )
6060 ->willReturnArgument (0 )
6161 ;
6262
6363 $ listener = new UsernamePasswordFormAuthenticationListener (
64- $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )->getMock (),
64+ $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \Token \Storage \TokenStorageInterface::class )->getMock (),
6565 $ authenticationManager ,
66- $ this ->getMockBuilder (' Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface ' )->getMock (),
66+ $ this ->getMockBuilder (\ Symfony \Component \Security \Http \Session \SessionAuthenticationStrategyInterface::class )->getMock (),
6767 $ httpUtils ,
6868 'TheProviderKey ' ,
6969 new DefaultAuthenticationSuccessHandler ($ httpUtils ),
@@ -86,18 +86,18 @@ public function testHandleWhenUsernameLength($username, $ok)
8686 */
8787 public function testHandleNonStringUsernameWithArray ($ postOnly )
8888 {
89- $ this ->expectException (' Symfony\Component\HttpKernel\Exception\BadRequestHttpException ' );
89+ $ this ->expectException (\ Symfony \Component \HttpKernel \Exception \BadRequestHttpException::class );
9090 $ this ->expectExceptionMessage ('The key "_username" must be a string, "array" given. ' );
9191 $ request = Request::create ('/login_check ' , 'POST ' , ['_username ' => []]);
92- $ request ->setSession ($ this ->getMockBuilder (' Symfony\Component\HttpFoundation\Session\SessionInterface ' )->getMock ());
92+ $ request ->setSession ($ this ->getMockBuilder (\ Symfony \Component \HttpFoundation \Session \SessionInterface::class )->getMock ());
9393 $ listener = new UsernamePasswordFormAuthenticationListener (
9494 new TokenStorage (),
95- $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' )->getMock (),
95+ $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \AuthenticationManagerInterface::class )->getMock (),
9696 new SessionAuthenticationStrategy (SessionAuthenticationStrategy::NONE ),
9797 $ httpUtils = new HttpUtils (),
9898 'foo ' ,
9999 new DefaultAuthenticationSuccessHandler ($ httpUtils ),
100- new DefaultAuthenticationFailureHandler ($ this ->getMockBuilder (' Symfony\Component\HttpKernel\ HttpKernelInterface' )->getMock (), $ httpUtils ),
100+ new DefaultAuthenticationFailureHandler ($ this ->getMockBuilder (HttpKernelInterface::class )->getMock (), $ httpUtils ),
101101 ['require_previous_session ' => false , 'post_only ' => $ postOnly ]
102102 );
103103 $ event = new RequestEvent ($ this ->getMockBuilder (HttpKernelInterface::class)->getMock (), $ request , HttpKernelInterface::MASTER_REQUEST );
@@ -109,18 +109,18 @@ public function testHandleNonStringUsernameWithArray($postOnly)
109109 */
110110 public function testHandleNonStringUsernameWithInt ($ postOnly )
111111 {
112- $ this ->expectException (' Symfony\Component\HttpKernel\Exception\BadRequestHttpException ' );
112+ $ this ->expectException (\ Symfony \Component \HttpKernel \Exception \BadRequestHttpException::class );
113113 $ this ->expectExceptionMessage ('The key "_username" must be a string, "int" given. ' );
114114 $ request = Request::create ('/login_check ' , 'POST ' , ['_username ' => 42 ]);
115- $ request ->setSession ($ this ->getMockBuilder (' Symfony\Component\HttpFoundation\Session\SessionInterface ' )->getMock ());
115+ $ request ->setSession ($ this ->getMockBuilder (\ Symfony \Component \HttpFoundation \Session \SessionInterface::class )->getMock ());
116116 $ listener = new UsernamePasswordFormAuthenticationListener (
117117 new TokenStorage (),
118- $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' )->getMock (),
118+ $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \AuthenticationManagerInterface::class )->getMock (),
119119 new SessionAuthenticationStrategy (SessionAuthenticationStrategy::NONE ),
120120 $ httpUtils = new HttpUtils (),
121121 'foo ' ,
122122 new DefaultAuthenticationSuccessHandler ($ httpUtils ),
123- new DefaultAuthenticationFailureHandler ($ this ->getMockBuilder (' Symfony\Component\HttpKernel\ HttpKernelInterface' )->getMock (), $ httpUtils ),
123+ new DefaultAuthenticationFailureHandler ($ this ->getMockBuilder (HttpKernelInterface::class )->getMock (), $ httpUtils ),
124124 ['require_previous_session ' => false , 'post_only ' => $ postOnly ]
125125 );
126126 $ event = new RequestEvent ($ this ->getMockBuilder (HttpKernelInterface::class)->getMock (), $ request , HttpKernelInterface::MASTER_REQUEST );
@@ -132,18 +132,18 @@ public function testHandleNonStringUsernameWithInt($postOnly)
132132 */
133133 public function testHandleNonStringUsernameWithObject ($ postOnly )
134134 {
135- $ this ->expectException (' Symfony\Component\HttpKernel\Exception\BadRequestHttpException ' );
135+ $ this ->expectException (\ Symfony \Component \HttpKernel \Exception \BadRequestHttpException::class );
136136 $ this ->expectExceptionMessage ('The key "_username" must be a string, "stdClass" given. ' );
137137 $ request = Request::create ('/login_check ' , 'POST ' , ['_username ' => new \stdClass ()]);
138- $ request ->setSession ($ this ->getMockBuilder (' Symfony\Component\HttpFoundation\Session\SessionInterface ' )->getMock ());
138+ $ request ->setSession ($ this ->getMockBuilder (\ Symfony \Component \HttpFoundation \Session \SessionInterface::class )->getMock ());
139139 $ listener = new UsernamePasswordFormAuthenticationListener (
140140 new TokenStorage (),
141- $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' )->getMock (),
141+ $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \AuthenticationManagerInterface::class )->getMock (),
142142 new SessionAuthenticationStrategy (SessionAuthenticationStrategy::NONE ),
143143 $ httpUtils = new HttpUtils (),
144144 'foo ' ,
145145 new DefaultAuthenticationSuccessHandler ($ httpUtils ),
146- new DefaultAuthenticationFailureHandler ($ this ->getMockBuilder (' Symfony\Component\HttpKernel\ HttpKernelInterface' )->getMock (), $ httpUtils ),
146+ new DefaultAuthenticationFailureHandler ($ this ->getMockBuilder (HttpKernelInterface::class )->getMock (), $ httpUtils ),
147147 ['require_previous_session ' => false , 'post_only ' => $ postOnly ]
148148 );
149149 $ event = new RequestEvent ($ this ->getMockBuilder (HttpKernelInterface::class)->getMock (), $ request , HttpKernelInterface::MASTER_REQUEST );
@@ -162,15 +162,15 @@ public function testHandleNonStringUsernameWith__toString($postOnly)
162162 ->willReturn ('someUsername ' );
163163
164164 $ request = Request::create ('/login_check ' , 'POST ' , ['_username ' => $ usernameClass ]);
165- $ request ->setSession ($ this ->getMockBuilder (' Symfony\Component\HttpFoundation\Session\SessionInterface ' )->getMock ());
165+ $ request ->setSession ($ this ->getMockBuilder (\ Symfony \Component \HttpFoundation \Session \SessionInterface::class )->getMock ());
166166 $ listener = new UsernamePasswordFormAuthenticationListener (
167167 new TokenStorage (),
168- $ this ->getMockBuilder (' Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' )->getMock (),
168+ $ this ->getMockBuilder (\ Symfony \Component \Security \Core \Authentication \AuthenticationManagerInterface::class )->getMock (),
169169 new SessionAuthenticationStrategy (SessionAuthenticationStrategy::NONE ),
170170 $ httpUtils = new HttpUtils (),
171171 'foo ' ,
172172 new DefaultAuthenticationSuccessHandler ($ httpUtils ),
173- new DefaultAuthenticationFailureHandler ($ this ->getMockBuilder (' Symfony\Component\HttpKernel\ HttpKernelInterface' )->getMock (), $ httpUtils ),
173+ new DefaultAuthenticationFailureHandler ($ this ->getMockBuilder (HttpKernelInterface::class )->getMock (), $ httpUtils ),
174174 ['require_previous_session ' => false , 'post_only ' => $ postOnly ]
175175 );
176176 $ event = new RequestEvent ($ this ->getMockBuilder (HttpKernelInterface::class)->getMock (), $ request , HttpKernelInterface::MASTER_REQUEST );
0 commit comments