@@ -88,6 +88,15 @@ public function testPutJsonData()
8888 $ resp ->reset ();
8989 }
9090
91+ public function testPutJsonNotAsJsonData ()
92+ {
93+ $ resp = $ this ->curl ->put (self ::TEST_URL .'/server.php ' , ['foo ' => 'bar ' ], true , false );
94+ $ this ->assertTrue ($ resp ->isSuccess ());
95+ $ this ->assertArrayHasKey ('x-powered-by ' , $ resp ->getResponseHeaders ());
96+ // syntax error check
97+ $ resp ->reset ();
98+ }
99+
91100 public function testPatchJsonData ()
92101 {
93102 $ resp = $ this ->curl ->patch (self ::TEST_URL .'/server.php ' , ['foo ' => 'bar ' ], true , true );
@@ -96,6 +105,14 @@ public function testPatchJsonData()
96105 // syntax error check
97106 $ resp ->reset ();
98107 }
108+ public function testPatchJsonNotAsJsonData ()
109+ {
110+ $ resp = $ this ->curl ->patch (self ::TEST_URL .'/server.php ' , ['foo ' => 'bar ' ], true , false );
111+ $ this ->assertTrue ($ resp ->isSuccess ());
112+ $ this ->assertArrayHasKey ('x-powered-by ' , $ resp ->getResponseHeaders ());
113+ // syntax error check
114+ $ resp ->reset ();
115+ }
99116
100117 public function testPurge ()
101118 {
@@ -194,6 +211,22 @@ public function testDelete()
194211 )) === 'delete ' );
195212 }
196213
214+ public function testDeleteWithPayload ()
215+ {
216+ $ this ->curl ->setVerbose ();
217+ $ resp = $ this ->curl ->delete (self ::TEST_URL .'/server.php ' , ['foo ' => 'bar ' ], true );
218+ $ this ->assertTrue ($ resp ->isSuccess ());
219+ $ this ->assertFalse ($ resp ->isInfo ());
220+ $ this ->assertFalse ($ resp ->isRedirect ());
221+ $ this ->assertFalse ($ resp ->isClientError ());
222+ $ this ->assertFalse ($ resp ->isServerError ());
223+ $ this ->assertSame ('http://localhost:1234/server.php ' , $ resp ->getEndpoint ());
224+
225+ $ this ->assertSame ('Error. ' , $ resp ->getResponse ());
226+ $ this ->assertSame ('localhost:1234 ' , $ resp ->getResponseHeaders ('HOST ' ));
227+ unset($ this ->curl );
228+ }
229+
197230 public function testGetOpts ()
198231 {
199232 $ this ->curl ->get (self ::TEST_URL . '/http_basic_auth.php ' );
0 commit comments