Readd r90538, this time with the missing global $wgHooks;
authorPlatonides <platonides@users.mediawiki.org>
Wed, 22 Jun 2011 21:02:07 +0000 (21:02 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 22 Jun 2011 21:02:07 +0000 (21:02 +0000)
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/TitlePermissionTest.php
tests/phpunit/includes/UploadTest.php

index a88c357..64cb486 100644 (file)
@@ -231,5 +231,9 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                MediaWikiPHPUnitCommand::$additionalOptions[$offset] = $value;
 
        }
+
+       public static function disableInterwikis( $prefix, &$data ) {
+               return false;
+       }
 }
 
index 2b920f5..753709c 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * @group Database
  */
-class TitlePermissionTest extends MediaWikiTestCase {
+class TitlePermissionTest extends MediaWikiLangTestCase {
        protected $title;
        protected $user;
        protected $anonUser;
@@ -14,6 +14,7 @@ class TitlePermissionTest extends MediaWikiTestCase {
 
        function setUp() {
                global $wgLocaltimezone, $wgLocalTZoffset, $wgMemc, $wgContLang, $wgLang;
+               parent::setUp();
 
                if(!$wgMemc) {
                        $wgMemc = new EmptyBagOStuff;
@@ -50,6 +51,10 @@ class TitlePermissionTest extends MediaWikiTestCase {
                }
        }
 
+       function tearDown() {
+               parent::tearDown();
+       }
+
        function setUserPerm( $perm ) {
                if ( is_array( $perm ) ) {
                        $this->user->mRights = $perm;
index da19c90..17b3bc7 100644 (file)
@@ -7,10 +7,17 @@ class UploadTest extends MediaWikiTestCase {
 
 
        function setUp() {
-               global $wgContLang;
+               global $wgHooks;
                parent::setUp();
-               $wgContLang = Language::factory( 'en' );
+
                $this->upload = new UploadTestHandler;
+               $this->hooks = $wgHooks;var_dump($wgHooks);
+               $wgHooks['InterwikiLoadPrefix'][] = 'MediaWikiTestCase::disableInterwikis';
+       }
+
+       function tearDown() {
+               global $wgHooks;
+               $wgHooks = $this->hooks;
        }
 
        /**