function UnicodeUnitTest::helperTestStrLen
2 calls to UnicodeUnitTest::helperTestStrLen()
- UnicodeUnitTest::testEmulatedUnicode in modules/
simpletest/ tests/ unicode.test - Test emulated unicode features.
- UnicodeUnitTest::testMbStringUnicode in modules/
simpletest/ tests/ unicode.test - Test full unicode features implemented using the mbstring extension.
File
-
modules/
simpletest/ tests/ unicode.test, line 117
Class
- UnicodeUnitTest
- Test unicode handling features implemented in unicode.inc.
Code
function helperTestStrLen() {
$testcase = array(
'tHe QUIcK bRoWn' => 15,
'ÜBER-åwesome' => 12,
'NULL' => 0,
);
foreach ($testcase as $input => $output) {
$tested_value = $input === 'NULL' ? NULL : $input;
$this->assertEqual(drupal_strlen($tested_value), $output, format_string('%input length is %output', array(
'%input' => $input,
'%output' => $output,
)));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.