@@ -91,19 +91,79 @@ public function testSetConnectionParametersWithUrl()
91
91
321 , // port
92
92
'bar_user ' , // user
93
93
'bar_password ' , // password
94
- '/ whost ' , // vhost
94
+ 'whost ' , // vhost
95
95
false , // insist
96
96
"AMQPLAIN " , // login method
97
97
null , // login response
98
98
"en_US " , // locale
99
99
6 , // connection timeout
100
100
6 , // read write timeout
101
101
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
103
133
0 , // heartbeat
104
134
), $ instance ->constructParams );
105
135
}
106
136
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
+
107
167
public function testSSLConnectionParameters ()
108
168
{
109
169
$ factory = new AMQPConnectionFactory (
0 commit comments