@@ -607,7 +607,7 @@ public function testAddDataPostRequest()
607
607
type: 'post ' ,
608
608
uri: 'users ' ,
609
609
data: [
610
- 'users ' => [1 ,2 ],
610
+ 'users ' => [1 , 2 ],
611
611
'query ' => null ,
612
612
],
613
613
headers: [
@@ -620,6 +620,57 @@ public function testAddDataPostRequest()
620
620
$ service ->addData ($ request , $ response );
621
621
}
622
622
623
+ public function testAddDataGlobalPostRequest ()
624
+ {
625
+ $ this ->addGlobalPrefix ();
626
+
627
+ config (['auto-doc.security ' => 'jwt ' ]);
628
+
629
+ $ this ->mockDriverGetEmptyAndSaveTmpData ($ this ->getJsonFixture ('tmp_data_global_post_user_request ' ));
630
+
631
+ $ service = app (SwaggerService::class);
632
+
633
+ $ request = $ this ->generateRequest (
634
+ type: 'post ' ,
635
+ uri: '/global/users ' ,
636
+ data: [
637
+ 'users ' => [1 , 2 ],
638
+ 'query ' => null ,
639
+ ],
640
+ headers: ['authorization ' => 'Bearer some_token ' ],
641
+ );
642
+
643
+ $ response = $ this ->generateResponse ('example_success_users_post_response.json ' );
644
+
645
+ $ service ->addData ($ request , $ response );
646
+ }
647
+
648
+ public function testAddDataGlobalPostGlobalURIRequest ()
649
+ {
650
+ $ this ->addGlobalPrefix ();
651
+
652
+ config (['auto-doc.security ' => 'jwt ' ]);
653
+
654
+ $ this ->mockDriverGetEmptyAndSaveTmpData ($ this ->getJsonFixture ('tmp_data_global_post_global_uri_request ' ));
655
+
656
+ $ service = app (SwaggerService::class);
657
+
658
+ $ request = $ this ->generateRequest (
659
+ type: 'post ' ,
660
+ uri: '/global/global/ ' ,
661
+ data: [
662
+ 'users ' => [1 , 2 ],
663
+ 'query ' => null ,
664
+ ],
665
+ headers: [
666
+ 'authorization ' => 'Bearer some_token ' ,
667
+ ]);
668
+
669
+ $ response = $ this ->generateResponse ('example_success_users_post_response.json ' );
670
+
671
+ $ service ->addData ($ request , $ response );
672
+ }
673
+
623
674
public function testAddDataToEarlyGeneratedDoc ()
624
675
{
625
676
config (['auto-doc.security ' => 'jwt ' ]);
0 commit comments