@@ -25,7 +25,7 @@ public function testSessionIsNotChanged()
25
25
$ request ->expects ($ this ->never ())->method ('getSession ' );
26
26
27
27
$ strategy = new SessionAuthenticationStrategy (SessionAuthenticationStrategy::NONE );
28
- $ strategy ->onAuthentication ($ request , $ this ->getToken ( ));
28
+ $ strategy ->onAuthentication ($ request , $ this ->createMock (TokenInterface::class ));
29
29
}
30
30
31
31
public function testUnsupportedStrategy ()
@@ -36,7 +36,7 @@ public function testUnsupportedStrategy()
36
36
$ request ->expects ($ this ->never ())->method ('getSession ' );
37
37
38
38
$ strategy = new SessionAuthenticationStrategy ('foo ' );
39
- $ strategy ->onAuthentication ($ request , $ this ->getToken ( ));
39
+ $ strategy ->onAuthentication ($ request , $ this ->createMock (TokenInterface::class ));
40
40
}
41
41
42
42
public function testSessionIsMigrated ()
@@ -45,7 +45,7 @@ public function testSessionIsMigrated()
45
45
$ session ->expects ($ this ->once ())->method ('migrate ' )->with ($ this ->equalTo (true ));
46
46
47
47
$ strategy = new SessionAuthenticationStrategy (SessionAuthenticationStrategy::MIGRATE );
48
- $ strategy ->onAuthentication ($ this ->getRequest ($ session ), $ this ->getToken ( ));
48
+ $ strategy ->onAuthentication ($ this ->getRequest ($ session ), $ this ->createMock (TokenInterface::class ));
49
49
}
50
50
51
51
public function testSessionIsInvalidated ()
@@ -54,7 +54,7 @@ public function testSessionIsInvalidated()
54
54
$ session ->expects ($ this ->once ())->method ('invalidate ' );
55
55
56
56
$ strategy = new SessionAuthenticationStrategy (SessionAuthenticationStrategy::INVALIDATE );
57
- $ strategy ->onAuthentication ($ this ->getRequest ($ session ), $ this ->getToken ( ));
57
+ $ strategy ->onAuthentication ($ this ->getRequest ($ session ), $ this ->createMock (TokenInterface::class ));
58
58
}
59
59
60
60
private function getRequest ($ session = null )
@@ -67,9 +67,4 @@ private function getRequest($session = null)
67
67
68
68
return $ request ;
69
69
}
70
-
71
- private function getToken ()
72
- {
73
- return $ this ->createMock (TokenInterface::class);
74
- }
75
70
}
0 commit comments