From 3ab6908352ac8c9c4efa31ca7f1a6fb1d14e4bac Mon Sep 17 00:00:00 2001 From: Olivier Laurendeau Date: Mon, 10 Oct 2016 10:22:49 +0200 Subject: [PATCH] If port is not defined, default to 80 --- DependencyInjection/OlaRabbitMqAdminToolkitExtension.php | 2 +- .../OlaRabbitMqAdminToolkitExtensionTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/OlaRabbitMqAdminToolkitExtension.php b/DependencyInjection/OlaRabbitMqAdminToolkitExtension.php index 8edae11..c126134 100644 --- a/DependencyInjection/OlaRabbitMqAdminToolkitExtension.php +++ b/DependencyInjection/OlaRabbitMqAdminToolkitExtension.php @@ -50,7 +50,7 @@ private function loadConnections(array $connections, ContainerBuilder $container $definition = new Definition('RabbitMq\ManagementApi\Client', array( null, - sprintf("%s://%s:%s", $parsedUri['scheme'], $parsedUri['host'], $parsedUri['port']), + sprintf("%s://%s:%s", $parsedUri['scheme'], $parsedUri['host'], isset($parsedUri['port']) ? $parsedUri['port'] : 80), $parsedUri['user'], $parsedUri['pass'] )); diff --git a/Tests/DependencyInjection/OlaRabbitMqAdminToolkitExtensionTest.php b/Tests/DependencyInjection/OlaRabbitMqAdminToolkitExtensionTest.php index e3937e1..194b9d6 100644 --- a/Tests/DependencyInjection/OlaRabbitMqAdminToolkitExtensionTest.php +++ b/Tests/DependencyInjection/OlaRabbitMqAdminToolkitExtensionTest.php @@ -19,7 +19,7 @@ public function test_load_successfull() $this->load(array( 'delete_allowed' => true, 'connections' => array( - 'default' => 'http://user:password@localhost:15672', + 'default' => 'http://user:password@localhost', ), 'vhosts' => array( 'test' => array(