@@ -296,15 +296,29 @@ public function testItSetupsTheConnection()
296
296
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
297
297
$ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , \AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
298
298
$ 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
+ ;
303
310
$ 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
+ ;
308
322
309
323
$ dsn = 'amqp://localhost? ' .
310
324
'exchange[default_publish_routing_key]=routing_key& ' .
@@ -334,15 +348,29 @@ public function testItSetupsTheTTLConnection()
334
348
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
335
349
$ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , \AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
336
350
$ 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
+ ;
341
362
$ 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
+ ;
346
374
347
375
$ dsn = 'amqps://localhost? ' .
348
376
'cacert=/etc/ssl/certs& ' .
@@ -372,9 +400,7 @@ public function testBindingArguments()
372
400
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
373
401
$ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , \AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
374
402
$ 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 ' ]);
378
404
379
405
$ dsn = 'amqp://localhost?exchange[type]=headers ' .
380
406
'&queues[queue0][binding_arguments][x-match]=all ' ;
0 commit comments