File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public function __construct(
3636 $ this ->connection = $ connection ;
3737 $ this ->consumer = $ consumer ;
3838 $ this ->message = $ message ;
39+ $ this ->queue = $ consumer ->getQueue ()->getQueueName ();
3940 }
4041
4142 /**
Original file line number Diff line number Diff line change 88use Illuminate \Queue \Jobs \Job ;
99use Interop \Amqp \AmqpConsumer ;
1010use Interop \Amqp \Impl \AmqpMessage ;
11+ use Interop \Amqp \Impl \AmqpQueue ;
1112use PHPUnit \Framework \TestCase ;
1213use VladimirYuldashev \LaravelQueueRabbitMQ \Queue \Jobs \RabbitMQJob ;
1314use VladimirYuldashev \LaravelQueueRabbitMQ \Queue \RabbitMQQueue ;
@@ -48,9 +49,18 @@ public function testCouldBeConstructedWithExpectedArguments()
4849 /**
4950 * @return AmqpConsumer|\PHPUnit_Framework_MockObject_MockObject|AmqpConsumer
5051 */
51- private function createConsumerMock ()
52+ private function createConsumerMock (string $ queueName = ' test ' )
5253 {
53- return $ this ->createMock (AmqpConsumer::class);
54+ $ mock = $ this ->createMock (AmqpConsumer::class);
55+
56+ if (!$ queueName !== '' )
57+ {
58+ $ mock ->expects ($ this ->once ())
59+ ->method ('getQueue ' )
60+ ->willReturn (new AmqpQueue ($ queueName ));
61+ }
62+
63+ return $ mock ;
5464 }
5565
5666 /**
You can’t perform that action at this time.
0 commit comments