- Since
- 1.28
Definition at line 6 of file TestUserRegistry.php.
◆ clear()
static TestUserRegistry::clear |
( |
| ) |
|
|
static |
Clear the registry.
TestUsers created by this class will not be deleted, but any handles to existing immutable TestUsers will be deleted, ensuring these users are not reused. We don't reset the counter or random string by design.
- Since
- 1.28
- Parameters
-
string[] | $groups | Groups the test user should be added to. |
- Returns
- TestUser
Definition at line 105 of file TestUserRegistry.php.
◆ getImmutableTestUser()
static TestUserRegistry::getImmutableTestUser |
( |
|
$groups = [] | ) |
|
|
static |
Get a TestUser object that the caller may not modify.
Whenever possible, unit tests should use immutable users, because immutable users can be reused in multiple tests, which helps keep the unit tests fast.
- Since
- 1.28
- Parameters
-
string | string[] | $groups | Groups the test user should be added to. |
- Returns
- TestUser
Definition at line 60 of file TestUserRegistry.php.
References $username, array(), and wfRandomString().
◆ getMutableTestUser()
static TestUserRegistry::getMutableTestUser |
( |
|
$testName, |
|
|
|
$groups = [] |
|
) |
| |
|
static |
◆ getNextId()
static TestUserRegistry::getNextId |
( |
| ) |
|
|
static |
◆ isMutable()
static TestUserRegistry::isMutable |
( |
User |
$user | ) |
|
|
static |
- Todo:
- It would be nice if this were a non-static method of TestUser instead, but that doesn't seem possible without friends?
- Returns
- bool True if it's safe to modify the user
Definition at line 115 of file TestUserRegistry.php.
References $user, and as.
◆ $counter
int TestUserRegistry::$counter = 0 |
|
staticprivate |
◆ $randInt
int TestUserRegistry::$randInt |
|
staticprivate |
◆ $testUsers
TestUser [] TestUserRegistry::$testUsers = [] |
|
staticprivate |
The documentation for this class was generated from the following file: