Skip to content

Commit 11f6f4f

Browse files
committed
#348 update Channel mock to provide a channelId
1 parent 9a52d55 commit 11f6f4f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Tests/RabbitMq/BindingTest.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,21 @@ protected function prepareAMQPConnection()
2323
->getMock();
2424
}
2525

26-
protected function prepareAMQPChannel()
26+
protected function prepareAMQPChannel($channelId = null)
2727
{
28-
return $this->getMockBuilder('\PhpAmqpLib\Channel\AMQPChannel')
28+
$channelMock = $this->getMockBuilder('\PhpAmqpLib\Channel\AMQPChannel')
2929
->disableOriginalConstructor()
3030
->getMock();
31+
32+
$channelMock->expects($this->any())
33+
->method('getChannelId')
34+
->willReturn($channelId);
35+
return $channelMock;
3136
}
3237

3338
public function testQueueBind()
3439
{
35-
$ch = $this->prepareAMQPChannel();
40+
$ch = $this->prepareAMQPChannel('channel_id');
3641
$con = $this->prepareAMQPConnection();
3742

3843
$source = 'example_source';
@@ -57,7 +62,7 @@ public function testQueueBind()
5762

5863
public function testExhangeBind()
5964
{
60-
$ch = $this->prepareAMQPChannel();
65+
$ch = $this->prepareAMQPChannel('channel_id');
6166
$con = $this->prepareAMQPConnection();
6267

6368
$source = 'example_source';

0 commit comments

Comments
 (0)