MediaWiki
1.28.0
|
Utility functions for Session unit tests. More...
Static Public Member Functions | |
static | getDummySession ($backend=null, $index=-1, $logger=null) |
If you need a Session for testing but don't want to create a backend to construct one, use this. More... | |
static | getDummySessionBackend () |
If you need a SessionBackend for testing but don't want to create a real one, use this. More... | |
static | setSessionManagerSingleton (SessionManager $manager=null) |
Override the singleton for unit testing. More... | |
Utility functions for Session unit tests.
Definition at line 10 of file TestUtils.php.
|
static |
If you need a Session for testing but don't want to create a backend to construct one, use this.
object | $backend | Object to serve as the SessionBackend |
int | $index | Index |
LoggerInterface | $logger |
Definition at line 85 of file TestUtils.php.
References class, and TestingAccessWrapper\newFromObject().
Referenced by MediaWiki\Session\SessionTest\testArrayAccess(), MediaWiki\Session\SessionTest\testClear(), MediaWiki\Session\SessionTest\testDataAccess(), MediaWiki\Session\SessionTest\testMethods(), MediaWiki\Session\SessionTest\testSecrets(), MediaWiki\Session\SessionTest\testSecretsRoundTripping(), MediaWiki\Session\SessionTest\testTokens(), and UserTest\testUserGetRightsHooks().
|
static |
If you need a SessionBackend for testing but don't want to create a real one, use this.
Definition at line 64 of file TestUtils.php.
References $ret, class, and TestingAccessWrapper\newFromObject().
Referenced by MediaWiki\Session\SessionTest\testConstructor(), MediaWiki\Session\SessionProviderTest\testGetAllowedUserRights(), and MediaWiki\Session\BotPasswordSessionProviderTest\testGetAllowedUserRights().
|
static |
Override the singleton for unit testing.
SessionManager | null | $manager |
Definition at line 17 of file TestUtils.php.
References as, class, MediaWiki\Session\PHPSessionHandler\install(), MediaWiki\Session\PHPSessionHandler\isInstalled(), and use.
Referenced by MediaWiki\Auth\AuthManagerTest\getMockSessionProvider(), MediaWiki\Session\SessionManagerTest\testGetGlobalSession(), BotPasswordTest\testLogin(), MediaWiki\Session\SessionBackendTest\testResetIdOfGlobalSession(), MediaWiki\Session\SessionManagerTest\testSingleton(), MediaWiki\Session\SessionBackendTest\testTakeOverGlobalSession(), and MediaWiki\Session\SessionBackendTest\testUnpersistOfGlobalSession().