diff --git a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php index 27807f5..4aeaaa7 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php @@ -176,9 +176,8 @@ public function testUIFieldAlias() { // Test a random aliases for fields, they should be replaced. $random_name = $this->randomName(); - // 91 to 96 is part of this::randomString() but not this::randomName() so - // this will be an invalid character. - $invalid_random_name = chr(rand(91, 96)) . $this->randomName(); + // Use # to produce an invalid character for the validation. + $invalid_random_name = '#' . $this->randomName(); $edit = array('row_options[aliases][name]' => $random_name, 'row_options[aliases][nothing]' => $invalid_random_name); $this->drupalPost($row_options, $edit, t('Apply')); $this->assertText(t('The machine-readable name must contain only letters, numbers, dashes and underscores.'));