From f802a0e40205241e22a987841f31a46182b600eb Mon Sep 17 00:00:00 2001 From: Odd-Arne Johansen Date: Mon, 4 Feb 2019 11:24:05 +0100 Subject: [PATCH] Added tests for default and custom vhost configuration --- tests/ConnectionTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/ConnectionTest.php b/tests/ConnectionTest.php index 0cc3ddc..dfa8f3d 100644 --- a/tests/ConnectionTest.php +++ b/tests/ConnectionTest.php @@ -66,6 +66,7 @@ public function test_set_default_configurations_values() $this->assertAttributeEquals(15, 'heartbeat', $connection); $this->assertAttributeEquals(30, 'readWriteTimeout', $connection); $this->assertAttributeEquals(30, 'connectionTimeout', $connection); + $this->assertAttributeEquals('/', 'vhost', $connection); } public function test_set_altered_configurations_values() @@ -75,6 +76,7 @@ public function test_set_altered_configurations_values() Config::set('queue.connections.rabbitmq.read_write_timeout', 60); Config::set('queue.connections.rabbitmq.connection_timeout', 60); Config::set('queue.connections.rabbitmq.heartbeat', 30); + Config::set('queue.connections.rabbitmq.vhost', '/test-vhost'); $mAMQPStreamConnection = M::mock(AMQPStreamConnection::class); $this->app->bind(AMQPStreamConnection::class, function () use ($mAMQPStreamConnection) { @@ -85,11 +87,12 @@ public function test_set_altered_configurations_values() $mAMQPStreamConnection->shouldReceive('channel')->once()->withNoArgs()->andReturn($mChannel); $mAMQPStreamConnection->shouldReceive('close')->once()->withNoArgs(); $mChannel->shouldReceive('close')->once()->withNoArgs(); - + $connection = $this->app[Connection::class]; $this->assertAttributeEquals(30, 'heartbeat', $connection); $this->assertAttributeEquals(60, 'readWriteTimeout', $connection); $this->assertAttributeEquals(60, 'connectionTimeout', $connection); + $this->assertAttributeEquals('/test-vhost', 'vhost', $connection); } }