本文整理汇总了PHP中MediaWikiTestCase::setUpBeforeClass方法的典型用法代码示例。如果您正苦于以下问题:PHP MediaWikiTestCase::setUpBeforeClass方法的具体用法?PHP MediaWikiTestCase::setUpBeforeClass怎么用?PHP MediaWikiTestCase::setUpBeforeClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaWikiTestCase
的用法示例。
在下文中一共展示了MediaWikiTestCase::setUpBeforeClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
foreach (self::$startGlobals as $key => $value) {
$GLOBALS[$key] = $value;
}
}
示例2: setUpBeforeClass
/**
* Setup the centralauth tables in the current db, so we don't have
* to worry about rights on another database. The first time it's called
* we have to set the DB prefix ourselves, and reset it back to the original
* so that CloneDatabase will work. On subsequent runs, the prefix is already
* setup for us.
*/
public static function setUpBeforeClass()
{
global $wgCentralAuthDatabase;
parent::setUpBeforeClass();
if (is_null(self::$centralAuthDatabase)) {
self::$centralAuthDatabase = $wgCentralAuthDatabase;
}
$wgCentralAuthDatabase = false;
// use the current wiki db
$db = wfGetDB(DB_MASTER);
if ($db->tablePrefix() !== MediaWikiTestCase::DB_PREFIX) {
$originalPrefix = $db->tablePrefix();
$db->tablePrefix(MediaWikiTestCase::DB_PREFIX);
if (!$db->tableExists('globaluser')) {
$db->sourceFile(__DIR__ . '/../../central-auth.sql');
}
$db->tablePrefix($originalPrefix);
} else {
$db->sourceFile(__DIR__ . '/../../central-auth.sql');
}
}
开发者ID:NDKilla,项目名称:mediawiki-extensions-CentralAuth,代码行数:28,代码来源:CentralAuthTestCaseUsingDatabase.php
示例3: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
MWDebug::init();
MediaWiki\suppressWarnings();
}
示例4: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$GLOBALS[self::GLOBAL_KEY_EXISTING] = 'foo';
}