You are here

function xmlrpc_test_count_the_entities in xmlrpc 8

Test function checking entities in string arguments.

Parameters

string $string: A string containing escaped characters.

Return value

array A hash of the count of occurrences of escapes by type.

1 call to xmlrpc_test_count_the_entities()
XmlRpcValidatorTest::testValidator in src/Tests/XmlRpcValidatorTest.php
Run validator1 tests.
1 string reference to 'xmlrpc_test_count_the_entities'
xmlrpc_test_xmlrpc in tests/modules/xmlrpc_test/xmlrpc_test.module
Implements hook_xmlrpc().

File

tests/modules/xmlrpc_test/xmlrpc_test.module, line 36
Test module to support XmlRpcMessagesTest and XmlRpcValidatorTest.

Code

function xmlrpc_test_count_the_entities($string) {
  return [
    'ctLeftAngleBrackets' => substr_count($string, '<'),
    'ctRightAngleBrackets' => substr_count($string, '>'),
    'ctAmpersands' => substr_count($string, '&'),
    'ctApostrophes' => substr_count($string, "'"),
    'ctQuotes' => substr_count($string, '"'),
  ];
}