@@ -311,15 +311,29 @@ public function testItSetupsTheConnection()
311
311
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
312
312
$ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , \AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
313
313
$ amqpQueue0 ->expects ($ this ->once ())->method ('declareQueue ' );
314
- $ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
315
- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' ],
316
- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key1 ' ]
317
- );
314
+ $ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )
315
+ ->willReturnCallback (function (...$ args ) {
316
+ static $ series = [
317
+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' , []],
318
+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key1 ' , []],
319
+ ];
320
+
321
+ $ expectedArgs = array_shift ($ series );
322
+ $ this ->assertSame ($ expectedArgs , $ args );
323
+ })
324
+ ;
318
325
$ amqpQueue1 ->expects ($ this ->once ())->method ('declareQueue ' );
319
- $ amqpQueue1 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
320
- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key2 ' ],
321
- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key3 ' ]
322
- );
326
+ $ amqpQueue1 ->expects ($ this ->exactly (2 ))->method ('bind ' )
327
+ ->willReturnCallback (function (...$ args ) {
328
+ static $ series = [
329
+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key2 ' , []],
330
+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key3 ' , []],
331
+ ];
332
+
333
+ $ expectedArgs = array_shift ($ series );
334
+ $ this ->assertSame ($ expectedArgs , $ args );
335
+ })
336
+ ;
323
337
324
338
$ dsn = 'amqp://localhost? ' .
325
339
'exchange[default_publish_routing_key]=routing_key& ' .
@@ -349,15 +363,29 @@ public function testItSetupsTheTTLConnection()
349
363
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
350
364
$ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , \AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
351
365
$ amqpQueue0 ->expects ($ this ->once ())->method ('declareQueue ' );
352
- $ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
353
- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' ],
354
- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key1 ' ]
355
- );
366
+ $ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )
367
+ ->willReturnCallback (function (...$ args ) {
368
+ static $ series = [
369
+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' , []],
370
+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key1 ' , []],
371
+ ];
372
+
373
+ $ expectedArgs = array_shift ($ series );
374
+ $ this ->assertSame ($ expectedArgs , $ args );
375
+ })
376
+ ;
356
377
$ amqpQueue1 ->expects ($ this ->once ())->method ('declareQueue ' );
357
- $ amqpQueue1 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
358
- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key2 ' ],
359
- [self ::DEFAULT_EXCHANGE_NAME , 'binding_key3 ' ]
360
- );
378
+ $ amqpQueue1 ->expects ($ this ->exactly (2 ))->method ('bind ' )
379
+ ->willReturnCallback (function (...$ args ) {
380
+ static $ series = [
381
+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key2 ' , []],
382
+ [self ::DEFAULT_EXCHANGE_NAME , 'binding_key3 ' , []],
383
+ ];
384
+
385
+ $ expectedArgs = array_shift ($ series );
386
+ $ this ->assertSame ($ expectedArgs , $ args );
387
+ })
388
+ ;
361
389
362
390
$ dsn = 'amqps://localhost? ' .
363
391
'cacert=/etc/ssl/certs& ' .
@@ -387,9 +415,7 @@ public function testBindingArguments()
387
415
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
388
416
$ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , \AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
389
417
$ amqpQueue ->expects ($ this ->once ())->method ('declareQueue ' );
390
- $ amqpQueue ->expects ($ this ->exactly (1 ))->method ('bind ' )->withConsecutive (
391
- [self ::DEFAULT_EXCHANGE_NAME , null , ['x-match ' => 'all ' ]]
392
- );
418
+ $ amqpQueue ->expects ($ this ->exactly (1 ))->method ('bind ' )->with (self ::DEFAULT_EXCHANGE_NAME , null , ['x-match ' => 'all ' ]);
393
419
394
420
$ dsn = 'amqp://localhost?exchange[type]=headers ' .
395
421
'&queues[queue0][binding_arguments][x-match]=all ' ;
0 commit comments