You are here

protected static function Faq_AskTestCase::randomNumber in FAQ_Ask 7

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 161
Test Faq_Ask functionality Base test class. All tests inherits this one Hugely based on code from the test file block.test by boombatower

Class

Faq_AskTestCase
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;
}