*/
class TestUser {
/**
- * @deprecated Since 1.25. Use TestUser::getUser()->getName()
- * @private
* @var string
*/
- public $username;
+ private $username;
/**
- * @deprecated Since 1.25. Use TestUser::getPassword()
- * @private
* @var string
*/
- public $password;
+ private $password;
/**
- * @deprecated Since 1.25. Use TestUser::getUser()
- * @private
* @var User
*/
- public $user;
+ private $user;
private function assertNotReal() {
global $wgDBprefix;
$this->setMwGlobals( [
'wgAuth' => $wgDisableAuthManager ? new AuthPlugin : new MediaWiki\Auth\AuthManagerAuthPlugin,
'wgRequest' => new FauxRequest( [] ),
- 'wgUser' => self::$users['sysop']->user,
+ 'wgUser' => self::$users['sysop']->getUser(),
] );
$this->apiContext = new ApiTestContext();
return $data;
}
- protected function getTokenList( $user, $session = null ) {
+ protected function getTokenList( TestUser $user, $session = null ) {
$data = $this->doApiRequest( [
'action' => 'tokens',
'type' => 'edit|delete|protect|move|block|unblock|watch'
- ], $session, false, $user->user );
+ ], $session, false, $user->getUser() );
if ( !array_key_exists( 'tokens', $data[0] ) ) {
throw new MWException( 'Api failed to return a token list' );
}
}
- protected function runTokenTest( $user ) {
+ protected function runTokenTest( TestUser $user ) {
$tokens = $this->getTokenList( $user );
- $rights = $user->user->getRights();
+ $rights = $user->getUser()->getRights();
$this->assertArrayHasKey( 'edittoken', $tokens );
$this->assertArrayHasKey( 'movetoken', $tokens );
*/
class UploadStashTest extends MediaWikiTestCase {
/**
- * @var array Array of UploadStashTestUser
+ * @var TestUser[] Array of UploadStashTestUser
*/
public static $users;
* @todo give this test a real name explaining what is being tested here
*/
public function testBug29408() {
- $this->setMwGlobals( 'wgUser', self::$users['uploader']->user );
+ $this->setMwGlobals( 'wgUser', self::$users['uploader']->getUser() );
$repo = RepoGroup::singleton()->getLocalRepo();
$stash = new UploadStash( $repo );