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
123123 $ ldap = $ this ->createMock (LdapInterface::class);
124124 $ ldap
125125 ->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+ ;
129135 $ ldap
130136 ->expects ($ this ->once ())
131137 ->method ('escape ' )
@@ -169,9 +175,15 @@ public function toArray(): array
169175 $ ldap = $ this ->createMock (LdapInterface::class);
170176 $ ldap
171177 ->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+ ;
175187 $ ldap
176188 ->expects ($ this ->once ())
177189 ->method ('escape ' )
@@ -213,9 +225,15 @@ public function testEmptyQueryResultShouldThrowAnException()
213225 $ ldap = $ this ->createMock (LdapInterface::class);
214226 $ ldap
215227 ->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+ ;
219237 $ ldap
220238 ->expects ($ this ->once ())
221239 ->method ('query ' )
Original file line number Diff line number Diff line change @@ -229,8 +229,17 @@ public function testCacheableVotersWithMultipleAttributes()
229229 $ voter
230230 ->expects ($ this ->exactly (2 ))
231231 ->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+ });
234243 $ voter
235244 ->expects ($ this ->once ())
236245 ->method ('supportsType ' )
You can’t perform that action at this time.
0 commit comments