本文整理汇总了PHP中ApiTestCase::users方法的典型用法代码示例。如果您正苦于以下问题:PHP ApiTestCase::users方法的具体用法?PHP ApiTestCase::users怎么用?PHP ApiTestCase::users使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiTestCase
的用法示例。
在下文中一共展示了ApiTestCase::users方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
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', 'api_test_sysop@example.com', array('sysop')), 'uploader' => new TestUser('Apitestuser', 'Api Test User', 'api_test_user@example.com', array()));
$this->setMwGlobals(array('wgAuth' => new StubObject('wgAuth', 'AuthPlugin'), 'wgRequest' => new FauxRequest(array()), 'wgUser' => self::$users['sysop']->user));
$this->apiContext = new ApiTestContext();
}
示例2: setUp
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();
}
示例3: setUp
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', 'api_test_sysop@sample.com', array('sysop')), 'uploader' => new ApiTestUser('Apitestuser', 'Api Test User', 'api_test_user@sample.com', array()));
$wgUser = self::$users['sysop']->user;
}
示例4: setUp
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', 'api_test_sysop@example.com', array('sysop')), 'uploader' => new TestUser('Apitestuser', 'Api Test User', 'api_test_user@example.com', array()));
$wgUser = self::$users['sysop']->user;
$this->apiContext = new ApiTestContext();
}