@@ -36,7 +36,8 @@ public function testItReturnsTheDecodedMessageToTheHandler()
3636
3737 $ amqpEnvelope = $ this ->createAMQPEnvelope ();
3838 $ connection = $ this ->getMockBuilder (Connection::class)->disableOriginalConstructor ()->getMock ();
39- $ connection ->method ('get ' )->willReturn ($ amqpEnvelope );
39+ $ connection ->method ('getQueueNames ' )->willReturn (['queueName ' ]);
40+ $ connection ->method ('get ' )->with ('queueName ' )->willReturn ($ amqpEnvelope );
4041
4142 $ receiver = new AmqpReceiver ($ connection , $ serializer );
4243 $ actualEnvelopes = iterator_to_array ($ receiver ->get ());
@@ -52,11 +53,12 @@ public function testItThrowsATransportExceptionIfItCannotAcknowledgeMessage()
5253 $ serializer = $ this ->createMock (SerializerInterface::class);
5354 $ amqpEnvelope = $ this ->createAMQPEnvelope ();
5455 $ connection = $ this ->getMockBuilder (Connection::class)->disableOriginalConstructor ()->getMock ();
55- $ connection ->method ('get ' )->willReturn ($ amqpEnvelope );
56- $ connection ->method ('ack ' )->with ($ amqpEnvelope )->willThrowException (new \AMQPException ());
56+ $ connection ->method ('getQueueNames ' )->willReturn (['queueName ' ]);
57+ $ connection ->method ('get ' )->with ('queueName ' )->willReturn ($ amqpEnvelope );
58+ $ connection ->method ('ack ' )->with ($ amqpEnvelope , 'queueName ' )->willThrowException (new \AMQPException ());
5759
5860 $ receiver = new AmqpReceiver ($ connection , $ serializer );
59- $ receiver ->ack (new Envelope (new \stdClass (), [new AmqpReceivedStamp ($ amqpEnvelope )]));
61+ $ receiver ->ack (new Envelope (new \stdClass (), [new AmqpReceivedStamp ($ amqpEnvelope, ' queueName ' )]));
6062 }
6163
6264 /**
@@ -67,11 +69,12 @@ public function testItThrowsATransportExceptionIfItCannotRejectMessage()
6769 $ serializer = $ this ->createMock (SerializerInterface::class);
6870 $ amqpEnvelope = $ this ->createAMQPEnvelope ();
6971 $ connection = $ this ->getMockBuilder (Connection::class)->disableOriginalConstructor ()->getMock ();
70- $ connection ->method ('get ' )->willReturn ($ amqpEnvelope );
71- $ connection ->method ('nack ' )->with ($ amqpEnvelope , AMQP_NOPARAM )->willThrowException (new \AMQPException ());
72+ $ connection ->method ('getQueueNames ' )->willReturn (['queueName ' ]);
73+ $ connection ->method ('get ' )->with ('queueName ' )->willReturn ($ amqpEnvelope );
74+ $ connection ->method ('nack ' )->with ($ amqpEnvelope , 'queueName ' , AMQP_NOPARAM )->willThrowException (new \AMQPException ());
7275
7376 $ receiver = new AmqpReceiver ($ connection , $ serializer );
74- $ receiver ->reject (new Envelope (new \stdClass (), [new AmqpReceivedStamp ($ amqpEnvelope )]));
77+ $ receiver ->reject (new Envelope (new \stdClass (), [new AmqpReceivedStamp ($ amqpEnvelope, ' queueName ' )]));
7578 }
7679
7780 private function createAMQPEnvelope ()
0 commit comments