@@ -266,7 +266,7 @@ public function testItSetupsTheConnectionWithDefaults()
266
266
);
267
267
268
268
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
269
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 ]);
269
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , ' timestamp ' => time () ]);
270
270
$ amqpQueue ->expects ($ this ->once ())->method ('declareQueue ' );
271
271
$ amqpQueue ->expects ($ this ->once ())->method ('bind ' )->with (self ::DEFAULT_EXCHANGE_NAME , null );
272
272
@@ -289,7 +289,7 @@ public function testItSetupsTheConnection()
289
289
$ factory ->method ('createQueue ' )->will ($ this ->onConsecutiveCalls ($ amqpQueue0 , $ amqpQueue1 ));
290
290
291
291
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
292
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 ]);
292
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , ' timestamp ' => time () ]);
293
293
$ amqpQueue0 ->expects ($ this ->once ())->method ('declareQueue ' );
294
294
$ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
295
295
[self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' ],
@@ -326,7 +326,7 @@ public function testBindingArguments()
326
326
$ factory ->method ('createQueue ' )->willReturn ($ amqpQueue );
327
327
328
328
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
329
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 ]);
329
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , ' timestamp ' => time () ]);
330
330
$ amqpQueue ->expects ($ this ->once ())->method ('declareQueue ' );
331
331
$ amqpQueue ->expects ($ this ->exactly (1 ))->method ('bind ' )->withConsecutive (
332
332
[self ::DEFAULT_EXCHANGE_NAME , null , ['x-match ' => 'all ' ]]
@@ -439,7 +439,7 @@ public function testItDelaysTheMessage()
439
439
$ delayQueue ->expects ($ this ->once ())->method ('declareQueue ' );
440
440
$ delayQueue ->expects ($ this ->once ())->method ('bind ' )->with ('delays ' , 'delay_messages__5000 ' );
441
441
442
- $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages__5000 ' , AMQP_NOPARAM , ['headers ' => ['x-some-headers ' => 'foo ' ], 'delivery_mode ' => 2 ]);
442
+ $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages__5000 ' , AMQP_NOPARAM , ['headers ' => ['x-some-headers ' => 'foo ' ], 'delivery_mode ' => 2 , 'timestamp ' => time () ]);
443
443
444
444
$ connection = Connection::fromDsn ('amqp://localhost ' , [], $ factory );
445
445
$ connection ->publish ('{} ' , ['x-some-headers ' => 'foo ' ], 5000 );
@@ -481,7 +481,7 @@ public function testItDelaysTheMessageWithADifferentRoutingKeyAndTTLs()
481
481
$ delayQueue ->expects ($ this ->once ())->method ('declareQueue ' );
482
482
$ delayQueue ->expects ($ this ->once ())->method ('bind ' )->with ('delays ' , 'delay_messages__120000 ' );
483
483
484
- $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages__120000 ' , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 ]);
484
+ $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages__120000 ' , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , ' timestamp ' => time () ]);
485
485
$ connection ->publish ('{} ' , [], 120000 );
486
486
}
487
487
@@ -513,7 +513,7 @@ public function testAmqpStampHeadersAreUsed()
513
513
$ amqpExchange = $ this ->createMock (\AMQPExchange::class)
514
514
);
515
515
516
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => ['Foo ' => 'X ' , 'Bar ' => 'Y ' ], 'delivery_mode ' => 2 ]);
516
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => ['Foo ' => 'X ' , 'Bar ' => 'Y ' ], 'delivery_mode ' => 2 , ' timestamp ' => time () ]);
517
517
518
518
$ connection = Connection::fromDsn ('amqp://localhost ' , [], $ factory );
519
519
$ connection ->publish ('body ' , ['Foo ' => 'X ' ], 0 , new AmqpStamp (null , AMQP_NOPARAM , ['headers ' => ['Bar ' => 'Y ' ]]));
@@ -528,7 +528,7 @@ public function testAmqpStampDelireryModeIsUsed()
528
528
$ amqpExchange = $ this ->createMock (\AMQPExchange::class)
529
529
);
530
530
531
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 1 ]);
531
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 1 , ' timestamp ' => time () ]);
532
532
533
533
$ connection = Connection::fromDsn ('amqp://localhost ' , [], $ factory );
534
534
$ connection ->publish ('body ' , [], 0 , new AmqpStamp (null , AMQP_NOPARAM , ['delivery_mode ' => 1 ]));
@@ -600,7 +600,7 @@ public function testItDelaysTheMessageWithTheInitialSuppliedRoutingKeyAsArgument
600
600
$ delayQueue ->expects ($ this ->once ())->method ('declareQueue ' );
601
601
$ delayQueue ->expects ($ this ->once ())->method ('bind ' )->with ('delays ' , 'delay_messages_routing_key_120000 ' );
602
602
603
- $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages_routing_key_120000 ' , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 ]);
603
+ $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages_routing_key_120000 ' , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , ' timestamp ' => time () ]);
604
604
$ connection ->publish ('{} ' , [], 120000 , new AmqpStamp ('routing_key ' ));
605
605
}
606
606
@@ -617,7 +617,7 @@ public function testItCanPublishWithCustomFlagsAndAttributes()
617
617
'body ' ,
618
618
'routing_key ' ,
619
619
AMQP_IMMEDIATE ,
620
- ['delivery_mode ' => 2 , 'headers ' => ['type ' => DummyMessage::class]]
620
+ ['delivery_mode ' => 2 , 'headers ' => ['type ' => DummyMessage::class], ' timestamp ' => time () ]
621
621
);
622
622
623
623
$ connection = Connection::fromDsn ('amqp://localhost ' , [], $ factory );
0 commit comments