Add ability to POST multidimensional array of data

This commit is contained in:
php-curl-class
2013-08-23 17:09:45 -07:00
parent 1f78da3cbf
commit bc96a04df4
2 changed files with 17 additions and 0 deletions
+13
View File
@@ -43,6 +43,19 @@ class CurlTest extends PHPUnit_Framework_TestCase {
)) === 'post');
}
public function testPostMultidimensionalData() {
$test = new Test();
$this->assertTrue($test->server('POST', array(
'test' => 'post_multidimensional',
'key' => 'file',
'file' => array(
'wibble',
'wubble',
'wobble',
),
)) === '{"test":"post_multidimensional","key":"file","file":["wibble","wubble","wobble"]}');
}
public function testPostFilePathUpload() {
$file_path = get_png();
+4
View File
@@ -19,6 +19,10 @@ if ($test == 'http_basic_auth') {
));
exit;
}
else if ($test === 'post_multidimensional') {
echo json_encode($_POST);
exit;
}
else if ($test === 'post_file_path_upload') {
echo mime_content_type($_FILES[$key]['tmp_name']);
exit;