From 810b8512c5bc798abb34094a63fa442b60626b1a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 2 Dec 2009 00:31:47 +0000 Subject: - Patch #647336 by boombatower, Morbus Iff: fixed bug with when xmlrpc() is called with no function arguments. Added some extra XML-RPC tests. --- modules/simpletest/tests/xmlrpc.test | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'modules/simpletest') 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 @@ '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( -- cgit v1.2.3