function RandomGeneratorTrait::getRandomGenerator
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/RandomGeneratorTrait.php \Drupal\Tests\RandomGeneratorTrait::getRandomGenerator()
- 10 core/tests/Drupal/Tests/RandomGeneratorTrait.php \Drupal\Tests\RandomGeneratorTrait::getRandomGenerator()
- 11.x core/tests/Drupal/Tests/RandomGeneratorTrait.php \Drupal\Tests\RandomGeneratorTrait::getRandomGenerator()
Gets the random generator for the utility methods.
Return value
\Drupal\Component\Utility\Random The random generator.
1 call to RandomGeneratorTrait::getRandomGenerator()
- JsonApiFunctionalTestBase::createDefaultContent in core/
modules/ jsonapi/ tests/ src/ Functional/ JsonApiFunctionalTestBase.php - Creates default content to test the API.
File
-
core/
tests/ Drupal/ Tests/ RandomGeneratorTrait.php, line 118
Class
- RandomGeneratorTrait
- Provides random generator utility methods.
Namespace
Drupal\TestsCode
protected function getRandomGenerator() {
if (!is_object($this->randomGenerator)) {
$this->randomGenerator = new Random();
}
return $this->randomGenerator;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.