@@ -95,9 +95,7 @@ public function testUserAgent()
95
95
public function testGet ()
96
96
{
97
97
$ test = new Test ();
98
- $ this ->assertEquals ('GET ' , $ test ->server ('server ' , 'GET ' , array (
99
- 'key ' => 'REQUEST_METHOD ' ,
100
- )));
98
+ $ this ->assertEquals ('GET ' , $ test ->server ('request_method ' , 'GET ' ));
101
99
}
102
100
103
101
public function testUrl ()
@@ -155,7 +153,7 @@ public function testSetUrlInConstructor()
155
153
$ curl ->setHeader ('X-DEBUG-TEST ' , 'delete_with_body ' );
156
154
$ curl ->delete ($ data , array ('wibble ' => 'wubble ' ));
157
155
$ this ->assertEquals (Test::TEST_URL , $ curl ->base_url );
158
- $ this ->assertEquals ('{"get":{"key":"value"},"post ":{"wibble":"wubble"}} ' , $ curl ->raw_response );
156
+ $ this ->assertEquals ('{"get":{"key":"value"},"delete ":{"wibble":"wubble"}} ' , $ curl ->raw_response );
159
157
160
158
$ curl = new Curl (Test::TEST_URL );
161
159
$ curl ->setHeader ('X-DEBUG-TEST ' , 'get ' );
@@ -257,9 +255,7 @@ public function testSetUrl()
257
255
public function testPostRequestMethod ()
258
256
{
259
257
$ test = new Test ();
260
- $ this ->assertEquals ('POST ' , $ test ->server ('server ' , 'POST ' , array (
261
- 'key ' => 'REQUEST_METHOD ' ,
262
- )));
258
+ $ this ->assertEquals ('POST ' , $ test ->server ('request_method ' , 'POST ' ));
263
259
}
264
260
265
261
public function testPostContinueResponseHeader ()
@@ -413,40 +409,31 @@ public function testPatchRequestMethod()
413
409
$ this ->assertEquals ('PATCH ' , $ test ->server ('request_method ' , 'PATCH ' ));
414
410
}
415
411
416
- public function testDelete ()
412
+ public function testDeleteRequestMethod ()
417
413
{
418
414
$ test = new Test ();
419
- $ this ->assertEquals ('DELETE ' , $ test ->server ('server ' , 'DELETE ' , array (
420
- 'key ' => 'REQUEST_METHOD ' ,
421
- )));
422
-
423
- $ test = new Test ();
424
- $ this ->assertEquals ('delete ' , $ test ->server ('delete ' , 'DELETE ' , array (
425
- 'test ' => 'delete ' ,
426
- 'key ' => 'test ' ,
427
- )));
415
+ $ this ->assertEquals ('DELETE ' , $ test ->server ('request_method ' , 'DELETE ' ));
416
+ }
428
417
418
+ public function testDeleteRequestBody ()
419
+ {
429
420
$ test = new Test ();
430
421
$ test ->server ('delete_with_body ' , 'DELETE ' , array ('foo ' => 'bar ' ), array ('wibble ' => 'wubble ' ));
431
- $ this ->assertEquals ('{"get":{"foo":"bar"},"post ":{"wibble":"wubble"}} ' , $ test ->curl ->raw_response );
422
+ $ this ->assertEquals ('{"get":{"foo":"bar"},"delete ":{"wibble":"wubble"}} ' , $ test ->curl ->raw_response );
432
423
}
433
424
434
425
public function testHeadRequestMethod ()
435
426
{
436
427
$ test = new Test ();
437
- $ test ->server ('request_method ' , 'HEAD ' , array (
438
- 'key ' => 'REQUEST_METHOD ' ,
439
- ));
428
+ $ test ->server ('request_method ' , 'HEAD ' );
440
429
$ this ->assertEquals ('HEAD ' , $ test ->curl ->response_headers ['X-REQUEST-METHOD ' ]);
441
430
$ this ->assertEmpty ($ test ->curl ->response );
442
431
}
443
432
444
433
public function testOptionsRequestMethod ()
445
434
{
446
435
$ test = new Test ();
447
- $ test ->server ('request_method ' , 'OPTIONS ' , array (
448
- 'key ' => 'REQUEST_METHOD ' ,
449
- ));
436
+ $ test ->server ('request_method ' , 'OPTIONS ' );
450
437
$ this ->assertEquals ('OPTIONS ' , $ test ->curl ->response_headers ['X-REQUEST-METHOD ' ]);
451
438
}
452
439
@@ -476,9 +463,7 @@ public function testDownload()
476
463
$ this ->assertEquals (md5_file ($ upload_file_path ), $ download_test ->curl ->response_headers ['ETag ' ]);
477
464
478
465
// Ensure successive requests set the appropriate values.
479
- $ this ->assertEquals ('GET ' , $ download_test ->server ('server ' , 'GET ' , array (
480
- 'key ' => 'REQUEST_METHOD ' ,
481
- )));
466
+ $ this ->assertEquals ('GET ' , $ download_test ->server ('request_method ' , 'GET ' ));
482
467
$ this ->assertFalse (is_bool ($ download_test ->curl ->response ));
483
468
$ this ->assertFalse (is_bool ($ download_test ->curl ->raw_response ));
484
469
@@ -549,6 +534,12 @@ public function testBasicHttpAuth()
549
534
550
535
public function testDigestHttpAuth ()
551
536
{
537
+ // Skip Digest Access Authentication test on HHVM.
538
+ // https://github.com/facebook/hhvm/issues/5201
539
+ if (defined ('HHVM_VERSION ' )) {
540
+ return ;
541
+ }
542
+
552
543
$ username = 'myusername ' ;
553
544
$ password = 'mypassword ' ;
554
545
$ invalid_password = 'anotherpassword ' ;
0 commit comments