@@ -56,11 +56,15 @@ public function testHandleWithValidValues()
56
56
->willReturn ($ token )
57
57
;
58
58
59
- $ listener = $ this ->getMockForAbstractClass (AbstractPreAuthenticatedListener::class, [
60
- $ tokenStorage ,
61
- $ authenticationManager ,
62
- 'TheProviderKey ' ,
63
- ]);
59
+ $ listener = $ this ->getMockBuilder (AbstractPreAuthenticatedListener::class)
60
+ ->setConstructorArgs ([
61
+ $ tokenStorage ,
62
+ $ authenticationManager ,
63
+ 'TheProviderKey ' ,
64
+ ])
65
+ ->onlyMethods (['getPreAuthenticatedData ' ])
66
+ ->getMock ();
67
+
64
68
$ listener
65
69
->expects ($ this ->once ())
66
70
->method ('getPreAuthenticatedData ' )
@@ -95,12 +99,15 @@ public function testHandleWhenAuthenticationFails()
95
99
->willThrowException ($ exception )
96
100
;
97
101
98
- $ listener = $ this ->getMockForAbstractClass (
99
- AbstractPreAuthenticatedListener::class, [
100
- $ tokenStorage ,
101
- $ authenticationManager ,
102
- 'TheProviderKey ' ,
103
- ]);
102
+ $ listener = $ this ->getMockBuilder (AbstractPreAuthenticatedListener::class)
103
+ ->setConstructorArgs ([
104
+ $ tokenStorage ,
105
+ $ authenticationManager ,
106
+ 'TheProviderKey ' ,
107
+ ])
108
+ ->onlyMethods (['getPreAuthenticatedData ' ])
109
+ ->getMock ();
110
+
104
111
$ listener
105
112
->expects ($ this ->once ())
106
113
->method ('getPreAuthenticatedData ' )
@@ -137,12 +144,15 @@ public function testHandleWhenAuthenticationFailsWithDifferentToken()
137
144
->willThrowException ($ exception )
138
145
;
139
146
140
- $ listener = $ this ->getMockForAbstractClass (
141
- AbstractPreAuthenticatedListener::class, [
142
- $ tokenStorage ,
143
- $ authenticationManager ,
144
- 'TheProviderKey ' ,
145
- ]);
147
+ $ listener = $ this ->getMockBuilder (AbstractPreAuthenticatedListener::class)
148
+ ->setConstructorArgs ([
149
+ $ tokenStorage ,
150
+ $ authenticationManager ,
151
+ 'TheProviderKey ' ,
152
+ ])
153
+ ->onlyMethods (['getPreAuthenticatedData ' ])
154
+ ->getMock ();
155
+
146
156
$ listener
147
157
->expects ($ this ->once ())
148
158
->method ('getPreAuthenticatedData ' )
@@ -174,12 +184,15 @@ public function testHandleWithASimilarAuthenticatedToken()
174
184
->method ('authenticate ' )
175
185
;
176
186
177
- $ listener = $ this ->getMockForAbstractClass (
178
- AbstractPreAuthenticatedListener::class, [
179
- $ tokenStorage ,
180
- $ authenticationManager ,
181
- 'TheProviderKey ' ,
182
- ]);
187
+ $ listener = $ this ->getMockBuilder (AbstractPreAuthenticatedListener::class)
188
+ ->setConstructorArgs ([
189
+ $ tokenStorage ,
190
+ $ authenticationManager ,
191
+ 'TheProviderKey ' ,
192
+ ])
193
+ ->onlyMethods (['getPreAuthenticatedData ' ])
194
+ ->getMock ();
195
+
183
196
$ listener
184
197
->expects ($ this ->once ())
185
198
->method ('getPreAuthenticatedData ' )
@@ -217,12 +230,15 @@ public function testHandleWithAnInvalidSimilarToken()
217
230
->willThrowException ($ exception )
218
231
;
219
232
220
- $ listener = $ this ->getMockForAbstractClass (
221
- AbstractPreAuthenticatedListener::class, [
222
- $ tokenStorage ,
223
- $ authenticationManager ,
224
- 'TheProviderKey ' ,
225
- ]);
233
+ $ listener = $ this ->getMockBuilder (AbstractPreAuthenticatedListener::class)
234
+ ->setConstructorArgs ([
235
+ $ tokenStorage ,
236
+ $ authenticationManager ,
237
+ 'TheProviderKey ' ,
238
+ ])
239
+ ->onlyMethods (['getPreAuthenticatedData ' ])
240
+ ->getMock ();
241
+
226
242
$ listener
227
243
->expects ($ this ->once ())
228
244
->method ('getPreAuthenticatedData ' )
0 commit comments