@@ -268,7 +268,7 @@ public function testItSetupsTheConnectionWithDefaults()
268
268
);
269
269
270
270
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
271
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
271
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , \ AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
272
272
$ amqpQueue ->expects ($ this ->once ())->method ('declareQueue ' );
273
273
$ amqpQueue ->expects ($ this ->once ())->method ('bind ' )->with (self ::DEFAULT_EXCHANGE_NAME , null );
274
274
@@ -291,7 +291,7 @@ public function testItSetupsTheConnection()
291
291
$ factory ->method ('createQueue ' )->will ($ this ->onConsecutiveCalls ($ amqpQueue0 , $ amqpQueue1 ));
292
292
293
293
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
294
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
294
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , 'routing_key ' , \ AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
295
295
$ amqpQueue0 ->expects ($ this ->once ())->method ('declareQueue ' );
296
296
$ amqpQueue0 ->expects ($ this ->exactly (2 ))->method ('bind ' )->withConsecutive (
297
297
[self ::DEFAULT_EXCHANGE_NAME , 'binding_key0 ' ],
@@ -328,7 +328,7 @@ public function testBindingArguments()
328
328
$ factory ->method ('createQueue ' )->willReturn ($ amqpQueue );
329
329
330
330
$ amqpExchange ->expects ($ this ->once ())->method ('declareExchange ' );
331
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
331
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , \ AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
332
332
$ amqpQueue ->expects ($ this ->once ())->method ('declareQueue ' );
333
333
$ amqpQueue ->expects ($ this ->exactly (1 ))->method ('bind ' )->withConsecutive (
334
334
[self ::DEFAULT_EXCHANGE_NAME , null , ['x-match ' => 'all ' ]]
@@ -441,7 +441,7 @@ public function testItDelaysTheMessage()
441
441
$ delayQueue ->expects ($ this ->once ())->method ('declareQueue ' );
442
442
$ delayQueue ->expects ($ this ->once ())->method ('bind ' )->with ('delays ' , 'delay_messages__5000 ' );
443
443
444
- $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages__5000 ' , AMQP_NOPARAM , ['headers ' => ['x-some-headers ' => 'foo ' ], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
444
+ $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages__5000 ' , \ AMQP_NOPARAM , ['headers ' => ['x-some-headers ' => 'foo ' ], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
445
445
446
446
$ connection = Connection::fromDsn ('amqp://localhost ' , [], $ factory );
447
447
$ connection ->publish ('{} ' , ['x-some-headers ' => 'foo ' ], 5000 );
@@ -483,7 +483,7 @@ public function testItDelaysTheMessageWithADifferentRoutingKeyAndTTLs()
483
483
$ delayQueue ->expects ($ this ->once ())->method ('declareQueue ' );
484
484
$ delayQueue ->expects ($ this ->once ())->method ('bind ' )->with ('delays ' , 'delay_messages__120000 ' );
485
485
486
- $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages__120000 ' , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
486
+ $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages__120000 ' , \ AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
487
487
$ connection ->publish ('{} ' , [], 120000 );
488
488
}
489
489
@@ -515,10 +515,10 @@ public function testAmqpStampHeadersAreUsed()
515
515
$ amqpExchange = $ this ->createMock (\AMQPExchange::class)
516
516
);
517
517
518
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => ['Foo ' => 'X ' , 'Bar ' => 'Y ' ], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
518
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , \ AMQP_NOPARAM , ['headers ' => ['Foo ' => 'X ' , 'Bar ' => 'Y ' ], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
519
519
520
520
$ connection = Connection::fromDsn ('amqp://localhost ' , [], $ factory );
521
- $ connection ->publish ('body ' , ['Foo ' => 'X ' ], 0 , new AmqpStamp (null , AMQP_NOPARAM , ['headers ' => ['Bar ' => 'Y ' ]]));
521
+ $ connection ->publish ('body ' , ['Foo ' => 'X ' ], 0 , new AmqpStamp (null , \ AMQP_NOPARAM , ['headers ' => ['Bar ' => 'Y ' ]]));
522
522
}
523
523
524
524
public function testAmqpStampDelireryModeIsUsed ()
@@ -530,10 +530,10 @@ public function testAmqpStampDelireryModeIsUsed()
530
530
$ amqpExchange = $ this ->createMock (\AMQPExchange::class)
531
531
);
532
532
533
- $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 1 , 'timestamp ' => time ()]);
533
+ $ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with ('body ' , null , \ AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 1 , 'timestamp ' => time ()]);
534
534
535
535
$ connection = Connection::fromDsn ('amqp://localhost ' , [], $ factory );
536
- $ connection ->publish ('body ' , [], 0 , new AmqpStamp (null , AMQP_NOPARAM , ['delivery_mode ' => 1 ]));
536
+ $ connection ->publish ('body ' , [], 0 , new AmqpStamp (null , \ AMQP_NOPARAM , ['delivery_mode ' => 1 ]));
537
537
}
538
538
539
539
public function testItCanPublishWithTheDefaultRoutingKey ()
@@ -602,7 +602,7 @@ public function testItDelaysTheMessageWithTheInitialSuppliedRoutingKeyAsArgument
602
602
$ delayQueue ->expects ($ this ->once ())->method ('declareQueue ' );
603
603
$ delayQueue ->expects ($ this ->once ())->method ('bind ' )->with ('delays ' , 'delay_messages_routing_key_120000 ' );
604
604
605
- $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages_routing_key_120000 ' , AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
605
+ $ delayExchange ->expects ($ this ->once ())->method ('publish ' )->with ('{} ' , 'delay_messages_routing_key_120000 ' , \ AMQP_NOPARAM , ['headers ' => [], 'delivery_mode ' => 2 , 'timestamp ' => time ()]);
606
606
$ connection ->publish ('{} ' , [], 120000 , new AmqpStamp ('routing_key ' ));
607
607
}
608
608
@@ -618,12 +618,12 @@ public function testItCanPublishWithCustomFlagsAndAttributes()
618
618
$ amqpExchange ->expects ($ this ->once ())->method ('publish ' )->with (
619
619
'body ' ,
620
620
'routing_key ' ,
621
- AMQP_IMMEDIATE ,
621
+ \ AMQP_IMMEDIATE ,
622
622
['delivery_mode ' => 2 , 'headers ' => ['type ' => DummyMessage::class], 'timestamp ' => time ()]
623
623
);
624
624
625
625
$ connection = Connection::fromDsn ('amqp://localhost ' , [], $ factory );
626
- $ connection ->publish ('body ' , ['type ' => DummyMessage::class], 0 , new AmqpStamp ('routing_key ' , AMQP_IMMEDIATE , ['delivery_mode ' => 2 ]));
626
+ $ connection ->publish ('body ' , ['type ' => DummyMessage::class], 0 , new AmqpStamp ('routing_key ' , \ AMQP_IMMEDIATE , ['delivery_mode ' => 2 ]));
627
627
}
628
628
}
629
629
0 commit comments