mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-24 21:49:02 +00:00
Add tests for content-length with DELETE requests (#557)
This commit is contained in:
@@ -622,6 +622,22 @@ class CurlTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertEquals('{"get":{"foo":"bar"},"delete":{"wibble":"wubble"}}', $test->curl->rawResponse);
|
||||
}
|
||||
|
||||
public function testDeleteContentLengthSetWithBody()
|
||||
{
|
||||
$request_body = 'a=1&b=2&c=3';
|
||||
$test = new Test();
|
||||
$test->server('request_method', 'DELETE', array(), $request_body);
|
||||
$this->assertEquals(strlen($request_body), $test->curl->requestHeaders['content-length']);
|
||||
}
|
||||
|
||||
public function testDeleteContentLengthUnsetWithoutBody()
|
||||
{
|
||||
$request_body = array();
|
||||
$test = new Test();
|
||||
$test->server('request_method', 'DELETE', array(), $request_body);
|
||||
$this->assertFalse(isset($test->curl->requestHeaders['content-length']));
|
||||
}
|
||||
|
||||
public function testHeadRequestMethod()
|
||||
{
|
||||
$test = new Test();
|
||||
|
||||
Reference in New Issue
Block a user