public function UnitTestCase::randomMachineName in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/UnitTestCase.php \Drupal\Tests\UnitTestCase::randomMachineName()
Generates a unique random string containing letters and numbers.
Parameters
int $length: Length of random string to generate.
Return value
string Randomly generated unique string.
See also
\Drupal\Component\Utility\Random::name()
139 calls to UnitTestCase::randomMachineName()
- AliasManagerTest::testGetAliasByPathCachedMatch in core/
tests/ Drupal/ Tests/ Core/ Path/ AliasManagerTest.php - Tests the getAliasByPath method for a path that is preloaded.
- AliasManagerTest::testGetAliasByPathCachedMissLanguage in core/
tests/ Drupal/ Tests/ Core/ Path/ AliasManagerTest.php - Tests the getAliasByPath cache when a different language is requested.
- AliasManagerTest::testGetAliasByPathCachedMissNoAlias in core/
tests/ Drupal/ Tests/ Core/ Path/ AliasManagerTest.php - Tests the getAliasByPath cache with a preloaded path without alias.
- AliasManagerTest::testGetAliasByPathMatch in core/
tests/ Drupal/ Tests/ Core/ Path/ AliasManagerTest.php - Tests the getAliasByPath method for a path that has a matching alias.
- AliasManagerTest::testGetAliasByPathNoMatch in core/
tests/ Drupal/ Tests/ Core/ Path/ AliasManagerTest.php - Tests the getAliasByPath method for a path that has no matching alias.
File
- core/
tests/ Drupal/ Tests/ UnitTestCase.php, line 66 - Contains \Drupal\Tests\UnitTestCase.
Class
- UnitTestCase
- Provides a base class and helpers for Drupal unit tests.
Namespace
Drupal\TestsCode
public function randomMachineName($length = 8) {
return $this
->getRandomGenerator()
->name($length, TRUE);
}