summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/xmlrpc.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-02 00:31:47 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-02 00:31:47 +0000
commit810b8512c5bc798abb34094a63fa442b60626b1a (patch)
tree46f61694a1029cbd3285c7003f3e2d16d1196ae3 /modules/simpletest/tests/xmlrpc.test
parent2bc5334aaefb8d1b34b7907a3a86ab7fdaa66b26 (diff)
downloadbrdo-810b8512c5bc798abb34094a63fa442b60626b1a.tar.gz
brdo-810b8512c5bc798abb34094a63fa442b60626b1a.tar.bz2
- Patch #647336 by boombatower, Morbus Iff: fixed bug with when xmlrpc() is called with no function arguments. Added some extra XML-RPC tests.
Diffstat (limited to 'modules/simpletest/tests/xmlrpc.test')
-rw-r--r--modules/simpletest/tests/xmlrpc.test42
1 files changed, 42 insertions, 0 deletions
diff --git a/modules/simpletest/tests/xmlrpc.test b/modules/simpletest/tests/xmlrpc.test
index 232665a95..2212bfd1a 100644
--- a/modules/simpletest/tests/xmlrpc.test
+++ b/modules/simpletest/tests/xmlrpc.test
@@ -1,6 +1,48 @@
<?php
// $Id$
+/**
+ * Perform basic XML-RPC tests that do not require addition callbacks.
+ */
+class XMLRPCBasicTestCase extends DrupalWebTestCase {
+
+ public static function getInfo() {
+ return array(
+ 'name' => 'XML-RPC basic',
+ 'description' => 'Perform basic XML-RPC tests that do not require additional callbacks.',
+ 'group' => 'XML-RPC',
+ );
+ }
+
+ /**
+ * Ensure that a basic XML-RPC call with no parameters works.
+ */
+ protected function testListMethods() {
+ // Minimum list of methods that should be included.
+ $minimum = array(
+ 'system.multicall',
+ 'system.methodSignature',
+ 'system.getCapabilities',
+ 'system.listMethods',
+ 'system.methodHelp',
+ );
+
+ // Invoke XML-RPC call to get list of methods.
+ $url = url(NULL, array('absolute' => TRUE)) . 'xmlrpc.php';
+ $methods = xmlrpc($url, 'system.listMethods');
+
+ // Ensure that the minimum methods were found.
+ $count = 0;
+ foreach ($methods as $method) {
+ if (in_array($method, $minimum)) {
+ $count++;
+ }
+ }
+
+ $this->assertEqual($count, count($minimum), 'system.listMethods returned at least the minimum listing');
+ }
+}
+
class XMLRPCValidator1IncTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(