File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
src/Symfony/Component/Messenger/Bridge/Amqp Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -884,7 +884,7 @@ public function testGettingDefaultExchange()
884
884
885
885
$ amqpExchange = $ this ->createMock (\AMQPExchange::class);
886
886
$ amqpExchange ->expects ($ this ->once ())->method ('setName ' )->with ('' );
887
- $ amqpExchange ->expects ($ this ->never ())->method ('setType ' );
887
+ $ amqpExchange ->expects ($ this ->once ())->method ('setType ' )-> with (\ AMQP_EX_TYPE_DIRECT );
888
888
$ amqpExchange ->expects ($ this ->never ())->method ('setFlags ' );
889
889
$ amqpExchange ->expects ($ this ->never ())->method ('setArguments ' );
890
890
Original file line number Diff line number Diff line change @@ -539,8 +539,9 @@ public function exchange(): \AMQPExchange
539
539
if (!isset ($ this ->amqpExchange )) {
540
540
$ this ->amqpExchange = $ this ->amqpFactory ->createExchange ($ this ->channel ());
541
541
$ this ->amqpExchange ->setName ($ this ->exchangeOptions ['name ' ]);
542
+ $ defaultExchangeType = '' !== $ this ->exchangeOptions ['name ' ] ? \AMQP_EX_TYPE_FANOUT : \AMQP_EX_TYPE_DIRECT ;
543
+ $ this ->amqpExchange ->setType ($ this ->exchangeOptions ['type ' ] ?? $ defaultExchangeType );
542
544
if ('' !== $ this ->exchangeOptions ['name ' ]) {
543
- $ this ->amqpExchange ->setType ($ this ->exchangeOptions ['type ' ] ?? \AMQP_EX_TYPE_FANOUT );
544
545
$ this ->amqpExchange ->setFlags ($ this ->exchangeOptions ['flags ' ] ?? \AMQP_DURABLE );
545
546
546
547
if (isset ($ this ->exchangeOptions ['arguments ' ])) {
You can’t perform that action at this time.
0 commit comments