@@ -47,7 +47,7 @@ protected function setUp(): void
47
47
*/
48
48
protected function getRequest (array $ options = []): MockCURLRequest
49
49
{
50
- $ uri = isset ($ options ['base_uri ' ]) ? new URI ($ options ['base_uri ' ]) : new URI ();
50
+ $ uri = isset ($ options ['baseURI ' ]) ? new URI ($ options ['baseURI ' ]) : new URI ();
51
51
$ app = new App ();
52
52
53
53
$ config = new ConfigCURLRequest ();
@@ -64,7 +64,7 @@ public function testPrepareURLIgnoresAppConfig(): void
64
64
{
65
65
config ('App ' )->baseURL = 'http://example.com/fruit/ ' ;
66
66
67
- $ request = $ this ->getRequest (['base_uri ' => 'http://example.com/v1/ ' ]);
67
+ $ request = $ this ->getRequest (['baseURI ' => 'http://example.com/v1/ ' ]);
68
68
69
69
$ method = $ this ->getPrivateMethodInvoker ($ request , 'prepareURL ' );
70
70
@@ -76,7 +76,7 @@ public function testPrepareURLIgnoresAppConfig(): void
76
76
*/
77
77
public function testGetRemembersBaseURI (): void
78
78
{
79
- $ request = $ this ->getRequest (['base_uri ' => 'http://www.foo.com/api/v1/ ' ]);
79
+ $ request = $ this ->getRequest (['baseURI ' => 'http://www.foo.com/api/v1/ ' ]);
80
80
81
81
$ request ->get ('products ' );
82
82
@@ -90,7 +90,7 @@ public function testGetRemembersBaseURI(): void
90
90
*/
91
91
public function testGetRemembersBaseURIWithHelperMethod (): void
92
92
{
93
- $ request = Services::curlrequest (['base_uri ' => 'http://www.foo.com/api/v1/ ' ]);
93
+ $ request = Services::curlrequest (['baseURI ' => 'http://www.foo.com/api/v1/ ' ]);
94
94
95
95
$ uri = $ this ->getPrivateProperty ($ request , 'baseURI ' );
96
96
$ this ->assertSame ('www.foo.com ' , $ uri ->getHost ());
@@ -157,28 +157,17 @@ public function testOptionsSetsCorrectMethod(): void
157
157
158
158
public function testOptionsBaseURIOption (): void
159
159
{
160
- $ options = ['base_uri ' => 'http://www.foo.com/api/v1/ ' ];
160
+ $ options = ['baseURI ' => 'http://www.foo.com/api/v1/ ' ];
161
161
$ request = $ this ->getRequest ($ options );
162
162
163
163
$ this ->assertSame ('http://www.foo.com/api/v1/ ' , $ request ->getBaseURI ()->__toString ());
164
164
}
165
165
166
- public function testOptionsBaseURIOverride (): void
167
- {
168
- $ options = [
169
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
170
- 'baseURI ' => 'http://bogus/com ' ,
171
- ];
172
- $ request = $ this ->getRequest ($ options );
173
-
174
- $ this ->assertSame ('http://bogus/com ' , $ request ->getBaseURI ()->__toString ());
175
- }
176
-
177
166
public function testOptionsHeaders (): void
178
167
{
179
168
$ options = [
180
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
181
- 'headers ' => ['fruit ' => 'apple ' ],
169
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
170
+ 'headers ' => ['fruit ' => 'apple ' ],
182
171
];
183
172
$ request = $ this ->getRequest ();
184
173
$ this ->assertNull ($ request ->header ('fruit ' ));
@@ -195,8 +184,8 @@ public function testOptionsHeadersNotUsingPopulate(): void
195
184
$ _SERVER ['HTTP_ACCEPT_ENCODING ' ] = 'gzip, deflate, br ' ;
196
185
197
186
$ options = [
198
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
199
- 'headers ' => [
187
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
188
+ 'headers ' => [
200
189
'Host ' => 'www.foo.com ' ,
201
190
'Accept-Encoding ' => '' ,
202
191
],
@@ -233,7 +222,7 @@ public function testDefaultOptionsAreSharedBetweenRequests(): void
233
222
public function testHeaderContentLengthNotSharedBetweenRequests (): void
234
223
{
235
224
$ options = [
236
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
225
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
237
226
];
238
227
$ request = $ this ->getRequest ($ options );
239
228
@@ -253,7 +242,7 @@ public function testHeaderContentLengthNotSharedBetweenClients(): void
253
242
$ _SERVER ['HTTP_CONTENT_LENGTH ' ] = '10 ' ;
254
243
255
244
$ options = [
256
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
245
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
257
246
];
258
247
$ request = $ this ->getRequest ($ options );
259
248
$ request ->post ('example ' , [
@@ -730,8 +719,8 @@ public function testAllowRedirectsArray(): void
730
719
public function testSendWithQuery (): void
731
720
{
732
721
$ request = $ this ->getRequest ([
733
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
734
- 'query ' => [
722
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
723
+ 'query ' => [
735
724
'name ' => 'Henry ' ,
736
725
'd.t ' => 'value ' ,
737
726
],
@@ -747,8 +736,8 @@ public function testSendWithQuery(): void
747
736
public function testSendWithDelay (): void
748
737
{
749
738
$ request = $ this ->getRequest ([
750
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
751
- 'delay ' => 100 ,
739
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
740
+ 'delay ' => 100 ,
752
741
]);
753
742
754
743
$ request ->get ('products ' );
@@ -760,8 +749,8 @@ public function testSendWithDelay(): void
760
749
public function testSendContinued (): void
761
750
{
762
751
$ request = $ this ->getRequest ([
763
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
764
- 'delay ' => 100 ,
752
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
753
+ 'delay ' => 100 ,
765
754
]);
766
755
767
756
$ request ->setOutput ("HTTP/1.1 100 Continue \x0d\x0a\x0d\x0aHi there " );
@@ -775,8 +764,8 @@ public function testSendContinued(): void
775
764
public function testSendContinuedWithManyHeaders (): void
776
765
{
777
766
$ request = $ this ->getRequest ([
778
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
779
- 'delay ' => 100 ,
767
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
768
+ 'delay ' => 100 ,
780
769
]);
781
770
782
771
$ output = "HTTP/1.1 100 Continue
@@ -819,8 +808,8 @@ public function testSendContinuedWithManyHeaders(): void
819
808
public function testSendProxied (): void
820
809
{
821
810
$ request = $ this ->getRequest ([
822
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
823
- 'delay ' => 100 ,
811
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
812
+ 'delay ' => 100 ,
824
813
]);
825
814
826
815
$ output = "HTTP/1.1 200 Connection established
@@ -834,8 +823,8 @@ public function testSendProxied(): void
834
823
public function testSendProxiedWithHTTP10 (): void
835
824
{
836
825
$ request = $ this ->getRequest ([
837
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
838
- 'delay ' => 100 ,
826
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
827
+ 'delay ' => 100 ,
839
828
]);
840
829
841
830
$ output = "HTTP/1.0 200 Connection established
@@ -852,7 +841,7 @@ public function testSendProxiedWithHTTP10(): void
852
841
public function testResponseHeadersWithMultipleRequests (): void
853
842
{
854
843
$ request = $ this ->getRequest ([
855
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
844
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
856
845
]);
857
846
858
847
$ output = "HTTP/2.0 200 OK
@@ -905,7 +894,7 @@ public function testResponseHeadersWithMultipleRequests(): void
905
894
public function testResponseHeadersWithMultipleSetCookies (): void
906
895
{
907
896
$ request = $ this ->getRequest ([
908
- 'base_uri ' => 'https://github.com/ ' ,
897
+ 'baseURI ' => 'https://github.com/ ' ,
909
898
]);
910
899
911
900
$ output = "HTTP/2 200
@@ -937,8 +926,8 @@ public function testResponseHeadersWithMultipleSetCookies(): void
937
926
public function testSplitResponse (): void
938
927
{
939
928
$ request = $ this ->getRequest ([
940
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
941
- 'delay ' => 100 ,
929
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
930
+ 'delay ' => 100 ,
942
931
]);
943
932
944
933
$ request ->setOutput ("Accept: text/html \x0d\x0a\x0d\x0aHi there " );
@@ -949,8 +938,8 @@ public function testSplitResponse(): void
949
938
public function testApplyBody (): void
950
939
{
951
940
$ request = $ this ->getRequest ([
952
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
953
- 'delay ' => 100 ,
941
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
942
+ 'delay ' => 100 ,
954
943
]);
955
944
956
945
$ request ->setBody ('name=George ' );
@@ -964,8 +953,8 @@ public function testApplyBody(): void
964
953
public function testApplyBodyByOptions (): void
965
954
{
966
955
$ request = $ this ->getRequest ([
967
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
968
- 'delay ' => 100 ,
956
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
957
+ 'delay ' => 100 ,
969
958
]);
970
959
971
960
$ request ->setOutput ('Hi there ' );
@@ -980,8 +969,8 @@ public function testApplyBodyByOptions(): void
980
969
public function testBodyIsResetOnSecondRequest (): void
981
970
{
982
971
$ request = $ this ->getRequest ([
983
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
984
- 'delay ' => 100 ,
972
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
973
+ 'delay ' => 100 ,
985
974
]);
986
975
$ request ->setBody ('name=George ' );
987
976
$ request ->setOutput ('Hi there ' );
@@ -995,8 +984,8 @@ public function testBodyIsResetOnSecondRequest(): void
995
984
public function testResponseHeaders (): void
996
985
{
997
986
$ request = $ this ->getRequest ([
998
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
999
- 'delay ' => 100 ,
987
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
988
+ 'delay ' => 100 ,
1000
989
]);
1001
990
1002
991
$ request ->setOutput ("HTTP/2.0 234 Ohoh \x0d\x0aAccept: text/html \x0d\x0a\x0d\x0aHi there " );
@@ -1009,8 +998,8 @@ public function testResponseHeaders(): void
1009
998
public function testResponseHeadersShortProtocol (): void
1010
999
{
1011
1000
$ request = $ this ->getRequest ([
1012
- 'base_uri ' => 'http://www.foo.com/api/v1/ ' ,
1013
- 'delay ' => 100 ,
1001
+ 'baseURI ' => 'http://www.foo.com/api/v1/ ' ,
1002
+ 'delay ' => 100 ,
1014
1003
]);
1015
1004
1016
1005
$ request ->setOutput ("HTTP/2 235 Ohoh \x0d\x0aAccept: text/html \x0d\x0a\x0d\x0aHi there shortie " );
0 commit comments