mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 20:20:53 +00:00
Send DELETE data was GET variables; Add DELETE test
This commit is contained in:
+1
-2
@@ -42,9 +42,8 @@ class Curl {
|
||||
}
|
||||
|
||||
function delete($url, $data=array()) {
|
||||
$this->setopt(CURLOPT_URL, $url);
|
||||
$this->setopt(CURLOPT_URL, $url . '?' . http_build_query($data));
|
||||
$this->setopt(CURLOPT_CUSTOMREQUEST, 'DELETE');
|
||||
$this->setopt(CURLOPT_POSTFIELDS, $data);
|
||||
$this->_exec();
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,11 @@ class CurlTest extends PHPUnit_Framework_TestCase {
|
||||
$this->assertTrue($test->server('POST', 'post', 'test') === 'post');
|
||||
}
|
||||
|
||||
public function testDelete() {
|
||||
$test = new Test();
|
||||
$this->assertTrue($test->server('DELETE', 'server', 'REQUEST_METHOD') === 'DELETE');
|
||||
}
|
||||
|
||||
public function testBasicHttpAuth() {
|
||||
$test = new Test();
|
||||
$this->assertTrue($test->server('GET', 'http_basic_auth') === 'canceled');
|
||||
|
||||
Reference in New Issue
Block a user