18 if ( !self::$randInt ) {
19 self::$randInt =
mt_rand( 1, 0xFFFFFF );
21 return sprintf(
'%06x.%03x', self::$randInt, ++self::$counter );
35 $id = self::getNextId();
38 "TestUser $testName $id",
44 $testUser->getUser()->clearInstanceCache();
63 $key = implode(
',', $groups );
65 $testUser = self::$testUsers[$key] ??
false;
67 if ( !$testUser || !$testUser->getUser()->isLoggedIn() ) {
68 $id = self::getNextId();
73 if ( $groups === [
'bureaucrat',
'sysop' ] ) {
75 $password =
'UTSysopPassword';
80 self::$testUsers[$key] = $testUser =
new TestUser(
89 $testUser->getUser()->clearInstanceCache();
90 return self::$testUsers[$key];
106 self::$testUsers = [];
116 foreach ( self::$testUsers as $key => $testUser ) {
117 if ( $user === $testUser->getUser() ) {
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfRandomString( $length=32)
Get a random string containing a number of pseudo-random hex characters.
static int $randInt
Random int, included in IDs.
static clear()
Clear the registry.
static getMutableTestUser( $testName, $groups=[])
Get a TestUser object that the caller may modify.
static isMutable(User $user)
static getImmutableTestUser( $groups=[])
Get a TestUser object that the caller may not modify.
static TestUser[] $testUsers
(group key => TestUser)
static int $counter
Count of users that have been generated.
Wraps the user object, so we can also retain full access to properties like password if we log in via...
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
this hook is for auditing only or null if authentication failed before getting that far $username
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))