r114224 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114223‎ | r114224 | r114225 >
Date:00:28, 20 March 2012
Author:tstarling
Status:ok
Tags:
Comment:
Fixed attempt to write to the wiki's upload directory during parser tests instead of /tmp, this is not allowed. I'm not sure what setupGlobals() is meant to do nowadays, that part is untested. It seems to be duplicated in ParserTest::__construct().
Modified paths:
  • /trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php (modified) (history)
  • /trunk/phase3/tests/parser/parserTest.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/parser/parserTest.inc
@@ -140,7 +140,7 @@
141141 $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
142142 $parserMemc, $wgThumbnailScriptPath, $wgScriptPath,
143143 $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath, $wgExtensionAssetsPath,
144 - $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType;
 144+ $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType, $wgLockManagers;
145145
146146 $wgScript = '/index.php';
147147 $wgScriptPath = '/';
@@ -149,6 +149,11 @@
150150 $wgStylePath = '/skins';
151151 $wgExtensionAssetsPath = '/extensions';
152152 $wgThumbnailScriptPath = false;
 153+ $wgLockManagers = array( array(
 154+ 'name' => 'fsLockManager',
 155+ 'class' => 'FSLockManager',
 156+ 'lockDirectory' => wfTempDir() . '/test-repo/lockdir',
 157+ ) );
153158 $wgLocalFileRepo = array(
154159 'class' => 'LocalRepo',
155160 'name' => 'local',
@@ -627,6 +632,11 @@
628633 'wgScriptPath' => '/',
629634 'wgArticlePath' => '/wiki/$1',
630635 'wgActionPaths' => array(),
 636+ 'wgLockManagers' => array(
 637+ 'name' => 'fsLockManager',
 638+ 'class' => 'FSLockManager',
 639+ 'lockDirectory' => $this->uploadDir . '/lockdir',
 640+ ),
631641 'wgLocalFileRepo' => array(
632642 'class' => 'LocalRepo',
633643 'name' => 'local',
@@ -951,6 +961,8 @@
952962 */
953963 private function teardownGlobals() {
954964 RepoGroup::destroySingleton();
 965+ FileBackendGroup::destroySingleton();
 966+ LockManagerGroup::destroySingleton();
955967 LinkCache::singleton()->clear();
956968
957969 foreach ( $this->savedGlobals as $var => $val ) {
Index: trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php
@@ -31,6 +31,14 @@
3232 }
3333
3434 /**
 35+ * Destroy the singleton instance, so that a new one will be created next
 36+ * time singleton() is called.
 37+ */
 38+ public static function destroySingleton() {
 39+ self::$instance = null;
 40+ }
 41+
 42+ /**
3543 * Register lock managers from the global variables
3644 *
3745 * @return void

Status & tagging log