@@ -91,19 +91,79 @@ public function testSetConnectionParametersWithUrl()
9191 321 , // port
9292 'bar_user ' , // user
9393 'bar_password ' , // password
94- '/ whost ' , // vhost
94+ 'whost ' , // vhost
9595 false , // insist
9696 "AMQPLAIN " , // login method
9797 null , // login response
9898 "en_US " , // locale
9999 6 , // connection timeout
100100 6 , // read write timeout
101101 null , // context
102- true , // keepalive
102+ true , // keepalive
103+ 0 , // heartbeat
104+ ), $ instance ->constructParams );
105+ }
106+
107+ public function testSetConnectionParametersWithUrlEncoded ()
108+ {
109+ $ factory = new AMQPConnectionFactory (
110+ 'OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection ' ,
111+ array (
112+ 'url ' => 'amqp://user%61:%61pass@ho%61st:10000/v%2fhost?keepalive=1&connection_timeout=6&read_write_timeout=6 ' ,
113+ )
114+ );
115+
116+ /** @var AMQPConnection $instance */
117+ $ instance = $ factory ->createConnection ();
118+ $ this ->assertInstanceOf ('OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection ' , $ instance );
119+ $ this ->assertEquals (array (
120+ 'hoast ' , // host
121+ 10000 , // port
122+ 'usera ' , // user
123+ 'apass ' , // password
124+ 'v/host ' , // vhost
125+ false , // insist
126+ "AMQPLAIN " , // login method
127+ null , // login response
128+ "en_US " , // locale
129+ 6 , // connection timeout
130+ 6 , // read write timeout
131+ null , // context
132+ true , // keepalive
103133 0 , // heartbeat
104134 ), $ instance ->constructParams );
105135 }
106136
137+ public function testSetConnectionParametersWithUrlWithoutVhost ()
138+ {
139+ $ factory = new AMQPConnectionFactory (
140+ 'OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection ' ,
141+ array (
142+ 'url ' => 'amqp://user:pass@host:321/?keepalive=1&connection_timeout=6&read_write_timeout=6 ' ,
143+ )
144+ );
145+
146+ /** @var AMQPConnection $instance */
147+ $ instance = $ factory ->createConnection ();
148+ $ this ->assertInstanceOf ('OldSound\RabbitMqBundle\Tests\RabbitMq\Fixtures\AMQPConnection ' , $ instance );
149+ $ this ->assertEquals (array (
150+ 'host ' , // host
151+ 321 , // port
152+ 'user ' , // user
153+ 'pass ' , // password
154+ '' , // vhost
155+ false , // insist
156+ "AMQPLAIN " , // login method
157+ null , // login response
158+ "en_US " , // locale
159+ 6 , // connection timeout
160+ 6 , // read write timeout
161+ null , // context
162+ true , // keepalive
163+ 0 , // heartbeat
164+ ), $ instance ->constructParams );
165+ }
166+
107167 public function testSSLConnectionParameters ()
108168 {
109169 $ factory = new AMQPConnectionFactory (
0 commit comments