@@ -183,6 +183,46 @@ public function testUpdateBrancherApp()
183
183
);
184
184
}
185
185
186
+ public function testUpdateBrancherAppAppendsLabels ()
187
+ {
188
+ $ this ->responses ->append (
189
+ // List Brancher apps
190
+ new Response (200 , [], json_encode ([
191
+ 'branchers ' => [
192
+ [
193
+ 'name ' => 'johndoe-eph123456 ' ,
194
+ 'labels ' => ['key1 ' => 'value1 ' ]
195
+ ]
196
+ ]
197
+ ])),
198
+ // Update Brancher app
199
+ new Response (200 , [], json_encode ([
200
+ 'labels ' => [
201
+ 'key1 ' => 'value1 ' ,
202
+ 'key2 ' => 'value2 ' ,
203
+ ]
204
+ ])),
205
+ );
206
+
207
+ $ result = $ this ->client ->brancherApp ->update (
208
+ 'johndoe-eph123456 ' , ['labels ' => ['key2=value2 ' ]],
209
+ true
210
+ );
211
+
212
+ $ request = $ this ->responses ->getLastRequest ();
213
+ $ this ->assertEquals ('PUT ' , $ request ->getMethod ());
214
+ $ this ->assertEquals ('/v2/brancher/johndoe-eph123456/ ' , $ request ->getUri ());
215
+ $ this ->assertJson ((string )$ request ->getBody ());
216
+ $ this ->assertEquals (
217
+ ['labels ' => ['key2=value2 ' , 'key1=value1 ' ]],
218
+ json_decode ((string )$ request ->getBody (), true )
219
+ );
220
+ $ this ->assertEquals (
221
+ ['labels ' => [ 'key1 ' => 'value1 ' , 'key2 ' => 'value2 ' ]],
222
+ $ result
223
+ );
224
+ }
225
+
186
226
public function testUpdateBrancherAppRaisesClientExceptions ()
187
227
{
188
228
$ badRequestResponse = new Response (400 , [], json_encode ([
0 commit comments