Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/RandomGeneratorTrait.php \Drupal\Tests\RandomGeneratorTrait::getRandomGenerator()
  2. 9 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.

16 calls to RandomGeneratorTrait::getRandomGenerator()
AccessResultForbiddenTest::testConstruction in core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php
Tests the construction of an AccessResultForbidden object.
AccessResultForbiddenTest::testSetReason in core/tests/Drupal/Tests/Core/Access/AccessResultForbiddenTest.php
Tests setReason()
AccessResultNeutralTest::testConstruction in core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php
Tests the construction of an AccessResultForbidden object.
AccessResultNeutralTest::testSetReason in core/tests/Drupal/Tests/Core/Access/AccessResultNeutralTest.php
Tests setReason()
AccessResultTest::testAccessForbiddenReason in core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
@covers ::forbidden

... See full list

File

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

Class

RandomGeneratorTrait
Provides random generator utility methods.

Namespace

Drupal\Tests

Code

protected function getRandomGenerator() {
  return Random::getGenerator();
}