File tree Expand file tree Collapse file tree 2 files changed +38
-11
lines changed Expand file tree Collapse file tree 2 files changed +38
-11
lines changed Original file line number Diff line number Diff line change @@ -123,9 +123,15 @@ public function toArray(): array
123
123
$ ldap = $ this ->createMock (LdapInterface::class);
124
124
$ ldap
125
125
->method ('bind ' )
126
- ->withConsecutive (
127
- ['elsa ' , 'test1234A$ ' ]
128
- );
126
+ ->willReturnCallback (function (...$ args ) {
127
+ static $ series = [
128
+ ['elsa ' , 'test1234A$ ' ],
129
+ ['' , 'bar ' ],
130
+ ];
131
+
132
+ $ this ->assertSame (array_shift ($ series ), $ args );
133
+ })
134
+ ;
129
135
$ ldap
130
136
->expects ($ this ->once ())
131
137
->method ('escape ' )
@@ -169,9 +175,15 @@ public function toArray(): array
169
175
$ ldap = $ this ->createMock (LdapInterface::class);
170
176
$ ldap
171
177
->method ('bind ' )
172
- ->withConsecutive (
173
- ['elsa ' , 'test1234A$ ' ]
174
- );
178
+ ->willReturnCallback (function (...$ args ) {
179
+ static $ series = [
180
+ ['elsa ' , 'test1234A$ ' ],
181
+ ['' , 'bar ' ],
182
+ ];
183
+
184
+ $ this ->assertSame (array_shift ($ series ), $ args );
185
+ })
186
+ ;
175
187
$ ldap
176
188
->expects ($ this ->once ())
177
189
->method ('escape ' )
@@ -213,9 +225,15 @@ public function testEmptyQueryResultShouldThrowAnException()
213
225
$ ldap = $ this ->createMock (LdapInterface::class);
214
226
$ ldap
215
227
->method ('bind ' )
216
- ->withConsecutive (
217
- ['elsa ' , 'test1234A$ ' ]
218
- );
228
+ ->willReturnCallback (function (...$ args ) {
229
+ static $ series = [
230
+ ['elsa ' , 'test1234A$ ' ],
231
+ ['' , 'bar ' ],
232
+ ];
233
+
234
+ $ this ->assertSame (array_shift ($ series ), $ args );
235
+ })
236
+ ;
219
237
$ ldap
220
238
->expects ($ this ->once ())
221
239
->method ('query ' )
Original file line number Diff line number Diff line change @@ -229,8 +229,17 @@ public function testCacheableVotersWithMultipleAttributes()
229
229
$ voter
230
230
->expects ($ this ->exactly (2 ))
231
231
->method ('supportsAttribute ' )
232
- ->withConsecutive (['foo ' ], ['bar ' ])
233
- ->willReturnOnConsecutiveCalls (false , true );
232
+ ->willReturnCallback (function (...$ args ) {
233
+ static $ series = [
234
+ [['foo ' ], false ],
235
+ [['bar ' ], true ],
236
+ ];
237
+
238
+ [$ expectedArgs , $ return ] = array_shift ($ series );
239
+ $ this ->assertSame ($ expectedArgs , $ args );
240
+
241
+ return $ return ;
242
+ });
234
243
$ voter
235
244
->expects ($ this ->once ())
236
245
->method ('supportsType ' )
You can’t perform that action at this time.
0 commit comments