@@ -392,6 +392,74 @@ public function testDeleteWorkLogWithCustomParams()
392
392
$ this ->assertEquals (json_decode ($ response , true ), $ actual , 'The response is json-decoded. ' );
393
393
}
394
394
395
+ public function testQueryParametersHandlingForGetRequestMethod ()
396
+ {
397
+ $ this ->expectClientCall (
398
+ Api::REQUEST_GET ,
399
+ '/rest/api/2/something ' ,
400
+ array (
401
+ 'q_p1 ' => 'q_p1_v ' ,
402
+ 'q_p2 ' => 'q_p2_v ' ,
403
+ 'rb_p1 ' => 'rb_p1_v ' ,
404
+ 'rb_p2 ' => 'rb_p2_v ' ,
405
+ 'rb_p3 ' => 'rb_p3_v ' ,
406
+ ),
407
+ '{} '
408
+ );
409
+
410
+ $ this ->api ->api (
411
+ Api::REQUEST_GET ,
412
+ '/rest/api/2/something ' ,
413
+ array (
414
+ '_query ' => array ('q_p1 ' => 'q_p1_v ' , 'q_p2 ' => 'q_p2_v ' ),
415
+ 'rb_p1 ' => 'rb_p1_v ' ,
416
+ 'rb_p2 ' => 'rb_p2_v ' ,
417
+ 'rb_p3 ' => 'rb_p3_v ' ,
418
+ ),
419
+ true
420
+ );
421
+ }
422
+
423
+ /**
424
+ * @dataProvider queryParametersHandlingForOtherRequestMethodsDataProvider
425
+ *
426
+ * @param string $request_method Request method.
427
+ */
428
+ public function testQueryParametersHandlingForOtherRequestMethods ($ request_method )
429
+ {
430
+ $ this ->expectClientCall (
431
+ $ request_method ,
432
+ '/rest/api/2/something?q_p1=q_p1_v&q_p2=q_p2_v ' ,
433
+ array (
434
+ 'rb_p1 ' => 'rb_p1_v ' ,
435
+ 'rb_p2 ' => 'rb_p2_v ' ,
436
+ 'rb_p3 ' => 'rb_p3_v ' ,
437
+ ),
438
+ '{} '
439
+ );
440
+
441
+ $ this ->api ->api (
442
+ $ request_method ,
443
+ '/rest/api/2/something ' ,
444
+ array (
445
+ '_query ' => array ('q_p1 ' => 'q_p1_v ' , 'q_p2 ' => 'q_p2_v ' ),
446
+ 'rb_p1 ' => 'rb_p1_v ' ,
447
+ 'rb_p2 ' => 'rb_p2_v ' ,
448
+ 'rb_p3 ' => 'rb_p3_v ' ,
449
+ ),
450
+ true
451
+ );
452
+ }
453
+
454
+ public static function queryParametersHandlingForOtherRequestMethodsDataProvider ()
455
+ {
456
+ return array (
457
+ 'delete ' => array (Api::REQUEST_DELETE ),
458
+ 'post ' => array (Api::REQUEST_POST ),
459
+ 'put ' => array (Api::REQUEST_PUT ),
460
+ );
461
+ }
462
+
395
463
/**
396
464
* Expects a particular client call.
397
465
*
0 commit comments