Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
c6b5f180
Commit
c6b5f180
authored
Apr 10, 2011
by
Dries Buytaert
Browse files
- Patch
#897140
by fgm: system.methodSignature returns incorrect and incomplete data.
parent
d003c2af
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/xmlrpcs.inc
View file @
c6b5f180
...
...
@@ -336,7 +336,7 @@ function xmlrpc_server_get_capabilities() {
}
/**
* Returns
th
e method signature
o
f a function.
* Returns
on
e method signature f
or
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
type
s representing
th
e method
signature of the function that
* $methodname maps to.
* An array of
arrays of types, each of the array
s representing
on
e 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
)
;
}
/**
...
...
modules/simpletest/tests/xmlrpc.test
View file @
c6b5f180
...
...
@@ -41,6 +41,16 @@ class XMLRPCBasicTestCase extends DrupalWebTestCase {
$this
->
assertEqual
(
$count
,
count
(
$minimum
),
'system.listMethods returned at least the minimum listing'
);
}
/**
* 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.
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment