Skip to content

Commit c1fbbb9

Browse files
author
Ratko Rudic
committed
Fix tests.
Since queue_declare() needs to take AMQPTable object as the last param tests needed to be changed also. Unfortunatelly Mocking with real AMQPTable class wasn't doable so we're using any() parameter for it. Should be better tested if possible.
1 parent f1e6fe9 commit c1fbbb9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

tests/RabbitMQConnectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function test_connect()
2525
'durable' => true,
2626
'exclusive' => false,
2727
'auto_delete' => false,
28-
'arguments' => false,
28+
'arguments' => [],
2929
],
3030
'exchange_params' => [
3131
'name' => null,

tests/RabbitMQQueueTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use PhpAmqpLib\Channel\AMQPChannel;
55
use PhpAmqpLib\Connection\AMQPStreamConnection;
66
use PhpAmqpLib\Message\AMQPMessage;
7+
use PhpAmqpLib\Wire\AMQPTable;
78
use PHPUnit\Framework\TestCase;
89
use VladimirYuldashev\LaravelQueueRabbitMQ\Queue\RabbitMQQueue;
910

@@ -31,7 +32,7 @@ public function setUp()
3132
'durable' => true,
3233
'exclusive' => false,
3334
'auto_delete' => false,
34-
'arguments' => false,
35+
'arguments' => [],
3536
],
3637
'exchange_params' => [
3738
'name' => 'exchange_name',
@@ -83,7 +84,7 @@ public function test_push()
8384
$this->config['queue_params']['exclusive'],
8485
$this->config['queue_params']['auto_delete'],
8586
false,
86-
$this->config['queue_params']['arguments']
87+
Mockery::any()
8788
)->once();
8889

8990
$this->channel->shouldReceive('queue_bind')->with(
@@ -155,7 +156,7 @@ public function test_pop()
155156
$this->config['queue_params']['exclusive'],
156157
$this->config['queue_params']['auto_delete'],
157158
false,
158-
$this->config['queue_params']['arguments']
159+
Mockery::any()
159160
)->once();
160161

161162
$this->channel->shouldReceive('queue_bind')->with(

0 commit comments

Comments
 (0)