]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixes #1397 and updates unit tests - comma was missing
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 4 Dec 2009 12:48:37 +0000 (12:48 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 4 Dec 2009 12:48:37 +0000 (12:48 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3724 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/api.php
engine/tests/services/api.php

index 7d97919533a1d039b86f4506bfa008b4e2dc5219..9fbca5714e548098611912192ecfe31982df160a 100644 (file)
@@ -667,6 +667,7 @@ function serialise_parameters($method, $parameters) {
                                $array = trim($array,",");
                                                                
                                $array .= ")";
+                               $array = ",$array";
                                                        
                                $serialised_parameters .= $array;
                                break;
index 2acda58237c946e9660ebc5048c3b32d250cbd08..b9dfda8f555c378346f880f0beb8b3f67b30a538 100644 (file)
@@ -264,19 +264,19 @@ class ElggCoreServicesApiTest extends ElggCoreUnitTest {
                $this->registerFunction(false, false, array('param1' => array('type' => 'array')));\r
                $parameters = array('param1' => array('one', 'two'));\r
                $s = serialise_parameters('test', $parameters);\r
-               $this->assertIdentical($s, "array('0'=>'one','1'=>'two')");\r
+               $this->assertIdentical($s, ",array('0'=>'one','1'=>'two')");\r
 \r
                // associative array of strings\r
                $this->registerFunction(false, false, array('param1' => array('type' => 'array')));\r
                $parameters = array('param1' => array('first' => 'one', 'second' => 'two'));\r
                $s = serialise_parameters('test', $parameters);\r
-               $this->assertIdentical($s, "array('first'=>'one','second'=>'two')");\r
+               $this->assertIdentical($s, ",array('first'=>'one','second'=>'two')");\r
 \r
                // indexed array of strings\r
                $this->registerFunction(false, false, array('param1' => array('type' => 'array')));\r
                $parameters = array('param1' => array(1, 2));\r
                $s = serialise_parameters('test', $parameters);\r
-               $this->assertIdentical($s, "array('0'=>'1','1'=>'2')");\r
+               $this->assertIdentical($s, ",array('0'=>'1','1'=>'2')");\r
 \r
                // test unknown type\r
                $this->registerFunction(false, false, array('param1' => array('type' => 'bad')));\r