file MDL-23075 fix format_postdata_for_curlcall when the params is an array of array of array

This commit is contained in:
jerome mouneyrac
2010-07-05 02:56:04 +00:00
parent 4cec22dce6
commit 277c7a4033
2 changed files with 14 additions and 6 deletions
+10 -3
View File
@@ -68,8 +68,15 @@ class filelib_test extends UnitTestCase {
$postdata = format_postdata_for_curlcall($postdatatoconvert);
$this->assertEqual($postdata, $expectedresult);
//POST params with other complex types
$postdatatoconvert = array ('members' =>
array(
array('groupid' => 1, 'userid' => 1)
, array('groupid' => 1, 'userid' => 2)
)
);
$expectedresult = "members[0][groupid]=1&members[0][userid]=1&members[1][groupid]=1&members[1][userid]=2";
$postdata = format_postdata_for_curlcall($postdatatoconvert);
$this->assertEqual($postdata, $expectedresult);
}
}