@@ -24,9 +24,9 @@ public function testHandleWithValidValues()
24
24
25
25
$ request = new Request (array (), array (), array (), array (), array (), array ());
26
26
27
- $ token = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\Token\TokenInterface ' );
27
+ $ token = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\Token\TokenInterface ' )-> getMock ( );
28
28
29
- $ tokenStorage = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' );
29
+ $ tokenStorage = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )-> getMock ( );
30
30
$ tokenStorage
31
31
->expects ($ this ->any ())
32
32
->method ('getToken ' )
@@ -38,7 +38,7 @@ public function testHandleWithValidValues()
38
38
->with ($ this ->equalTo ($ token ))
39
39
;
40
40
41
- $ authenticationManager = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' );
41
+ $ authenticationManager = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' )-> getMock ( );
42
42
$ authenticationManager
43
43
->expects ($ this ->once ())
44
44
->method ('authenticate ' )
@@ -56,7 +56,7 @@ public function testHandleWithValidValues()
56
56
->method ('getPreAuthenticatedData ' )
57
57
->will ($ this ->returnValue ($ userCredentials ));
58
58
59
- $ event = $ this ->getMock ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' , array (), array (), '' , false );
59
+ $ event = $ this ->getMockBuilder ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' )-> disableOriginalConstructor ()-> getMock ( );
60
60
$ event
61
61
->expects ($ this ->any ())
62
62
->method ('getRequest ' )
@@ -72,7 +72,7 @@ public function testHandleWhenAuthenticationFails()
72
72
73
73
$ request = new Request (array (), array (), array (), array (), array (), array ());
74
74
75
- $ tokenStorage = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' );
75
+ $ tokenStorage = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )-> getMock ( );
76
76
$ tokenStorage
77
77
->expects ($ this ->any ())
78
78
->method ('getToken ' )
@@ -84,7 +84,7 @@ public function testHandleWhenAuthenticationFails()
84
84
;
85
85
86
86
$ exception = new AuthenticationException ('Authentication failed. ' );
87
- $ authenticationManager = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' );
87
+ $ authenticationManager = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' )-> getMock ( );
88
88
$ authenticationManager
89
89
->expects ($ this ->once ())
90
90
->method ('authenticate ' )
@@ -102,7 +102,7 @@ public function testHandleWhenAuthenticationFails()
102
102
->method ('getPreAuthenticatedData ' )
103
103
->will ($ this ->returnValue ($ userCredentials ));
104
104
105
- $ event = $ this ->getMock ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' , array (), array (), '' , false );
105
+ $ event = $ this ->getMockBuilder ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' )-> disableOriginalConstructor ()-> getMock ( );
106
106
$ event
107
107
->expects ($ this ->any ())
108
108
->method ('getRequest ' )
@@ -120,7 +120,7 @@ public function testHandleWhenAuthenticationFailsWithDifferentToken()
120
120
121
121
$ request = new Request (array (), array (), array (), array (), array (), array ());
122
122
123
- $ tokenStorage = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' );
123
+ $ tokenStorage = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )-> getMock ( );
124
124
$ tokenStorage
125
125
->expects ($ this ->any ())
126
126
->method ('getToken ' )
@@ -132,7 +132,7 @@ public function testHandleWhenAuthenticationFailsWithDifferentToken()
132
132
;
133
133
134
134
$ exception = new AuthenticationException ('Authentication failed. ' );
135
- $ authenticationManager = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' );
135
+ $ authenticationManager = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' )-> getMock ( );
136
136
$ authenticationManager
137
137
->expects ($ this ->once ())
138
138
->method ('authenticate ' )
@@ -150,7 +150,7 @@ public function testHandleWhenAuthenticationFailsWithDifferentToken()
150
150
->method ('getPreAuthenticatedData ' )
151
151
->will ($ this ->returnValue ($ userCredentials ));
152
152
153
- $ event = $ this ->getMock ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' , array (), array (), '' , false );
153
+ $ event = $ this ->getMockBuilder ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' )-> disableOriginalConstructor ()-> getMock ( );
154
154
$ event
155
155
->expects ($ this ->any ())
156
156
->method ('getRequest ' )
@@ -168,14 +168,14 @@ public function testHandleWithASimilarAuthenticatedToken()
168
168
169
169
$ token = new PreAuthenticatedToken ('TheUser ' , 'TheCredentials ' , 'TheProviderKey ' , array ('ROLE_FOO ' ));
170
170
171
- $ tokenStorage = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' );
171
+ $ tokenStorage = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )-> getMock ( );
172
172
$ tokenStorage
173
173
->expects ($ this ->any ())
174
174
->method ('getToken ' )
175
175
->will ($ this ->returnValue ($ token ))
176
176
;
177
177
178
- $ authenticationManager = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' );
178
+ $ authenticationManager = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' )-> getMock ( );
179
179
$ authenticationManager
180
180
->expects ($ this ->never ())
181
181
->method ('authenticate ' )
@@ -191,7 +191,7 @@ public function testHandleWithASimilarAuthenticatedToken()
191
191
->method ('getPreAuthenticatedData ' )
192
192
->will ($ this ->returnValue ($ userCredentials ));
193
193
194
- $ event = $ this ->getMock ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' , array (), array (), '' , false );
194
+ $ event = $ this ->getMockBuilder ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' )-> disableOriginalConstructor ()-> getMock ( );
195
195
$ event
196
196
->expects ($ this ->any ())
197
197
->method ('getRequest ' )
@@ -209,7 +209,7 @@ public function testHandleWithAnInvalidSimilarToken()
209
209
210
210
$ token = new PreAuthenticatedToken ('AnotherUser ' , 'TheCredentials ' , 'TheProviderKey ' , array ('ROLE_FOO ' ));
211
211
212
- $ tokenStorage = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' );
212
+ $ tokenStorage = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface ' )-> getMock ( );
213
213
$ tokenStorage
214
214
->expects ($ this ->any ())
215
215
->method ('getToken ' )
@@ -222,7 +222,7 @@ public function testHandleWithAnInvalidSimilarToken()
222
222
;
223
223
224
224
$ exception = new AuthenticationException ('Authentication failed. ' );
225
- $ authenticationManager = $ this ->getMock ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' );
225
+ $ authenticationManager = $ this ->getMockBuilder ('Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface ' )-> getMock ( );
226
226
$ authenticationManager
227
227
->expects ($ this ->once ())
228
228
->method ('authenticate ' )
@@ -240,7 +240,7 @@ public function testHandleWithAnInvalidSimilarToken()
240
240
->method ('getPreAuthenticatedData ' )
241
241
->will ($ this ->returnValue ($ userCredentials ));
242
242
243
- $ event = $ this ->getMock ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' , array (), array (), '' , false );
243
+ $ event = $ this ->getMockBuilder ('Symfony\Component\HttpKernel\Event\GetResponseEvent ' )-> disableOriginalConstructor ()-> getMock ( );
244
244
$ event
245
245
->expects ($ this ->any ())
246
246
->method ('getRequest ' )
0 commit comments