Mensaje de error

  • Warning: count(): Parameter must be an array or an object that implements Countable en _api_make_match_member_link() (línea 1230 de /home/u295177857/domains/app01.inkastattoonewjersey.com/public_html/profiles/drupalapi/modules/contrib/api/api.formatting.inc).
  • Warning: count(): Parameter must be an array or an object that implements Countable en _api_make_match_member_link() (línea 1230 de /home/u295177857/domains/app01.inkastattoonewjersey.com/public_html/profiles/drupalapi/modules/contrib/api/api.formatting.inc).

public static function DrupalTestCase::randomString

Generates a random string of ASCII characters of codes 32 to 126.

The generated string includes alpha-numeric characters and common miscellaneous characters. Use this method when testing general input where the content is not restricted.

Do not use this method when special characters are not possible (e.g., in machine or file names that have already been validated); instead, use DrupalWebTestCase::randomName().

Parameters

$length: Length of random string to generate.

Return value

Randomly generated string.

See also

DrupalWebTestCase::randomName()

34 calls to DrupalTestCase::randomString()
CommentContentRebuild::testCommentRebuild in drupal-7.x/modules/comment/comment.test
Test to ensure that the comment's content array is rebuilt for every call to comment_view().
CommentContentRebuild::testCommentRebuild in drupal-7.x/modules/comment/comment.test
Test to ensure that the comment's content array is rebuilt for every call to comment_view().
ContactSitewideTestCase::testAutoReply in drupal-7.x/modules/contact/contact.test
Tests auto-reply on the site-wide contact form.
ContactSitewideTestCase::testAutoReply in drupal-7.x/modules/contact/contact.test
Tests auto-reply on the site-wide contact form.
FieldTranslationsTestCase::setUp in drupal-7.x/modules/field/tests/field.test
Set the default field storage backend for fields created during tests.

... See full list

Archivo

drupal-7.x/modules/simpletest/drupal_web_test_case.php, line 586

Class

DrupalTestCase
Base class for Drupal tests.

Código

public static function randomString($length = 8) {
  $str = '';
  for ($i = 0; $i < $length; $i++) {
    $str .= chr(mt_rand(32, 126));
  }
  return $str;
}