@@ -296,15 +296,29 @@ public function testItSetupsTheConnection()
296296 $ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
297297 $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , \AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
298298 $ amqpQueue0 ->expects ($ this ->once ())->method ('declareQueue ' );
299- $ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
300- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' ],
301- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key1 ' ]
302- );
299+ $ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )
300+ ->willReturnCallback (function (...$ args ) {
301+ static $ series = [
302+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' , []],
303+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key1 ' , []],
304+ ];
305+
306+ $ expectedArgs = array_shift ($ series );
307+ $ this ->assertSame ($ expectedArgs , $ args );
308+ })
309+ ;
303310 $ amqpQueue1 ->expects ($ this ->once ())->method ('declareQueue ' );
304- $ amqpQueue1 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
305- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key2 ' ],
306- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key3 ' ]
307- );
311+ $ amqpQueue1 ->expects ($ this ->exactly (2 ))->method ('bind ' )
312+ ->willReturnCallback (function (...$ args ) {
313+ static $ series = [
314+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key2 ' , []],
315+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key3 ' , []],
316+ ];
317+
318+ $ expectedArgs = array_shift ($ series );
319+ $ this ->assertSame ($ expectedArgs , $ args );
320+ })
321+ ;
308322
309323 $ dsn = 'amqp://localhost? ' .
310324 'exchange[default_publish_routing_key]=routing_key& ' .
@@ -334,15 +348,29 @@ public function testItSetupsTheTTLConnection()
334348 $ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
335349 $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , \AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
336350 $ amqpQueue0 ->expects ($ this ->once ())->method ('declareQueue ' );
337- $ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
338- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' ],
339- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key1 ' ]
340- );
351+ $ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )
352+ ->willReturnCallback (function (...$ args ) {
353+ static $ series = [
354+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' , []],
355+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key1 ' , []],
356+ ];
357+
358+ $ expectedArgs = array_shift ($ series );
359+ $ this ->assertSame ($ expectedArgs , $ args );
360+ })
361+ ;
341362 $ amqpQueue1 ->expects ($ this ->once ())->method ('declareQueue ' );
342- $ amqpQueue1 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
343- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key2 ' ],
344- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key3 ' ]
345- );
363+ $ amqpQueue1 ->expects ($ this ->exactly (2 ))->method ('bind ' )
364+ ->willReturnCallback (function (...$ args ) {
365+ static $ series = [
366+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key2 ' , []],
367+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key3 ' , []],
368+ ];
369+
370+ $ expectedArgs = array_shift ($ series );
371+ $ this ->assertSame ($ expectedArgs , $ args );
372+ })
373+ ;
346374
347375 $ dsn = 'amqps://localhost? ' .
348376 'cacert=/etc/ssl/certs& ' .
@@ -372,9 +400,7 @@ public function testBindingArguments()
372400 $ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
373401 $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , \AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
374402 $ amqpQueue ->expects ($ this ->once ())->method ('declareQueue ' );
375- $ amqpQueue ->expects ($ this ->exactly (1 ))->method ('bind ' )->withConsecutive (
376- [self ::DEFAULT_EXCHANGE_NAME , null , ['x-match ' => 'all ' ]]
377- );
403+ $ amqpQueue ->expects ($ this ->exactly (1 ))->method ('bind ' )->with (self ::DEFAULT_EXCHANGE_NAME , null , ['x-match ' => 'all ' ]);
378404
379405 $ dsn = 'amqp://localhost?exchange[type]=headers ' .
380406 '&queues[queue0][binding_arguments][x-match]=all ' ;
0 commit comments