This commit is contained in:
Zach Borboa
2014-05-16 23:37:03 -07:00
parent 78091d56a0
commit 15a121c0e1
+15 -13
View File
@@ -500,20 +500,22 @@ class CurlTest extends PHPUnit_Framework_TestCase
public function testPostCurlFileFormDataContentType()
{
if (class_exists('CURLFile')) {
$file_path = get_png();
$test = new Test();
$test->server('server', 'POST', array(
'image' => new CURLFile($file_path),
));
$this->assertEquals($test->curl->request_headers['Expect'], '100-continue');
preg_match('/^multipart\/form-data; boundary=/', $test->curl->request_headers['Content-Type'], $content_type);
$this->assertTrue(!empty($content_type));
unlink($file_path);
$this->assertFalse(file_exists($file_path));
if (!class_exists('CURLFile')) {
return;
}
$file_path = get_png();
$test = new Test();
$test->server('server', 'POST', array(
'image' => new CURLFile($file_path),
));
$this->assertEquals($test->curl->request_headers['Expect'], '100-continue');
preg_match('/^multipart\/form-data; boundary=/', $test->curl->request_headers['Content-Type'], $content_type);
$this->assertTrue(!empty($content_type));
unlink($file_path) ;
$this->assertFalse(file_exists($file_path));
}
public function testJSONResponse()