@@ -36,7 +36,8 @@ public function testItReturnsTheDecodedMessageToTheHandler()
36
36
37
37
$ amqpEnvelope = $ this ->createAMQPEnvelope ();
38
38
$ 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 );
40
41
41
42
$ receiver = new AmqpReceiver ($ connection , $ serializer );
42
43
$ actualEnvelopes = iterator_to_array ($ receiver ->get ());
@@ -52,11 +53,12 @@ public function testItThrowsATransportExceptionIfItCannotAcknowledgeMessage()
52
53
$ serializer = $ this ->createMock (SerializerInterface::class);
53
54
$ amqpEnvelope = $ this ->createAMQPEnvelope ();
54
55
$ 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 ());
57
59
58
60
$ 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 ' )]));
60
62
}
61
63
62
64
/**
@@ -67,11 +69,12 @@ public function testItThrowsATransportExceptionIfItCannotRejectMessage()
67
69
$ serializer = $ this ->createMock (SerializerInterface::class);
68
70
$ amqpEnvelope = $ this ->createAMQPEnvelope ();
69
71
$ 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 ());
72
75
73
76
$ 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 ' )]));
75
78
}
76
79
77
80
private function createAMQPEnvelope ()
0 commit comments