function xmlrpc_test_message_sized_in_kb

Created a message of the desired size in KB.

Parameters

$size: Message size in KB.

Return value

array Generated message structure.

1 call to xmlrpc_test_message_sized_in_kb()
XMLRPCMessagesTestCase::testSizedMessages in modules/simpletest/tests/xmlrpc.test
Make sure that XML-RPC can transfer large messages.
1 string reference to 'xmlrpc_test_message_sized_in_kb'
xmlrpc_test_xmlrpc in modules/simpletest/tests/xmlrpc_test.module
Implements hook_xmlrpc().

File

modules/simpletest/tests/xmlrpc_test.module, line 96

Code

function xmlrpc_test_message_sized_in_kb($size) {
    $message = array();
    $word = 'abcdefg';
    // Create a ~1KB sized struct.
    for ($i = 0; $i < 128; $i++) {
        $line['word_' . $i] = $word;
    }
    for ($i = 0; $i < $size; $i++) {
        $message['line_' . $i] = $line;
    }
    return $message;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.