You are here

trait RandomGeneratorTrait in Drupal 8

Same name in this branch
  1. 8 core/tests/Drupal/Tests/RandomGeneratorTrait.php \Drupal\Tests\RandomGeneratorTrait
  2. 8 core/modules/simpletest/src/RandomGeneratorTrait.php \Drupal\simpletest\RandomGeneratorTrait

Provides random generator utility methods.

Hierarchy

Deprecated

in drupal:8.1.1 and is removed from drupal:9.0.0. Use \Drupal\Tests\RandomGeneratorTrait instead.

See also

\Drupal\Tests

File

core/modules/simpletest/src/RandomGeneratorTrait.php, line 17

Namespace

Drupal\simpletest
View source
trait RandomGeneratorTrait {
  use BaseGeneratorTrait;

}

Members

Namesort descending Modifiers Type Description Overrides
RandomGeneratorTrait::$randomGenerator protected property The random generator.
RandomGeneratorTrait::getRandomGenerator protected function Gets the random generator for the utility methods.
RandomGeneratorTrait::randomMachineName protected function Generates a unique random string containing letters and numbers. 1
RandomGeneratorTrait::randomObject public function Generates a random PHP object.
RandomGeneratorTrait::randomString public function Generates a pseudo-random string of ASCII characters of codes 32 to 126.
RandomGeneratorTrait::randomStringValidate public function Callback for random string validation.