X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTestUserRegistry.php;h=40a5dc5c318147ef994c2c979edd1f6af328cab3;hb=8cfa62d8376bdcde687dad1837f08bac6f82f09e;hp=24aee24c9b572ce35354f6afbadaf5667bfe1483;hpb=15f6eff90c305d405fe4331c8a8dc8caa842e5b3;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/TestUserRegistry.php b/tests/phpunit/includes/TestUserRegistry.php index 24aee24c9b..40a5dc5c31 100644 --- a/tests/phpunit/includes/TestUserRegistry.php +++ b/tests/phpunit/includes/TestUserRegistry.php @@ -28,17 +28,17 @@ class TestUserRegistry { * * @param string $testName Caller's __CLASS__. Used to generate the * user's username. - * @param string[] $groups Groups the test user should be added to. + * @param string|string[] $groups Groups the test user should be added to. * @return TestUser */ public static function getMutableTestUser( $testName, $groups = [] ) { $id = self::getNextId(); - $password = wfRandomString( 20 ); + $password = "password_for_test_user_id_{$id}"; $testUser = new TestUser( "TestUser $testName $id", // username "Name $id", // real name "$id@mediawiki.test", // e-mail - $groups, // groups + (array)$groups, // groups $password // password ); $testUser->getUser()->clearInstanceCache(); @@ -54,11 +54,11 @@ class TestUserRegistry { * * @since 1.28 * - * @param string[] $groups Groups the test user should be added to. + * @param string|string[] $groups Groups the test user should be added to. * @return TestUser */ public static function getImmutableTestUser( $groups = [] ) { - $groups = array_unique( $groups ); + $groups = array_unique( (array)$groups ); sort( $groups ); $key = implode( ',', $groups ); @@ -75,7 +75,7 @@ class TestUserRegistry { $password = 'UTSysopPassword'; } else { $username = "TestUser $id"; - $password = wfRandomString( 20 ); + $password = "password_for_test_user_id_{$id}"; } self::$testUsers[$key] = $testUser = new TestUser( $username, // username