@@ -168,8 +168,8 @@ public function testOptions($uri, array $headers = [], array $data = [], array $
168
168
public function testSendRequest ($ uri , $ method , array $ headers = [], array $ data = [])
169
169
{
170
170
$ request = $ this ->httpAdapter ->getConfiguration ()->getMessageFactory ()->createRequest (
171
- $ uri ,
172
171
$ method ,
172
+ $ uri ,
173
173
RequestInterface::PROTOCOL_VERSION_1_1 ,
174
174
$ headers ,
175
175
http_build_query ($ data , null , '& ' )
@@ -190,8 +190,8 @@ public function testSendRequest($uri, $method, array $headers = [], array $data
190
190
public function testSendInternalRequest ($ uri , $ method , array $ headers = [], array $ data = [], array $ files = [])
191
191
{
192
192
$ request = $ this ->httpAdapter ->getConfiguration ()->getMessageFactory ()->createInternalRequest (
193
- $ uri ,
194
193
$ method ,
194
+ $ uri ,
195
195
RequestInterface::PROTOCOL_VERSION_1_1 ,
196
196
$ headers ,
197
197
$ data ,
@@ -219,7 +219,8 @@ public function testSendRequests()
219
219
*/
220
220
public function testSendErroredRequests ()
221
221
{
222
- list ($ requests , $ erroredRequests ) = $ this ->erroredRequestsProvider ();
222
+ $ requests = $ this ->requestsProvider ();
223
+ $ erroredRequests = $ this ->erroredRequestsProvider ();
223
224
224
225
try {
225
226
$ this ->httpAdapter ->sendRequests (array_merge ($ requests , $ erroredRequests ));
@@ -259,7 +260,7 @@ public function testSendWithProtocolVersion10()
259
260
);
260
261
261
262
$ this ->assertResponse (
262
- $ this ->httpAdapter ->send ($ this -> getUri (), $ method = RequestInterface::METHOD_GET ),
263
+ $ this ->httpAdapter ->send ($ method = RequestInterface::METHOD_GET , $ this -> getUri () ),
263
264
['protocol_version ' => $ protocolVersion ]
264
265
);
265
266
@@ -273,7 +274,7 @@ public function testSendWithUserAgent()
273
274
{
274
275
$ this ->httpAdapter ->getConfiguration ()->setUserAgent ($ userAgent = 'foo ' );
275
276
276
- $ this ->assertResponse ($ this ->httpAdapter ->send ($ this -> getUri (), $ method = RequestInterface::METHOD_GET ));
277
+ $ this ->assertResponse ($ this ->httpAdapter ->send ($ method = RequestInterface::METHOD_GET , $ this -> getUri () ));
277
278
$ this ->assertRequest ($ method , ['User-Agent ' => $ userAgent ]);
278
279
}
279
280
@@ -283,7 +284,7 @@ public function testSendWithUserAgent()
283
284
public function testSendWithClientError ()
284
285
{
285
286
$ this ->assertResponse (
286
- $ this ->httpAdapter ->send ($ uri = $ this ->getClientErrorUri (), $ method = RequestInterface:: METHOD_GET ),
287
+ $ this ->httpAdapter ->send ($ method = RequestInterface:: METHOD_GET , $ uri = $ this ->getClientErrorUri ()),
287
288
[
288
289
'status_code ' => 400 ,
289
290
'reason_phrase ' => 'Bad Request ' ,
@@ -299,7 +300,7 @@ public function testSendWithClientError()
299
300
public function testSendWithServerError ()
300
301
{
301
302
$ this ->assertResponse (
302
- $ this ->httpAdapter ->send ($ uri = $ this ->getServerErrorUri (), $ method = RequestInterface:: METHOD_GET ),
303
+ $ this ->httpAdapter ->send ($ method = RequestInterface:: METHOD_GET , $ uri = $ this ->getServerErrorUri ()),
303
304
[
304
305
'status_code ' => 500 ,
305
306
'reason_phrase ' => 'Internal Server Error ' ,
@@ -315,7 +316,7 @@ public function testSendWithServerError()
315
316
public function testSendWithRedirect ()
316
317
{
317
318
$ this ->assertResponse (
318
- $ this ->httpAdapter ->send ($ uri = $ this ->getRedirectUri (), $ method = RequestInterface:: METHOD_GET ),
319
+ $ this ->httpAdapter ->send ($ method = RequestInterface:: METHOD_GET , $ uri = $ this ->getRedirectUri ()),
319
320
[
320
321
'status_code ' => 302 ,
321
322
'reason_phrase ' => 'Found ' ,
@@ -332,7 +333,7 @@ public function testSendWithRedirect()
332
333
*/
333
334
public function testSendWithInvalidUri ()
334
335
{
335
- $ this ->httpAdapter ->send ($ this ->getInvalidUri (), RequestInterface:: METHOD_GET );
336
+ $ this ->httpAdapter ->send (RequestInterface:: METHOD_GET , $ this ->getInvalidUri ());
336
337
}
337
338
338
339
/**
@@ -343,7 +344,7 @@ public function testSendWithInvalidUri()
343
344
public function testSendWithTimeoutExceeded ($ timeout )
344
345
{
345
346
$ this ->httpAdapter ->getConfiguration ()->setTimeout ($ timeout );
346
- $ this ->httpAdapter ->send ($ this ->getDelayUri ($ timeout ), RequestInterface:: METHOD_GET );
347
+ $ this ->httpAdapter ->send (RequestInterface:: METHOD_GET , $ this ->getDelayUri ($ timeout ));
347
348
}
348
349
349
350
/**
@@ -457,12 +458,12 @@ public function internalRequestProvider()
457
458
*/
458
459
public function requestsProvider ()
459
460
{
460
- $ requests = [$ this ->getUri ()];
461
+ $ requests = [[RequestInterface:: METHOD_GET , $ this ->getUri ()] ];
461
462
462
463
foreach ($ this ->requestProvider () as $ request ) {
463
464
$ requests [] = [
464
- $ request [0 ],
465
465
$ request [1 ],
466
+ $ request [0 ],
466
467
RequestInterface::PROTOCOL_VERSION_1_1 ,
467
468
isset ($ request [2 ]) ? $ request [2 ] : [],
468
469
isset ($ request [3 ]) ? $ request [3 ] : [],
@@ -472,8 +473,8 @@ public function requestsProvider()
472
473
473
474
foreach ($ this ->requestProvider () as $ request ) {
474
475
$ requests [] = $ this ->httpAdapter ->getConfiguration ()->getMessageFactory ()->createRequest (
475
- $ request [0 ],
476
476
$ request [1 ],
477
+ $ request [0 ],
477
478
RequestInterface::PROTOCOL_VERSION_1_1 ,
478
479
isset ($ request [2 ]) ? $ request [2 ] : [],
479
480
http_build_query (isset ($ request [3 ]) ? $ request [3 ] : [], null , '& ' )
@@ -482,8 +483,8 @@ public function requestsProvider()
482
483
483
484
foreach ($ this ->requestProvider () as $ request ) {
484
485
$ requests [] = $ this ->httpAdapter ->getConfiguration ()->getMessageFactory ()->createInternalRequest (
485
- $ request [0 ],
486
486
$ request [1 ],
487
+ $ request [0 ],
487
488
RequestInterface::PROTOCOL_VERSION_1_1 ,
488
489
isset ($ request [2 ]) ? $ request [2 ] : [],
489
490
isset ($ request [3 ]) ? $ request [3 ] : [],
@@ -499,10 +500,7 @@ public function requestsProvider()
499
500
*/
500
501
public function erroredRequestsProvider ()
501
502
{
502
- return [
503
- $ this ->requestsProvider (),
504
- [$ this ->getInvalidUri ()],
505
- ];
503
+ return [[RequestInterface::METHOD_GET , $ this ->getInvalidUri ()]];
506
504
}
507
505
508
506
/**
@@ -581,7 +579,7 @@ protected function assertRequest(
581
579
582
580
$ defaultHeaders = [
583
581
'Connection ' => 'close ' ,
584
- 'User-Agent ' => 'Php Http Adapter ' ,
582
+ 'User-Agent ' => 'PHP Http Adapter ' ,
585
583
];
586
584
587
585
$ headers = array_merge ($ defaultHeaders , $ headers );
0 commit comments