From d793cca59751b6aae8a6db2777ba91ad0b0f5ddc Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org> Date: Tue, 17 Sep 2013 10:12:09 +0100 Subject: [PATCH] Issue #2032453 by Berdir: Fixed Random fail: WebTestBase::randomString returning a string containing a $ followed by a number causes assertLink() to fail. --- core/tests/Drupal/Tests/Component/Utility/RandomTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/tests/Drupal/Tests/Component/Utility/RandomTest.php b/core/tests/Drupal/Tests/Component/Utility/RandomTest.php index b9c7a4ee784a..a3e7b8ca3b40 100644 --- a/core/tests/Drupal/Tests/Component/Utility/RandomTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/RandomTest.php @@ -169,7 +169,9 @@ public function testRandomStringValidator() { * TRUE if the random string is valid, FALSE if not. */ public function _RandomStringValidate($string) { - if (empty($this->firstStringGenerated)) { + // Return FALSE for the first generated string and any string that is the + // same, as the test expects a different string to be returned. + if (empty($this->firstStringGenerated) || $string == $this->firstStringGenerated) { $this->firstStringGenerated = $string; return FALSE; } -- GitLab