Commit 39f51caa authored by catch's avatar catch
Browse files

Issue #1593670 by effulgentsia: Fixed XML-RPC tests fail without clean URLs.

parent fcbbe85d
...@@ -19,6 +19,8 @@ class XMLRPCBasicTestCase extends WebTestBase { ...@@ -19,6 +19,8 @@ class XMLRPCBasicTestCase extends WebTestBase {
* Ensure that a basic XML-RPC call with no parameters works. * Ensure that a basic XML-RPC call with no parameters works.
*/ */
protected function testListMethods() { protected function testListMethods() {
global $base_url;
// Minimum list of methods that should be included. // Minimum list of methods that should be included.
$minimum = array( $minimum = array(
'system.multicall', 'system.multicall',
...@@ -29,7 +31,7 @@ class XMLRPCBasicTestCase extends WebTestBase { ...@@ -29,7 +31,7 @@ class XMLRPCBasicTestCase extends WebTestBase {
); );
// Invoke XML-RPC call to get list of methods. // Invoke XML-RPC call to get list of methods.
$url = url(NULL, array('absolute' => TRUE)) . 'core/xmlrpc.php'; $url = $base_url . '/core/xmlrpc.php';
$methods = xmlrpc($url, array('system.listMethods' => array())); $methods = xmlrpc($url, array('system.listMethods' => array()));
// Ensure that the minimum methods were found. // Ensure that the minimum methods were found.
...@@ -47,7 +49,9 @@ class XMLRPCBasicTestCase extends WebTestBase { ...@@ -47,7 +49,9 @@ class XMLRPCBasicTestCase extends WebTestBase {
* Ensure that system.methodSignature returns an array of signatures. * Ensure that system.methodSignature returns an array of signatures.
*/ */
protected function testMethodSignature() { protected function testMethodSignature() {
$url = url(NULL, array('absolute' => TRUE)) . 'core/xmlrpc.php'; global $base_url;
$url = $base_url . '/core/xmlrpc.php';
$signature = xmlrpc($url, array('system.methodSignature' => array('system.listMethods'))); $signature = xmlrpc($url, array('system.methodSignature' => array('system.listMethods')));
$this->assert(is_array($signature) && !empty($signature) && is_array($signature[0]), $this->assert(is_array($signature) && !empty($signature) && is_array($signature[0]),
t('system.methodSignature returns an array of signature arrays.')); t('system.methodSignature returns an array of signature arrays.'));
...@@ -99,7 +103,8 @@ class XMLRPCValidator1IncTestCase extends WebTestBase { ...@@ -99,7 +103,8 @@ class XMLRPCValidator1IncTestCase extends WebTestBase {
* Run validator1 tests. * Run validator1 tests.
*/ */
function testValidator1() { function testValidator1() {
$xml_url = url(NULL, array('absolute' => TRUE)) . 'core/xmlrpc.php'; global $base_url;
$xml_url = $base_url . '/core/xmlrpc.php';
srand(); srand();
mt_srand(); mt_srand();
...@@ -213,7 +218,9 @@ class XMLRPCMessagesTestCase extends WebTestBase { ...@@ -213,7 +218,9 @@ class XMLRPCMessagesTestCase extends WebTestBase {
* Make sure that XML-RPC can transfer large messages. * Make sure that XML-RPC can transfer large messages.
*/ */
function testSizedMessages() { function testSizedMessages() {
$xml_url = url(NULL, array('absolute' => TRUE)) . 'core/xmlrpc.php'; global $base_url;
$xml_url = $base_url . '/core/xmlrpc.php';
$sizes = array(8, 80, 160); $sizes = array(8, 80, 160);
foreach ($sizes as $size) { foreach ($sizes as $size) {
$xml_message_l = xmlrpc_test_message_sized_in_kb($size); $xml_message_l = xmlrpc_test_message_sized_in_kb($size);
...@@ -227,10 +234,11 @@ class XMLRPCMessagesTestCase extends WebTestBase { ...@@ -227,10 +234,11 @@ class XMLRPCMessagesTestCase extends WebTestBase {
* Ensure that hook_xmlrpc_alter() can hide even builtin methods. * Ensure that hook_xmlrpc_alter() can hide even builtin methods.
*/ */
protected function testAlterListMethods() { protected function testAlterListMethods() {
global $base_url;
// Ensure xmlrpc_test_xmlrpc_alter() is disabled and retrieve regular list of methods. // Ensure xmlrpc_test_xmlrpc_alter() is disabled and retrieve regular list of methods.
variable_set('xmlrpc_test_xmlrpc_alter', FALSE); variable_set('xmlrpc_test_xmlrpc_alter', FALSE);
$url = url(NULL, array('absolute' => TRUE)) . 'core/xmlrpc.php'; $url = $base_url . '/core/xmlrpc.php';
$methods1 = xmlrpc($url, array('system.listMethods' => array())); $methods1 = xmlrpc($url, array('system.listMethods' => array()));
// Enable the alter hook and retrieve the list of methods again. // Enable the alter hook and retrieve the list of methods again.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment