function xmlrpc_test_array_of_structs_test in xmlrpc 8
Test function counting elements occurrences.
Parameters
array $array: A hash of values, containing sub-arrays with repeated keys.
Return value
int The count of values for a repeated key.
1 call to xmlrpc_test_array_of_structs_test()
- XmlRpcValidatorTest::testValidator in src/
Tests/ XmlRpcValidatorTest.php - Run validator1 tests.
1 string reference to 'xmlrpc_test_array_of_structs_test'
- xmlrpc_test_xmlrpc in tests/
modules/ xmlrpc_test/ xmlrpc_test.module - Implements hook_xmlrpc().
File
- tests/
modules/ xmlrpc_test/ xmlrpc_test.module, line 17 - Test module to support XmlRpcMessagesTest and XmlRpcValidatorTest.
Code
function xmlrpc_test_array_of_structs_test(array $array) {
$sum = 0;
foreach ($array as $struct) {
if (isset($struct['curly'])) {
$sum += $struct['curly'];
}
}
return $sum;
}