diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-04-10 22:16:59 +0200 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-04-10 22:16:59 +0200 |
commit | ac8ad4a21afe53adf5ffa0015151f0a54b9a51ba (patch) | |
tree | 5af15ea2b87e87a86a3f0d06097b4a2cce495b6c | |
parent | 90334a83ad18a04a7ce7ab2b88411d959d62fd15 (diff) | |
download | brdo-ac8ad4a21afe53adf5ffa0015151f0a54b9a51ba.tar.gz brdo-ac8ad4a21afe53adf5ffa0015151f0a54b9a51ba.tar.bz2 |
- Patch #897140 by fgm: system.methodSignature returns incorrect and incomplete data.
-rw-r--r-- | includes/xmlrpcs.inc | 8 | ||||
-rw-r--r-- | modules/simpletest/tests/xmlrpc.test | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc index 54a25f804..70c7cdac3 100644 --- a/includes/xmlrpcs.inc +++ b/includes/xmlrpcs.inc @@ -336,7 +336,7 @@ function xmlrpc_server_get_capabilities() { } /** - * Returns the method signature of a function. + * Returns one method signature for a function. * * This is the function mapped to the XML-RPC method system.methodSignature. * @@ -348,8 +348,8 @@ function xmlrpc_server_get_capabilities() { * Name of method to return a method signature for. * * @return array - * An array of types representing the method signature of the function that - * $methodname maps to. + * An array of arrays of types, each of the arrays representing one method + * signature of the function that $methodname maps to. */ function xmlrpc_server_method_signature($methodname) { $xmlrpc_server = xmlrpc_server_get(); @@ -364,7 +364,7 @@ function xmlrpc_server_method_signature($methodname) { foreach ($xmlrpc_server->signatures[$methodname] as $type) { $return[] = $type; } - return $return; + return array($return); } /** diff --git a/modules/simpletest/tests/xmlrpc.test b/modules/simpletest/tests/xmlrpc.test index b2aa928d0..1b5bff384 100644 --- a/modules/simpletest/tests/xmlrpc.test +++ b/modules/simpletest/tests/xmlrpc.test @@ -42,6 +42,16 @@ class XMLRPCBasicTestCase extends DrupalWebTestCase { } /** + * Ensure that system.methodSignature returns an array of signatures. + */ + protected function testMethodSignature() { + $url = url(NULL, array('absolute' => TRUE)) . 'xmlrpc.php'; + $signature = xmlrpc($url, array('system.methodSignature' => array('system.listMethods'))); + $this->assert(is_array($signature) && !empty($signature) && is_array($signature[0]), + t('system.methodSignature returns an array of signature arrays.')); + } + + /** * Ensure that XML-RPC correctly handles invalid messages when parsing. */ protected function testInvalidMessageParsing() { |