@@ -124,6 +124,11 @@ public function testUrl()
124
124
$ test ->server ('server ' , 'PATCH ' , $ data );
125
125
$ this ->assertEquals (Test::TEST_URL , $ test ->curl ->url );
126
126
127
+ // curl -v --request SEARCH "http://127.0.0.1:8000/" --data "foo=bar"
128
+ $ test = new Test ();
129
+ $ test ->server ('server ' , 'SEARCH ' , $ data );
130
+ $ this ->assertEquals (Test::TEST_URL , $ test ->curl ->url );
131
+
127
132
// curl -v --request DELETE "http://127.0.0.1:8000/?foo=bar"
128
133
$ test = new Test ();
129
134
$ test ->server ('server ' , 'DELETE ' , $ data );
@@ -183,6 +188,11 @@ public function testSetUrlInConstructor()
183
188
$ curl ->setHeader ('X-DEBUG-TEST ' , 'put ' );
184
189
$ curl ->put ($ data );
185
190
$ this ->assertEquals ('key=value ' , $ curl ->response );
191
+
192
+ $ curl = new Curl (Test::TEST_URL );
193
+ $ curl ->setHeader ('X-DEBUG-TEST ' , 'search ' );
194
+ $ curl ->search ($ data );
195
+ $ this ->assertEquals ('key=value ' , $ curl ->response );
186
196
}
187
197
188
198
public function testSetUrl ()
@@ -230,6 +240,12 @@ public function testSetUrl()
230
240
$ curl ->put ($ data );
231
241
$ this ->assertEquals ('PUT / HTTP/1.1 ' , $ curl ->requestHeaders ['Request-Line ' ]);
232
242
$ this ->assertEquals (Test::TEST_URL , $ curl ->effectiveUrl );
243
+
244
+ $ curl = new Curl ();
245
+ $ curl ->setUrl (Test::TEST_URL );
246
+ $ curl ->search ($ data );
247
+ $ this ->assertEquals ('SEARCH / HTTP/1.1 ' , $ curl ->requestHeaders ['Request-Line ' ]);
248
+ $ this ->assertEquals (Test::TEST_URL , $ curl ->effectiveUrl );
233
249
}
234
250
235
251
public function testEffectiveUrl ()
@@ -995,6 +1011,7 @@ public function testResponseBody()
995
1011
'POST ' => 'OK ' ,
996
1012
'PUT ' => 'OK ' ,
997
1013
'PATCH ' => 'OK ' ,
1014
+ 'SEARCH ' => 'OK ' ,
998
1015
'DELETE ' => 'OK ' ,
999
1016
'HEAD ' => '' ,
1000
1017
'OPTIONS ' => 'OK ' ,
@@ -1267,6 +1284,8 @@ public function testRequestUrl()
1267
1284
$ test = new Test ();
1268
1285
$ this ->assertFalse (substr ($ test ->server ('request_uri ' , 'PATCH ' ), -1 ) === '? ' );
1269
1286
$ test = new Test ();
1287
+ $ this ->assertFalse (substr ($ test ->server ('request_uri ' , 'SEARCH ' ), -1 ) === '? ' );
1288
+ $ test = new Test ();
1270
1289
$ this ->assertFalse (substr ($ test ->server ('request_uri ' , 'DELETE ' ), -1 ) === '? ' );
1271
1290
}
1272
1291
@@ -3025,6 +3044,7 @@ public function testRequestMethodSuccessiveGetRequests()
3025
3044
$ test ->chainRequests ('GET ' , 'DELETE ' );
3026
3045
$ test ->chainRequests ('GET ' , 'HEAD ' );
3027
3046
$ test ->chainRequests ('GET ' , 'OPTIONS ' );
3047
+ $ test ->chainRequests ('GET ' , 'SEARCH ' );
3028
3048
$ test ->chainRequests ('GET ' , 'GET ' );
3029
3049
3030
3050
$ test = new Test ();
@@ -3034,7 +3054,8 @@ public function testRequestMethodSuccessiveGetRequests()
3034
3054
$ test ->chainRequests ('GET ' , 'DELETE ' , array ('d ' => '4444 ' ));
3035
3055
$ test ->chainRequests ('GET ' , 'HEAD ' , array ('e ' => '55555 ' ));
3036
3056
$ test ->chainRequests ('GET ' , 'OPTIONS ' , array ('f ' => '666666 ' ));
3037
- $ test ->chainRequests ('GET ' , 'GET ' , array ('g ' => '7777777 ' ));
3057
+ $ test ->chainRequests ('GET ' , 'SEARCH ' , array ('h ' => '7777777 ' ));
3058
+ $ test ->chainRequests ('GET ' , 'GET ' , array ('g ' => '88888888 ' ));
3038
3059
}
3039
3060
3040
3061
public function testRequestMethodSuccessivePostRequests ()
@@ -3046,6 +3067,7 @@ public function testRequestMethodSuccessivePostRequests()
3046
3067
$ test ->chainRequests ('POST ' , 'DELETE ' );
3047
3068
$ test ->chainRequests ('POST ' , 'HEAD ' );
3048
3069
$ test ->chainRequests ('POST ' , 'OPTIONS ' );
3070
+ $ test ->chainRequests ('POST ' , 'SEARCH ' );
3049
3071
$ test ->chainRequests ('POST ' , 'POST ' );
3050
3072
3051
3073
$ test = new Test ();
@@ -3055,7 +3077,8 @@ public function testRequestMethodSuccessivePostRequests()
3055
3077
$ test ->chainRequests ('POST ' , 'DELETE ' , array ('d ' => '4444 ' ));
3056
3078
$ test ->chainRequests ('POST ' , 'HEAD ' , array ('e ' => '55555 ' ));
3057
3079
$ test ->chainRequests ('POST ' , 'OPTIONS ' , array ('f ' => '666666 ' ));
3058
- $ test ->chainRequests ('POST ' , 'POST ' , array ('g ' => '7777777 ' ));
3080
+ $ test ->chainRequests ('POST ' , 'SEARCH ' , array ('g ' => '7777777 ' ));
3081
+ $ test ->chainRequests ('POST ' , 'POST ' , array ('g ' => '88888888 ' ));
3059
3082
}
3060
3083
3061
3084
public function testRequestMethodSuccessivePutRequests ()
@@ -3067,6 +3090,7 @@ public function testRequestMethodSuccessivePutRequests()
3067
3090
$ test ->chainRequests ('PUT ' , 'DELETE ' );
3068
3091
$ test ->chainRequests ('PUT ' , 'HEAD ' );
3069
3092
$ test ->chainRequests ('PUT ' , 'OPTIONS ' );
3093
+ $ test ->chainRequests ('PUT ' , 'SEARCH ' );
3070
3094
$ test ->chainRequests ('PUT ' , 'PUT ' );
3071
3095
3072
3096
$ test = new Test ();
@@ -3076,7 +3100,8 @@ public function testRequestMethodSuccessivePutRequests()
3076
3100
$ test ->chainRequests ('PUT ' , 'DELETE ' , array ('d ' => '4444 ' ));
3077
3101
$ test ->chainRequests ('PUT ' , 'HEAD ' , array ('e ' => '55555 ' ));
3078
3102
$ test ->chainRequests ('PUT ' , 'OPTIONS ' , array ('f ' => '666666 ' ));
3079
- $ test ->chainRequests ('PUT ' , 'PUT ' , array ('g ' => '7777777 ' ));
3103
+ $ test ->chainRequests ('PUT ' , 'SEARCH ' , array ('f ' => '7777777 ' ));
3104
+ $ test ->chainRequests ('PUT ' , 'PUT ' , array ('g ' => '88888888 ' ));
3080
3105
}
3081
3106
3082
3107
public function testRequestMethodSuccessivePatchRequests ()
@@ -3088,6 +3113,7 @@ public function testRequestMethodSuccessivePatchRequests()
3088
3113
$ test ->chainRequests ('PATCH ' , 'DELETE ' );
3089
3114
$ test ->chainRequests ('PATCH ' , 'HEAD ' );
3090
3115
$ test ->chainRequests ('PATCH ' , 'OPTIONS ' );
3116
+ $ test ->chainRequests ('PATCH ' , 'SEARCH ' );
3091
3117
$ test ->chainRequests ('PATCH ' , 'PATCH ' );
3092
3118
3093
3119
$ test = new Test ();
@@ -3097,7 +3123,8 @@ public function testRequestMethodSuccessivePatchRequests()
3097
3123
$ test ->chainRequests ('PATCH ' , 'DELETE ' , array ('d ' => '4444 ' ));
3098
3124
$ test ->chainRequests ('PATCH ' , 'HEAD ' , array ('e ' => '55555 ' ));
3099
3125
$ test ->chainRequests ('PATCH ' , 'OPTIONS ' , array ('f ' => '666666 ' ));
3100
- $ test ->chainRequests ('PATCH ' , 'PATCH ' , array ('g ' => '7777777 ' ));
3126
+ $ test ->chainRequests ('PATCH ' , 'SEARCH ' , array ('f ' => '7777777 ' ));
3127
+ $ test ->chainRequests ('PATCH ' , 'PATCH ' , array ('g ' => '88888888 ' ));
3101
3128
}
3102
3129
3103
3130
public function testRequestMethodSuccessiveDeleteRequests ()
@@ -3109,6 +3136,7 @@ public function testRequestMethodSuccessiveDeleteRequests()
3109
3136
$ test ->chainRequests ('DELETE ' , 'PATCH ' );
3110
3137
$ test ->chainRequests ('DELETE ' , 'HEAD ' );
3111
3138
$ test ->chainRequests ('DELETE ' , 'OPTIONS ' );
3139
+ $ test ->chainRequests ('DELETE ' , 'SEARCH ' );
3112
3140
$ test ->chainRequests ('DELETE ' , 'DELETE ' );
3113
3141
3114
3142
$ test = new Test ();
@@ -3118,7 +3146,8 @@ public function testRequestMethodSuccessiveDeleteRequests()
3118
3146
$ test ->chainRequests ('DELETE ' , 'PATCH ' , array ('d ' => '4444 ' ));
3119
3147
$ test ->chainRequests ('DELETE ' , 'HEAD ' , array ('e ' => '55555 ' ));
3120
3148
$ test ->chainRequests ('DELETE ' , 'OPTIONS ' , array ('f ' => '666666 ' ));
3121
- $ test ->chainRequests ('DELETE ' , 'DELETE ' , array ('g ' => '7777777 ' ));
3149
+ $ test ->chainRequests ('DELETE ' , 'SEARCH ' , array ('f ' => '7777777 ' ));
3150
+ $ test ->chainRequests ('DELETE ' , 'DELETE ' , array ('g ' => '88888888 ' ));
3122
3151
}
3123
3152
3124
3153
public function testRequestMethodSuccessiveHeadRequests ()
@@ -3130,6 +3159,7 @@ public function testRequestMethodSuccessiveHeadRequests()
3130
3159
$ test ->chainRequests ('HEAD ' , 'PATCH ' );
3131
3160
$ test ->chainRequests ('HEAD ' , 'DELETE ' );
3132
3161
$ test ->chainRequests ('HEAD ' , 'OPTIONS ' );
3162
+ $ test ->chainRequests ('HEAD ' , 'SEARCH ' );
3133
3163
$ test ->chainRequests ('HEAD ' , 'HEAD ' );
3134
3164
3135
3165
$ test = new Test ();
@@ -3139,7 +3169,8 @@ public function testRequestMethodSuccessiveHeadRequests()
3139
3169
$ test ->chainRequests ('HEAD ' , 'PATCH ' , array ('d ' => '4444 ' ));
3140
3170
$ test ->chainRequests ('HEAD ' , 'DELETE ' , array ('e ' => '55555 ' ));
3141
3171
$ test ->chainRequests ('HEAD ' , 'OPTIONS ' , array ('f ' => '666666 ' ));
3142
- $ test ->chainRequests ('HEAD ' , 'HEAD ' , array ('g ' => '7777777 ' ));
3172
+ $ test ->chainRequests ('HEAD ' , 'SEARCH ' , array ('g ' => '7777777 ' ));
3173
+ $ test ->chainRequests ('HEAD ' , 'HEAD ' , array ('g ' => '88888888 ' ));
3143
3174
}
3144
3175
3145
3176
public function testRequestMethodSuccessiveOptionsRequests ()
@@ -3150,6 +3181,7 @@ public function testRequestMethodSuccessiveOptionsRequests()
3150
3181
$ test ->chainRequests ('OPTIONS ' , 'PUT ' );
3151
3182
$ test ->chainRequests ('OPTIONS ' , 'PATCH ' );
3152
3183
$ test ->chainRequests ('OPTIONS ' , 'DELETE ' );
3184
+ $ test ->chainRequests ('OPTIONS ' , 'SEARCH ' );
3153
3185
$ test ->chainRequests ('OPTIONS ' , 'HEAD ' );
3154
3186
$ test ->chainRequests ('OPTIONS ' , 'OPTIONS ' );
3155
3187
@@ -3159,8 +3191,32 @@ public function testRequestMethodSuccessiveOptionsRequests()
3159
3191
$ test ->chainRequests ('OPTIONS ' , 'PUT ' , array ('c ' => '333 ' ));
3160
3192
$ test ->chainRequests ('OPTIONS ' , 'PATCH ' , array ('d ' => '4444 ' ));
3161
3193
$ test ->chainRequests ('OPTIONS ' , 'DELETE ' , array ('e ' => '55555 ' ));
3162
- $ test ->chainRequests ('OPTIONS ' , 'HEAD ' , array ('f ' => '666666 ' ));
3163
- $ test ->chainRequests ('OPTIONS ' , 'OPTIONS ' , array ('g ' => '7777777 ' ));
3194
+ $ test ->chainRequests ('OPTIONS ' , 'SEARCH ' , array ('g ' => '666666 ' ));
3195
+ $ test ->chainRequests ('OPTIONS ' , 'HEAD ' , array ('f ' => '7777777 ' ));
3196
+ $ test ->chainRequests ('OPTIONS ' , 'OPTIONS ' , array ('g ' => '88888888 ' ));
3197
+ }
3198
+
3199
+ public function testRequestMethodSuccessiveSearchRequests ()
3200
+ {
3201
+ $ test = new Test ();
3202
+ $ test ->chainRequests ('SEARCH ' , 'GET ' );
3203
+ $ test ->chainRequests ('SEARCH ' , 'POST ' );
3204
+ $ test ->chainRequests ('SEARCH ' , 'PUT ' );
3205
+ $ test ->chainRequests ('SEARCH ' , 'PATCH ' );
3206
+ $ test ->chainRequests ('SEARCH ' , 'DELETE ' );
3207
+ $ test ->chainRequests ('SEARCH ' , 'HEAD ' );
3208
+ $ test ->chainRequests ('SEARCH ' , 'OPTIONS ' );
3209
+ $ test ->chainRequests ('SEARCH ' , 'SEARCH ' );
3210
+
3211
+ $ test = new Test ();
3212
+ $ test ->chainRequests ('SEARCH ' , 'GET ' , array ('a ' => '1 ' ));
3213
+ $ test ->chainRequests ('SEARCH ' , 'POST ' , array ('b ' => '22 ' ));
3214
+ $ test ->chainRequests ('SEARCH ' , 'PUT ' , array ('c ' => '333 ' ));
3215
+ $ test ->chainRequests ('SEARCH ' , 'PATCH ' , array ('d ' => '4444 ' ));
3216
+ $ test ->chainRequests ('SEARCH ' , 'DELETE ' , array ('e ' => '55555 ' ));
3217
+ $ test ->chainRequests ('SEARCH ' , 'HEAD ' , array ('f ' => '666666 ' ));
3218
+ $ test ->chainRequests ('SEARCH ' , 'OPTIONS ' , array ('g ' => '7777777 ' ));
3219
+ $ test ->chainRequests ('SEARCH ' , 'SEARCH ' , array ('g ' => '88888888 ' ));
3164
3220
}
3165
3221
3166
3222
public function testMemoryLeak ()
0 commit comments