function RandomTest::testRandomStringValidator
Tests random string validation callbacks.
@covers ::string
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ RandomTest.php, line 185
Class
- RandomTest
- Tests random data generation.
Namespace
Drupal\Tests\Component\UtilityCode
public function testRandomStringValidator() : void {
$random = new Random();
$this->firstStringGenerated = '';
$str = $random->string(1, TRUE, [
$this,
'_RandomStringValidate',
]);
$this->assertNotEquals($this->firstStringGenerated, $str);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.