Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / user / tests / src / Kernel / UserValidationTest.php
index f8be028f0e53150b5ccf8e9096883464e388b73b..4aa5850d1d9404b550ceb967c980ba1eff6b4257 100644 (file)
@@ -40,23 +40,29 @@ class UserValidationTest extends KernelTestBase {
    * Tests user name validation.
    */
   public function testUsernames() {
-    $test_cases = [ // '<username>' => array('<description>', 'assert<testName>'),
+    $test_cases = [
+      // '<username>' => ['<description>', 'assert<testName>'].
       'foo'                    => ['Valid username', 'assertNull'],
       'FOO'                    => ['Valid username', 'assertNull'],
       'Foo O\'Bar'             => ['Valid username', 'assertNull'],
       'foo@bar'                => ['Valid username', 'assertNull'],
       'foo@example.com'        => ['Valid username', 'assertNull'],
-      'foo@-example.com'       => ['Valid username', 'assertNull'], // invalid domains are allowed in usernames
+      // invalid domains are allowed in usernames.
+      'foo@-example.com'       => ['Valid username', 'assertNull'],
       'þòøÇߪř€'               => ['Valid username', 'assertNull'],
-      'foo+bar'                => ['Valid username', 'assertNull'], // '+' symbol is allowed
-      'ᚠᛇᚻ᛫ᛒᛦᚦ'                => ['Valid UTF8 username', 'assertNull'], // runes
+      // '+' symbol is allowed.
+      'foo+bar'                => ['Valid username', 'assertNull'],
+      // runes.
+      'ᚠᛇᚻ᛫ᛒᛦᚦ'                => ['Valid UTF8 username', 'assertNull'],
       ' foo'                   => ['Invalid username that starts with a space', 'assertNotNull'],
       'foo '                   => ['Invalid username that ends with a space', 'assertNotNull'],
       'foo  bar'               => ['Invalid username that contains 2 spaces \'&nbsp;&nbsp;\'', 'assertNotNull'],
       ''                       => ['Invalid empty username', 'assertNotNull'],
       'foo/'                   => ['Invalid username containing invalid chars', 'assertNotNull'],
-      'foo' . chr(0) . 'bar'   => ['Invalid username containing chr(0)', 'assertNotNull'], // NULL
-      'foo' . chr(13) . 'bar'  => ['Invalid username containing chr(13)', 'assertNotNull'], // CR
+      // NULL.
+      'foo' . chr(0) . 'bar'   => ['Invalid username containing chr(0)', 'assertNotNull'],
+      // CR.
+      'foo' . chr(13) . 'bar'  => ['Invalid username containing chr(13)', 'assertNotNull'],
       str_repeat('x', USERNAME_MAX_LENGTH + 1) => ['Invalid excessively long username', 'assertNotNull'],
     ];
     foreach ($test_cases as $name => $test_case) {