@@ -192,6 +192,23 @@ public function testDelete() {
192
192
)) === 'delete ' );
193
193
}
194
194
195
+ public function testHeadRequestMethod () {
196
+ $ test = new Test ();
197
+ $ test ->server ('request_method ' , 'HEAD ' , array (
198
+ 'key ' => 'REQUEST_METHOD ' ,
199
+ ));
200
+ $ this ->assertEquals ($ test ->curl ->response_headers ['X-REQUEST-METHOD ' ], 'HEAD ' );
201
+ $ this ->assertEmpty ($ test ->curl ->response );
202
+ }
203
+
204
+ public function testOptionsRequestMethod () {
205
+ $ test = new Test ();
206
+ $ test ->server ('request_method ' , 'OPTIONS ' , array (
207
+ 'key ' => 'REQUEST_METHOD ' ,
208
+ ));
209
+ $ this ->assertEquals ($ test ->curl ->response_headers ['X-REQUEST-METHOD ' ], 'OPTIONS ' );
210
+ }
211
+
195
212
public function testBasicHttpAuth401Unauthorized () {
196
213
$ test = new Test ();
197
214
$ this ->assertTrue ($ test ->server ('http_basic_auth ' , 'GET ' ) === 'canceled ' );
@@ -638,6 +655,8 @@ public function testRequestMethodSuccessiveGetRequests() {
638
655
test ($ test , 'GET ' , 'PUT ' );
639
656
test ($ test , 'GET ' , 'PATCH ' );
640
657
test ($ test , 'GET ' , 'DELETE ' );
658
+ test ($ test , 'GET ' , 'HEAD ' );
659
+ test ($ test , 'GET ' , 'OPTIONS ' );
641
660
}
642
661
643
662
public function testRequestMethodSuccessivePostRequests () {
@@ -646,6 +665,8 @@ public function testRequestMethodSuccessivePostRequests() {
646
665
test ($ test , 'POST ' , 'PUT ' );
647
666
test ($ test , 'POST ' , 'PATCH ' );
648
667
test ($ test , 'POST ' , 'DELETE ' );
668
+ test ($ test , 'POST ' , 'HEAD ' );
669
+ test ($ test , 'POST ' , 'OPTIONS ' );
649
670
}
650
671
651
672
public function testRequestMethodSuccessivePutRequests () {
@@ -654,6 +675,8 @@ public function testRequestMethodSuccessivePutRequests() {
654
675
test ($ test , 'PUT ' , 'POST ' );
655
676
test ($ test , 'PUT ' , 'PATCH ' );
656
677
test ($ test , 'PUT ' , 'DELETE ' );
678
+ test ($ test , 'PUT ' , 'HEAD ' );
679
+ test ($ test , 'PUT ' , 'OPTIONS ' );
657
680
}
658
681
659
682
public function testRequestMethodSuccessivePatchRequests () {
@@ -662,6 +685,8 @@ public function testRequestMethodSuccessivePatchRequests() {
662
685
test ($ test , 'PATCH ' , 'POST ' );
663
686
test ($ test , 'PATCH ' , 'PUT ' );
664
687
test ($ test , 'PATCH ' , 'DELETE ' );
688
+ test ($ test , 'PATCH ' , 'HEAD ' );
689
+ test ($ test , 'PATCH ' , 'OPTIONS ' );
665
690
}
666
691
667
692
public function testRequestMethodSuccessiveDeleteRequests () {
@@ -670,5 +695,27 @@ public function testRequestMethodSuccessiveDeleteRequests() {
670
695
test ($ test , 'DELETE ' , 'POST ' );
671
696
test ($ test , 'DELETE ' , 'PUT ' );
672
697
test ($ test , 'DELETE ' , 'PATCH ' );
698
+ test ($ test , 'DELETE ' , 'HEAD ' );
699
+ test ($ test , 'DELETE ' , 'OPTIONS ' );
700
+ }
701
+
702
+ public function testRequestMethodSuccessiveHeadRequests () {
703
+ $ test = new Test ();
704
+ test ($ test , 'HEAD ' , 'GET ' );
705
+ test ($ test , 'HEAD ' , 'POST ' );
706
+ test ($ test , 'HEAD ' , 'PUT ' );
707
+ test ($ test , 'HEAD ' , 'PATCH ' );
708
+ test ($ test , 'HEAD ' , 'DELETE ' );
709
+ test ($ test , 'HEAD ' , 'OPTIONS ' );
710
+ }
711
+
712
+ public function testRequestMethodSuccessiveOptionsRequests () {
713
+ $ test = new Test ();
714
+ test ($ test , 'OPTIONS ' , 'GET ' );
715
+ test ($ test , 'OPTIONS ' , 'POST ' );
716
+ test ($ test , 'OPTIONS ' , 'PUT ' );
717
+ test ($ test , 'OPTIONS ' , 'PATCH ' );
718
+ test ($ test , 'OPTIONS ' , 'DELETE ' );
719
+ test ($ test , 'OPTIONS ' , 'HEAD ' );
673
720
}
674
721
}
0 commit comments