@@ -32,56 +32,56 @@ public function testItCannotBeConstructedWithAWrongDsn()
3232 public function testItGetsParametersFromTheDsn ()
3333 {
3434 $ this ->assertEquals (
35- new Connection (array (
35+ new Connection ([
3636 'host ' => 'localhost ' ,
3737 'port ' => 5672 ,
3838 'vhost ' => '/ ' ,
39- ), array (
39+ ], [
4040 'name ' => 'messages ' ,
41- ), array (
41+ ], [
4242 'name ' => 'messages ' ,
43- ) ),
43+ ] ),
4444 Connection::fromDsn ('amqp://localhost/%2f/messages ' )
4545 );
4646 }
4747
4848 public function testOverrideOptionsViaQueryParameters ()
4949 {
5050 $ this ->assertEquals (
51- new Connection (array (
51+ new Connection ([
5252 'host ' => 'redis ' ,
5353 'port ' => 1234 ,
5454 'vhost ' => '/ ' ,
5555 'login ' => 'guest ' ,
5656 'password ' => 'password ' ,
57- ), array (
57+ ], [
5858 'name ' => 'exchangeName ' ,
59- ), array (
59+ ], [
6060 'name ' => 'queue ' ,
61- ) ),
61+ ] ),
6262 Connection::fromDsn ('amqp://guest:password@redis:1234/%2f/queue?exchange[name]=exchangeName ' )
6363 );
6464 }
6565
6666 public function testOptionsAreTakenIntoAccountAndOverwrittenByDsn ()
6767 {
6868 $ this ->assertEquals (
69- new Connection (array (
69+ new Connection ([
7070 'host ' => 'redis ' ,
7171 'port ' => 1234 ,
7272 'vhost ' => '/ ' ,
7373 'login ' => 'guest ' ,
7474 'password ' => 'password ' ,
7575 'persistent ' => 'true ' ,
76- ), array (
76+ ], [
7777 'name ' => 'exchangeName ' ,
78- ), array (
78+ ], [
7979 'name ' => 'queueName ' ,
80- ) ),
81- Connection::fromDsn ('amqp://guest:password@redis:1234/%2f/queue?exchange[name]=exchangeName&queue[name]=queueName ' , array (
80+ ] ),
81+ Connection::fromDsn ('amqp://guest:password@redis:1234/%2f/queue?exchange[name]=exchangeName&queue[name]=queueName ' , [
8282 'persistent ' => 'true ' ,
83- 'exchange ' => array ( 'name ' => 'toBeOverwritten ' ) ,
84- ) )
83+ 'exchange ' => [ 'name ' => 'toBeOverwritten ' ] ,
84+ ] )
8585 );
8686 }
8787
@@ -94,27 +94,27 @@ public function testSetsParametersOnTheQueueAndExchange()
9494 $ amqpExchange = $ this ->getMockBuilder (\AMQPExchange::class)->disableOriginalConstructor ()->getMock ()
9595 );
9696
97- $ amqpQueue ->expects ($ this ->once ())->method ('setArguments ' )->with (array (
97+ $ amqpQueue ->expects ($ this ->once ())->method ('setArguments ' )->with ([
9898 'x-dead-letter-exchange ' => 'dead-exchange ' ,
9999 'x-message-ttl ' => '1200 ' ,
100- ) );
100+ ] );
101101
102- $ amqpExchange ->expects ($ this ->once ())->method ('setArguments ' )->with (array (
102+ $ amqpExchange ->expects ($ this ->once ())->method ('setArguments ' )->with ([
103103 'alternate-exchange ' => 'alternate ' ,
104- ) );
104+ ] );
105105
106- $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[arguments][x-dead-letter-exchange]=dead-exchange ' , array (
107- 'queue ' => array (
108- 'arguments ' => array (
106+ $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[arguments][x-dead-letter-exchange]=dead-exchange ' , [
107+ 'queue ' => [
108+ 'arguments ' => [
109109 'x-message-ttl ' => '1200 ' ,
110- ) ,
111- ) ,
112- 'exchange ' => array (
113- 'arguments ' => array (
110+ ] ,
111+ ] ,
112+ 'exchange ' => [
113+ 'arguments ' => [
114114 'alternate-exchange ' => 'alternate ' ,
115- ) ,
116- ) ,
117- ) , true , $ factory );
115+ ] ,
116+ ] ,
117+ ] , true , $ factory );
118118 $ connection ->publish ('body ' );
119119 }
120120
@@ -129,7 +129,7 @@ public function testItUsesANormalConnectionByDefault()
129129
130130 $ amqpConnection ->expects ($ this ->once ())->method ('connect ' );
131131
132- $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages ' , array () , false , $ factory );
132+ $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages ' , [] , false , $ factory );
133133 $ connection ->publish ('body ' );
134134 }
135135
@@ -144,7 +144,7 @@ public function testItAllowsToUseAPersistentConnection()
144144
145145 $ amqpConnection ->expects ($ this ->once ())->method ('pconnect ' );
146146
147- $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?persistent=true ' , array () , false , $ factory );
147+ $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?persistent=true ' , [] , false , $ factory );
148148 $ connection ->publish ('body ' );
149149 }
150150
@@ -162,7 +162,7 @@ public function testItSetupsTheConnectionWhenDebug()
162162 $ amqpQueue ->expects ($ this ->once ())->method ('declareQueue ' );
163163 $ amqpQueue ->expects ($ this ->once ())->method ('bind ' )->with ('exchange_name ' , 'my_key ' );
164164
165- $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[routing_key]=my_key ' , array () , true , $ factory );
165+ $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[routing_key]=my_key ' , [] , true , $ factory );
166166 $ connection ->publish ('body ' );
167167 }
168168
@@ -180,13 +180,13 @@ public function testItCanDisableTheSetup()
180180 $ amqpQueue ->expects ($ this ->never ())->method ('declareQueue ' );
181181 $ amqpQueue ->expects ($ this ->never ())->method ('bind ' );
182182
183- $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[routing_key]=my_key ' , array ( 'auto-setup ' => 'false ' ) , true , $ factory );
183+ $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[routing_key]=my_key ' , [ 'auto-setup ' => 'false ' ] , true , $ factory );
184184 $ connection ->publish ('body ' );
185185
186- $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[routing_key]=my_key ' , array ( 'auto-setup ' => false ) , true , $ factory );
186+ $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[routing_key]=my_key ' , [ 'auto-setup ' => false ] , true , $ factory );
187187 $ connection ->publish ('body ' );
188188
189- $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[routing_key]=my_key&auto-setup=false ' , array () , true , $ factory );
189+ $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages?queue[routing_key]=my_key&auto-setup=false ' , [] , true , $ factory );
190190 $ connection ->publish ('body ' );
191191 }
192192}
0 commit comments