protected function setUp() { global $wgServer; parent::setUp(); self::$apiUrl = $wgServer . wfScript('api'); ApiQueryInfo::resetTokenCache(); // tokens are invalid because we cleared the session self::$users = array('sysop' => new TestUser('Apitestsysop', 'Api Test Sysop', '*****@*****.**', array('sysop')), 'uploader' => new TestUser('Apitestuser', 'Api Test User', '*****@*****.**', array())); $this->setMwGlobals(array('wgAuth' => new StubObject('wgAuth', 'AuthPlugin'), 'wgRequest' => new FauxRequest(array()), 'wgUser' => self::$users['sysop']->user)); $this->apiContext = new ApiTestContext(); }
protected function setUp() { global $wgServer, $wgDisableAuthManager; parent::setUp(); self::$apiUrl = $wgServer . wfScript('api'); ApiQueryInfo::resetTokenCache(); // tokens are invalid because we cleared the session self::$users = ['sysop' => static::getTestSysop(), 'uploader' => static::getTestUser()]; $this->setMwGlobals(['wgAuth' => $wgDisableAuthManager ? new AuthPlugin() : new MediaWiki\Auth\AuthManagerAuthPlugin(), 'wgRequest' => new FauxRequest([]), 'wgUser' => self::$users['sysop']->user]); $this->apiContext = new ApiTestContext(); }
function setUp() { global $wgContLang, $wgAuth, $wgMemc, $wgRequest, $wgUser, $wgServer; parent::setUp(); self::$apiUrl = $wgServer . wfScript('api'); $wgMemc = new EmptyBagOStuff(); $wgContLang = Language::factory('en'); $wgAuth = new StubObject('wgAuth', 'AuthPlugin'); $wgRequest = new FauxRequest(array()); self::$users = array('sysop' => new ApiTestUser('Apitestsysop', 'Api Test Sysop', '*****@*****.**', array('sysop')), 'uploader' => new ApiTestUser('Apitestuser', 'Api Test User', '*****@*****.**', array())); $wgUser = self::$users['sysop']->user; }
protected function setUp() { global $wgContLang, $wgAuth, $wgMemc, $wgRequest, $wgUser, $wgServer; parent::setUp(); self::$apiUrl = $wgServer . wfScript('api'); $wgMemc = new EmptyBagOStuff(); $wgContLang = Language::factory('en'); $wgAuth = new StubObject('wgAuth', 'AuthPlugin'); $wgRequest = new FauxRequest(array()); ApiQueryInfo::resetTokenCache(); // tokens are invalid because we cleared the session self::$users = array('sysop' => new TestUser('Apitestsysop', 'Api Test Sysop', '*****@*****.**', array('sysop')), 'uploader' => new TestUser('Apitestuser', 'Api Test User', '*****@*****.**', array())); $wgUser = self::$users['sysop']->user; $this->apiContext = new ApiTestContext(); }