function RandomGeneratorTrait::randomStringValidate

Same name in other branches
  1. 9 core/tests/Drupal/Tests/RandomGeneratorTrait.php \Drupal\Tests\RandomGeneratorTrait::randomStringValidate()
  2. 8.9.x core/tests/Drupal/Tests/RandomGeneratorTrait.php \Drupal\Tests\RandomGeneratorTrait::randomStringValidate()

Callback for random string validation.

Parameters

string $string: The random string to validate.

Return value

bool TRUE if the random string is valid, FALSE if not.

Deprecated

in drupal:10.2.0 and is removed from drupal:11.0.0. Use \Drupal\TestTools\Random::stringValidate() instead.

See also

\Drupal\Component\Utility\Random::string()

https://www.drupal.org/node/3358389

File

core/tests/Drupal/Tests/RandomGeneratorTrait.php, line 52

Class

RandomGeneratorTrait
Provides random generator utility methods.

Namespace

Drupal\Tests

Code

public function randomStringValidate($string) {
    @trigger_error(__METHOD__ . "() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Use \\Drupal\\TestTools\\Random::stringValidate() instead. See https://www.drupal.org/node/3358389", E_USER_DEPRECATED);
    return Random::stringValidate($string);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.