mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 04:01:47 +00:00
Add ability to POST multidimensional array of data
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user