Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
17df77c3
Commit
17df77c3
authored
15 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#295864
follow-up by boombatower: Clarify when to use randomName() vs. randomString().
parent
508eaa90
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/simpletest/drupal_web_test_case.php
+6
-3
6 additions, 3 deletions
modules/simpletest/drupal_web_test_case.php
with
6 additions
and
3 deletions
modules/simpletest/drupal_web_test_case.php
+
6
−
3
View file @
17df77c3
...
...
@@ -644,7 +644,8 @@ protected function drupalCompareFiles($file1, $file2) {
* Generates a random string of ASCII characters of codes 32 to 126.
*
* The generated string includes alpha-numeric characters and common misc
* characters.
* characters. Use this method when testing general input where the content
* is not restricted.
*
* @param $length
* Length of random string to generate which will be appended to $db_prefix.
...
...
@@ -665,7 +666,9 @@ public static function randomString($length = 8) {
* Generates a random string containing letters and numbers.
*
* The letters may be upper or lower case. This method is better for
* restricted inputs that do not accept certain characters.
* restricted inputs that do not accept certain characters. For example,
* when testing input fields that require machine readable values (ie without
* spaces and non-standard characters) this method is best.
*
* @param $length
* Length of random string to generate which will be appended to $db_prefix.
...
...
@@ -682,7 +685,7 @@ public static function randomName($length = 8) {
$str
.
=
chr
(
$values
[
mt_rand
(
0
,
$max
)]);
}
return
str_replace
(
'simpletest'
,
's'
,
$db_prefix
)
.
$str
;
}
}
/**
* Create a user with a given set of permissions. The permissions correspond to the
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment