<?php
-require_once( 'UploadFromUrlTest.php' );
-
class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite
{
public static function addTables( &$tables ) {
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 = '/';
$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 ) );
$wgMessageCache = new StubObject( 'wgMessageCache', 'MessageCache',
array( $messageMemc, $wgUseDatabaseMessages,
- $wgMsgCacheExpiry, wfWikiID() ) );
+ $wgMsgCacheExpiry ) );
if ( $wgStyleDirectory === false ) $wgStyleDirectory = "$IP/skins";
}
private $uploadDir;
private $keepUploads;
+
/**
* Remove the dummy uploads directory
*/
/**
* 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 ) {
}
}
}
+
/**
* 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 ) {
/**
* 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;
return $dir;
}
- public static function suite()
- {
- return new UploadFromUrlTestSuite( 'UploadFromUrlTest' );
- }
+ public static function suite()
+ {
+ return new UploadFromUrlTestSuite( 'UploadFromUrlTest' );
+ }
}