MediaWiki REL1_33
|
Static Public Member Functions | |
static | clear () |
Clear the registry. | |
static | getImmutableTestUser ( $groups=[]) |
Get a TestUser object that the caller may not modify. | |
static | getMutableTestUser ( $testName, $groups=[]) |
Get a TestUser object that the caller may modify. | |
static | getNextId () |
static | isMutable (User $user) |
Static Private Attributes | |
static int | $counter = 0 |
Count of users that have been generated. | |
static int | $randInt |
Random int, included in IDs. | |
static TestUser[] | $testUsers = [] |
(group key => TestUser) | |
Definition at line 6 of file TestUserRegistry.php.
|
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.
string[] | $groups | Groups the test user should be added to. |
Definition at line 105 of file TestUserRegistry.php.
|
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.
string | string[] | $groups | Groups the test user should be added to. |
Definition at line 60 of file TestUserRegistry.php.
References $username, and(), array(), and wfRandomString().
|
static |
Get a TestUser object that the caller may modify.
string | $testName | Caller's CLASS. Used to generate the user's username. |
string | string[] | $groups | Groups the test user should be added to. |
Definition at line 34 of file TestUserRegistry.php.
References array(), and wfRandomString().
Referenced by MediaWiki\Tests\Revision\RevisionStoreDbTestBase\testNewNullRevision(), and MediaWiki\Tests\Revision\RevisionStoreDbTestBase\testNewNullRevision_nonExistingTitle().
|
static |
Definition at line 17 of file TestUserRegistry.php.
References and().
|
static |
Definition at line 115 of file TestUserRegistry.php.
|
staticprivate |
Count of users that have been generated.
Definition at line 12 of file TestUserRegistry.php.
|
staticprivate |
Random int, included in IDs.
Definition at line 15 of file TestUserRegistry.php.
|
staticprivate |
(group key => TestUser)
Definition at line 9 of file TestUserRegistry.php.