protected static function FaqAskTestCase::randomNumber in FAQ_Ask 6.2
Generates a random string of ASCII numeric characters (values 48 to 57).
Parameters
$length: Length of random string to generate .
Return value
Randomly generated string.
File
- ./
faq_ask.test, line 105 - Test FAQ functionality Base test class. All tests inherits this one. Hugely based on code from the test file block.test by boombatower
Class
- FaqAskTestCase
- Base class that is extended by test cases.
Code
protected static function randomNumber($length = 8) {
$str = '';
for ($i = 0; $i < $length; $i++) {
$str .= chr(mt_rand(48, 57));
}
return $str;
}