File tree Expand file tree Collapse file tree 2 files changed +81
-35
lines changed
Process/Deploy/InstallUpdate/ConfigUpdate
Test/Unit/Process/Deploy/InstallUpdate/ConfigUpdate Expand file tree Collapse file tree 2 files changed +81
-35
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ public function execute()
73
73
$ config ['queue ' ]['amqp ' ]['port ' ] = $ amqpConfig ['port ' ];
74
74
$ config ['queue ' ]['amqp ' ]['user ' ] = $ amqpConfig ['username ' ];
75
75
$ config ['queue ' ]['amqp ' ]['password ' ] = $ amqpConfig ['password ' ];
76
- $ config ['queue ' ]['amqp ' ]['virtualhost ' ] = '/ ' ;
76
+ $ config ['queue ' ]['amqp ' ]['virtualhost ' ] = isset ( $ amqpConfig [ ' vhost ' ]) ? $ amqpConfig [ ' vhost ' ] : '/ ' ;
77
77
$ config ['queue ' ]['amqp ' ]['ssl ' ] = '' ;
78
78
} else {
79
79
$ config = $ this ->removeAmqpConfig ($ config );
Original file line number Diff line number Diff line change @@ -88,28 +88,8 @@ public function testExecuteWithoutAmqp()
88
88
* @return void
89
89
* @dataProvider executeAddUpdateDataProvider
90
90
*/
91
- public function testExecuteAddUpdate (array $ config )
91
+ public function testExecuteAddUpdate (array $ config, array $ amqpConfig , array $ resultConfig )
92
92
{
93
- $ amqpConfig = [[
94
- 'host ' => 'localhost ' ,
95
- 'port ' => '777 ' ,
96
- 'username ' => 'login ' ,
97
- 'password ' => 'pswd '
98
- ]];
99
- $ resultConfig = [
100
- 'some config ' ,
101
- 'queue ' => [
102
- 'amqp ' => [
103
- 'host ' => 'localhost ' ,
104
- 'port ' => '777 ' ,
105
- 'user ' => 'login ' ,
106
- 'password ' => 'pswd ' ,
107
- 'virtualhost ' => '/ ' ,
108
- 'ssl ' => '' ,
109
- ]
110
- ],
111
- ];
112
-
113
93
$ this ->environmentMock ->expects ($ this ->exactly (2 ))
114
94
->method ('getRelationship ' )
115
95
->withConsecutive (
@@ -139,20 +119,86 @@ public function testExecuteAddUpdate(array $config)
139
119
public function executeAddUpdateDataProvider (): array
140
120
{
141
121
return [
142
- [['some config ' ]],
143
- [[
144
- 'some config ' ,
145
- 'queue ' => [
146
- 'amqp ' => [
147
- 'host ' => 'some-host ' ,
148
- 'port ' => '888 ' ,
149
- 'user ' => 'mylogin ' ,
150
- 'password ' => 'mysqwwd ' ,
151
- 'virtualhost ' => 'virtualhost ' ,
152
- 'ssl ' => '1 ' ,
153
- ]
122
+ [
123
+ ['some config ' ],
124
+ [[
125
+ 'host ' => 'localhost ' ,
126
+ 'port ' => '777 ' ,
127
+ 'username ' => 'login ' ,
128
+ 'password ' => 'pswd ' ,
129
+ 'vhost ' => 'virtualhost '
130
+ ]],
131
+ [
132
+ 'some config ' ,
133
+ 'queue ' => [
134
+ 'amqp ' => [
135
+ 'host ' => 'localhost ' ,
136
+ 'port ' => '777 ' ,
137
+ 'user ' => 'login ' ,
138
+ 'password ' => 'pswd ' ,
139
+ 'virtualhost ' => 'virtualhost ' ,
140
+ 'ssl ' => '' ,
141
+ ]
142
+ ],
143
+ ]
144
+ ],
145
+ [
146
+ ['some config ' ],
147
+ [[
148
+ 'host ' => 'localhost ' ,
149
+ 'port ' => '777 ' ,
150
+ 'username ' => 'login ' ,
151
+ 'password ' => 'pswd ' ,
152
+ ]],
153
+ [
154
+ 'some config ' ,
155
+ 'queue ' => [
156
+ 'amqp ' => [
157
+ 'host ' => 'localhost ' ,
158
+ 'port ' => '777 ' ,
159
+ 'user ' => 'login ' ,
160
+ 'password ' => 'pswd ' ,
161
+ 'virtualhost ' => '/ ' ,
162
+ 'ssl ' => '' ,
163
+ ]
164
+ ],
165
+ ]
166
+ ],
167
+ [
168
+ [
169
+ 'some config ' ,
170
+ 'queue ' => [
171
+ 'amqp ' => [
172
+ 'host ' => 'some-host ' ,
173
+ 'port ' => '888 ' ,
174
+ 'user ' => 'mylogin ' ,
175
+ 'password ' => 'mysqwwd ' ,
176
+ 'virtualhost ' => 'virtualhost ' ,
177
+ 'ssl ' => '1 ' ,
178
+ ]
179
+ ],
154
180
],
155
- ]]
181
+ [[
182
+ 'host ' => 'localhost ' ,
183
+ 'port ' => '777 ' ,
184
+ 'username ' => 'login ' ,
185
+ 'password ' => 'pswd ' ,
186
+ 'vhost ' => 'virtualhost '
187
+ ]],
188
+ [
189
+ 'some config ' ,
190
+ 'queue ' => [
191
+ 'amqp ' => [
192
+ 'host ' => 'localhost ' ,
193
+ 'port ' => '777 ' ,
194
+ 'user ' => 'login ' ,
195
+ 'password ' => 'pswd ' ,
196
+ 'virtualhost ' => 'virtualhost ' ,
197
+ 'ssl ' => '' ,
198
+ ]
199
+ ],
200
+ ]
201
+ ]
156
202
];
157
203
}
158
204
You can’t perform that action at this time.
0 commit comments