public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     foreach (self::$startGlobals as $key => $value) {
         $GLOBALS[$key] = $value;
     }
 }
 /**
  * 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');
     }
 }
Exemple #3
0
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     MWDebug::init();
     MediaWiki\suppressWarnings();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     $GLOBALS[self::GLOBAL_KEY_EXISTING] = 'foo';
 }