@@ -495,6 +495,74 @@ public function testDeleteWorkLogWithCustomParams()
495
495
$ this ->assertEquals (json_decode ($ response , true ), $ actual , 'The response is json-decoded. ' );
496
496
}
497
497
498
+ public function testQueryParametersHandlingForGetRequestMethod ()
499
+ {
500
+ $ this ->expectClientCall (
501
+ Api::REQUEST_GET ,
502
+ '/rest/api/2/something ' ,
503
+ array (
504
+ 'q_p1 ' => 'q_p1_v ' ,
505
+ 'q_p2 ' => 'q_p2_v ' ,
506
+ 'rb_p1 ' => 'rb_p1_v ' ,
507
+ 'rb_p2 ' => 'rb_p2_v ' ,
508
+ 'rb_p3 ' => 'rb_p3_v ' ,
509
+ ),
510
+ '{} '
511
+ );
512
+
513
+ $ this ->api ->api (
514
+ Api::REQUEST_GET ,
515
+ '/rest/api/2/something ' ,
516
+ array (
517
+ '_query ' => array ('q_p1 ' => 'q_p1_v ' , 'q_p2 ' => 'q_p2_v ' ),
518
+ 'rb_p1 ' => 'rb_p1_v ' ,
519
+ 'rb_p2 ' => 'rb_p2_v ' ,
520
+ 'rb_p3 ' => 'rb_p3_v ' ,
521
+ ),
522
+ true
523
+ );
524
+ }
525
+
526
+ /**
527
+ * @dataProvider queryParametersHandlingForOtherRequestMethodsDataProvider
528
+ *
529
+ * @param string $request_method Request method.
530
+ */
531
+ public function testQueryParametersHandlingForOtherRequestMethods ($ request_method )
532
+ {
533
+ $ this ->expectClientCall (
534
+ $ request_method ,
535
+ '/rest/api/2/something?q_p1=q_p1_v&q_p2=q_p2_v ' ,
536
+ array (
537
+ 'rb_p1 ' => 'rb_p1_v ' ,
538
+ 'rb_p2 ' => 'rb_p2_v ' ,
539
+ 'rb_p3 ' => 'rb_p3_v ' ,
540
+ ),
541
+ '{} '
542
+ );
543
+
544
+ $ this ->api ->api (
545
+ $ request_method ,
546
+ '/rest/api/2/something ' ,
547
+ array (
548
+ '_query ' => array ('q_p1 ' => 'q_p1_v ' , 'q_p2 ' => 'q_p2_v ' ),
549
+ 'rb_p1 ' => 'rb_p1_v ' ,
550
+ 'rb_p2 ' => 'rb_p2_v ' ,
551
+ 'rb_p3 ' => 'rb_p3_v ' ,
552
+ ),
553
+ true
554
+ );
555
+ }
556
+
557
+ public static function queryParametersHandlingForOtherRequestMethodsDataProvider ()
558
+ {
559
+ return array (
560
+ 'delete ' => array (Api::REQUEST_DELETE ),
561
+ 'post ' => array (Api::REQUEST_POST ),
562
+ 'put ' => array (Api::REQUEST_PUT ),
563
+ );
564
+ }
565
+
498
566
/**
499
567
* Expects a particular client call.
500
568
*
0 commit comments