@@ -25,7 +25,7 @@ public function testSessionIsNotChanged()
2525 $ request ->expects ($ this ->never ())->method ('getSession ' );
2626
2727 $ strategy = new SessionAuthenticationStrategy (SessionAuthenticationStrategy::NONE );
28- $ strategy ->onAuthentication ($ request , $ this ->getToken ( ));
28+ $ strategy ->onAuthentication ($ request , $ this ->createMock (TokenInterface::class ));
2929 }
3030
3131 public function testUnsupportedStrategy ()
@@ -36,7 +36,7 @@ public function testUnsupportedStrategy()
3636 $ request ->expects ($ this ->never ())->method ('getSession ' );
3737
3838 $ strategy = new SessionAuthenticationStrategy ('foo ' );
39- $ strategy ->onAuthentication ($ request , $ this ->getToken ( ));
39+ $ strategy ->onAuthentication ($ request , $ this ->createMock (TokenInterface::class ));
4040 }
4141
4242 public function testSessionIsMigrated ()
@@ -45,7 +45,7 @@ public function testSessionIsMigrated()
4545 $ session ->expects ($ this ->once ())->method ('migrate ' )->with ($ this ->equalTo (true ));
4646
4747 $ strategy = new SessionAuthenticationStrategy (SessionAuthenticationStrategy::MIGRATE );
48- $ strategy ->onAuthentication ($ this ->getRequest ($ session ), $ this ->getToken ( ));
48+ $ strategy ->onAuthentication ($ this ->getRequest ($ session ), $ this ->createMock (TokenInterface::class ));
4949 }
5050
5151 public function testSessionIsInvalidated ()
@@ -54,7 +54,7 @@ public function testSessionIsInvalidated()
5454 $ session ->expects ($ this ->once ())->method ('invalidate ' );
5555
5656 $ strategy = new SessionAuthenticationStrategy (SessionAuthenticationStrategy::INVALIDATE );
57- $ strategy ->onAuthentication ($ this ->getRequest ($ session ), $ this ->getToken ( ));
57+ $ strategy ->onAuthentication ($ this ->getRequest ($ session ), $ this ->createMock (TokenInterface::class ));
5858 }
5959
6060 private function getRequest ($ session = null )
@@ -67,9 +67,4 @@ private function getRequest($session = null)
6767
6868 return $ request ;
6969 }
70-
71- private function getToken ()
72- {
73- return $ this ->createMock (TokenInterface::class);
74- }
7570}
0 commit comments