w/s changes
[lhc/web/wiklou.git] / maintenance / tests / UploadFromUrlTestSuite.php
index e9ddd96..8393eb7 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 
-require_once( 'UploadFromUrlTest.php' );
-
 class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
 {
        public static function addTables( &$tables ) {
@@ -15,11 +13,11 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
 
        function setUp() {
                global $wgParser,  $wgParserConf, $IP, $messageMemc, $wgMemc, $wgDeferredUpdateList,
-                  $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
-                  $wgMessageCache, $wgUseDatabaseMessages, $wgMsgCacheExpiry, $parserMemc,
-                  $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
-                  $wgNamespacesWithSubpages, $wgThumbnailScriptPath, $wgScriptPath,
-                  $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath;
+                                 $wgUser, $wgLang, $wgOut, $wgRequest, $wgStyleDirectory, $wgEnableParserCache,
+                                 $wgMessageCache, $wgUseDatabaseMessages, $wgMsgCacheExpiry, $parserMemc,
+                                 $wgNamespaceAliases, $wgNamespaceProtection, $wgLocalFileRepo,
+                                 $wgThumbnailScriptPath, $wgScriptPath,
+                                 $wgArticlePath, $wgStyleSheetPath, $wgScript, $wgStylePath;
 
                $wgScript = '/index.php';
                $wgScriptPath = '/';
@@ -47,8 +45,8 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
                $messageMemc =& wfGetMessageCacheStorage();
                $parserMemc =& wfGetParserCacheStorage();
 
-               $wgContLang = new StubContLang;
-               $wgUser = new StubUser;
+               //$wgContLang = new StubContLang;
+               $wgUser = new User;
                $wgLang = new StubUserLang;
                $wgOut = new StubObject( 'wgOut', 'OutputPage' );
                $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
@@ -56,7 +54,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
 
                $wgMessageCache = new StubObject( 'wgMessageCache', 'MessageCache',
                                                                                  array( $messageMemc, $wgUseDatabaseMessages,
-                                                                                                $wgMsgCacheExpiry, wfWikiID() ) );
+                                                                                                $wgMsgCacheExpiry ) );
                if ( $wgStyleDirectory === false ) $wgStyleDirectory   = "$IP/skins";
 
        }
@@ -67,6 +65,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
 
        private $uploadDir;
        private $keepUploads;
+
        /**
         * Remove the dummy uploads directory
         */
@@ -110,7 +109,8 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
 
        /**
         * Delete the specified files, if they exist.
-        * @param array $files full paths to files to delete.
+        *
+        * @param $files Array: full paths to files to delete.
         */
        private static function deleteFiles( $files ) {
                foreach ( $files as $file ) {
@@ -119,9 +119,11 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
                        }
                }
        }
+
        /**
         * Delete the specified directories, if they exist. Must be empty.
-        * @param array $dirs full paths to directories to delete.
+        *
+        * @param $dirs Array: full paths to directories to delete.
         */
        private static function deleteDirs( $dirs ) {
                foreach ( $dirs as $dir ) {
@@ -134,7 +136,8 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
        /**
         * Create a dummy uploads directory which will contain a couple
         * of files in order to pass existence tests.
-        * @return string The directory
+        *
+        * @return String: the directory
         */
        private function setupUploadDir() {
                global $IP;
@@ -160,10 +163,10 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
                return $dir;
        }
 
-    public static function suite()
-    {
-        return new UploadFromUrlTestSuite( 'UploadFromUrlTest' );
-    }
+       public static function suite()
+       {
+               return new UploadFromUrlTestSuite( 'UploadFromUrlTest' );
+       }
 
 }