mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-25 09:19:07 +00:00
Clean up request method tests
This commit is contained in:
@@ -95,9 +95,7 @@ class CurlTest extends PHPUnit_Framework_TestCase
|
||||
public function testGet()
|
||||
{
|
||||
$test = new Test();
|
||||
$this->assertEquals('GET', $test->server('server', 'GET', array(
|
||||
'key' => 'REQUEST_METHOD',
|
||||
)));
|
||||
$this->assertEquals('GET', $test->server('request_method', 'GET'));
|
||||
}
|
||||
|
||||
public function testUrl()
|
||||
@@ -257,9 +255,7 @@ class CurlTest extends PHPUnit_Framework_TestCase
|
||||
public function testPostRequestMethod()
|
||||
{
|
||||
$test = new Test();
|
||||
$this->assertEquals('POST', $test->server('server', 'POST', array(
|
||||
'key' => 'REQUEST_METHOD',
|
||||
)));
|
||||
$this->assertEquals('POST', $test->server('request_method', 'POST'));
|
||||
}
|
||||
|
||||
public function testPostContinueResponseHeader()
|
||||
@@ -413,19 +409,14 @@ class CurlTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals('PATCH', $test->server('request_method', 'PATCH'));
|
||||
}
|
||||
|
||||
public function testDelete()
|
||||
public function testDeleteRequestMethod()
|
||||
{
|
||||
$test = new Test();
|
||||
$this->assertEquals('DELETE', $test->server('server', 'DELETE', array(
|
||||
'key' => 'REQUEST_METHOD',
|
||||
)));
|
||||
|
||||
$test = new Test();
|
||||
$this->assertEquals('delete', $test->server('delete', 'DELETE', array(
|
||||
'test' => 'delete',
|
||||
'key' => 'test',
|
||||
)));
|
||||
$this->assertEquals('DELETE', $test->server('request_method', 'DELETE'));
|
||||
}
|
||||
|
||||
public function testDeleteRequestBody()
|
||||
{
|
||||
$test = new Test();
|
||||
$test->server('delete_with_body', 'DELETE', array('foo' => 'bar'), array('wibble' => 'wubble'));
|
||||
$this->assertEquals('{"get":{"foo":"bar"},"delete":{"wibble":"wubble"}}', $test->curl->raw_response);
|
||||
@@ -434,9 +425,7 @@ class CurlTest extends PHPUnit_Framework_TestCase
|
||||
public function testHeadRequestMethod()
|
||||
{
|
||||
$test = new Test();
|
||||
$test->server('request_method', 'HEAD', array(
|
||||
'key' => 'REQUEST_METHOD',
|
||||
));
|
||||
$test->server('request_method', 'HEAD');
|
||||
$this->assertEquals('HEAD', $test->curl->response_headers['X-REQUEST-METHOD']);
|
||||
$this->assertEmpty($test->curl->response);
|
||||
}
|
||||
@@ -444,9 +433,7 @@ class CurlTest extends PHPUnit_Framework_TestCase
|
||||
public function testOptionsRequestMethod()
|
||||
{
|
||||
$test = new Test();
|
||||
$test->server('request_method', 'OPTIONS', array(
|
||||
'key' => 'REQUEST_METHOD',
|
||||
));
|
||||
$test->server('request_method', 'OPTIONS');
|
||||
$this->assertEquals('OPTIONS', $test->curl->response_headers['X-REQUEST-METHOD']);
|
||||
}
|
||||
|
||||
@@ -476,9 +463,7 @@ class CurlTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(md5_file($upload_file_path), $download_test->curl->response_headers['ETag']);
|
||||
|
||||
// Ensure successive requests set the appropriate values.
|
||||
$this->assertEquals('GET', $download_test->server('server', 'GET', array(
|
||||
'key' => 'REQUEST_METHOD',
|
||||
)));
|
||||
$this->assertEquals('GET', $download_test->server('request_method', 'GET'));
|
||||
$this->assertFalse(is_bool($download_test->curl->response));
|
||||
$this->assertFalse(is_bool($download_test->curl->raw_response));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user