function xmlrpc_test_message_sized_in_kb in SimpleTest 7
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 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 tests/
xmlrpc_test.module - Implement hook_xmlrpc()
File
- tests/
xmlrpc_test.module, line 73
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;
}