@@ -32,56 +32,56 @@ public function testItCannotBeConstructedWithAWrongDsn()
32
32
public function testItGetsParametersFromTheDsn ()
33
33
{
34
34
$ this ->assertEquals (
35
- new Connection (array (
35
+ new Connection ([
36
36
'host ' => 'localhost ' ,
37
37
'port ' => 5672 ,
38
38
'vhost ' => '/ ' ,
39
- ), array (
39
+ ], [
40
40
'name ' => 'messages ' ,
41
- ), array (
41
+ ], [
42
42
'name ' => 'messages ' ,
43
- ) ),
43
+ ] ),
44
44
Connection::fromDsn ('amqp://localhost/%2f/messages ' )
45
45
);
46
46
}
47
47
48
48
public function testOverrideOptionsViaQueryParameters ()
49
49
{
50
50
$ this ->assertEquals (
51
- new Connection (array (
51
+ new Connection ([
52
52
'host ' => 'redis ' ,
53
53
'port ' => 1234 ,
54
54
'vhost ' => '/ ' ,
55
55
'login ' => 'guest ' ,
56
56
'password ' => 'password ' ,
57
- ), array (
57
+ ], [
58
58
'name ' => 'exchangeName ' ,
59
- ), array (
59
+ ], [
60
60
'name ' => 'queue ' ,
61
- ) ),
61
+ ] ),
62
62
Connection::fromDsn ('amqp://guest:password@redis:1234/%2f/queue?exchange[name]=exchangeName ' )
63
63
);
64
64
}
65
65
66
66
public function testOptionsAreTakenIntoAccountAndOverwrittenByDsn ()
67
67
{
68
68
$ this ->assertEquals (
69
- new Connection (array (
69
+ new Connection ([
70
70
'host ' => 'redis ' ,
71
71
'port ' => 1234 ,
72
72
'vhost ' => '/ ' ,
73
73
'login ' => 'guest ' ,
74
74
'password ' => 'password ' ,
75
75
'persistent ' => 'true ' ,
76
- ), array (
76
+ ], [
77
77
'name ' => 'exchangeName ' ,
78
- ), array (
78
+ ], [
79
79
'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 ' , [
82
82
'persistent ' => 'true ' ,
83
- 'exchange ' => array ( 'name ' => 'toBeOverwritten ' ) ,
84
- ) )
83
+ 'exchange ' => [ 'name ' => 'toBeOverwritten ' ] ,
84
+ ] )
85
85
);
86
86
}
87
87
@@ -94,27 +94,27 @@ public function testSetsParametersOnTheQueueAndExchange()
94
94
$ amqpExchange = $ this ->getMockBuilder (\AMQPExchange::class)->disableOriginalConstructor ()->getMock ()
95
95
);
96
96
97
- $ amqpQueue ->expects ($ this ->once ())->method ('setArguments ' )->with (array (
97
+ $ amqpQueue ->expects ($ this ->once ())->method ('setArguments ' )->with ([
98
98
'x-dead-letter-exchange ' => 'dead-exchange ' ,
99
99
'x-message-ttl ' => '1200 ' ,
100
- ) );
100
+ ] );
101
101
102
- $ amqpExchange ->expects ($ this ->once ())->method ('setArguments ' )->with (array (
102
+ $ amqpExchange ->expects ($ this ->once ())->method ('setArguments ' )->with ([
103
103
'alternate-exchange ' => 'alternate ' ,
104
- ) );
104
+ ] );
105
105
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 ' => [
109
109
'x-message-ttl ' => '1200 ' ,
110
- ) ,
111
- ) ,
112
- 'exchange ' => array (
113
- 'arguments ' => array (
110
+ ] ,
111
+ ] ,
112
+ 'exchange ' => [
113
+ 'arguments ' => [
114
114
'alternate-exchange ' => 'alternate ' ,
115
- ) ,
116
- ) ,
117
- ) , true , $ factory );
115
+ ] ,
116
+ ] ,
117
+ ] , true , $ factory );
118
118
$ connection ->publish ('body ' );
119
119
}
120
120
@@ -129,7 +129,7 @@ public function testItUsesANormalConnectionByDefault()
129
129
130
130
$ amqpConnection ->expects ($ this ->once ())->method ('connect ' );
131
131
132
- $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages ' , array () , false , $ factory );
132
+ $ connection = Connection::fromDsn ('amqp://localhost/%2f/messages ' , [] , false , $ factory );
133
133
$ connection ->publish ('body ' );
134
134
}
135
135
@@ -144,7 +144,7 @@ public function testItAllowsToUseAPersistentConnection()
144
144
145
145
$ amqpConnection ->expects ($ this ->once ())->method ('pconnect ' );
146
146
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 );
148
148
$ connection ->publish ('body ' );
149
149
}
150
150
@@ -162,7 +162,7 @@ public function testItSetupsTheConnectionWhenDebug()
162
162
$ amqpQueue ->expects ($ this ->once ())->method ('declareQueue ' );
163
163
$ amqpQueue ->expects ($ this ->once ())->method ('bind ' )->with ('exchange_name ' , 'my_key ' );
164
164
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 );
166
166
$ connection ->publish ('body ' );
167
167
}
168
168
@@ -180,13 +180,13 @@ public function testItCanDisableTheSetup()
180
180
$ amqpQueue ->expects ($ this ->never ())->method ('declareQueue ' );
181
181
$ amqpQueue ->expects ($ this ->never ())->method ('bind ' );
182
182
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 );
184
184
$ connection ->publish ('body ' );
185
185
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 );
187
187
$ connection ->publish ('body ' );
188
188
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 );
190
190
$ connection ->publish ('body ' );
191
191
}
192
192
}
0 commit comments