ini_set( 'log_errors', 1 );
ini_set( 'error_reporting', 1 );
ini_set( 'display_errors', 1 );
+
+ global $wgMemc;
+ $wgMemc = new FakeMemCachedClient;
}
+ function tearDown() {
+ global $wgMemc;
+
+ $wgMemc = null;
+ }
+
+
function doApiRequest( $params, $data = null ) {
$_SESSION = isset( $data[2] ) ? $data[2] : array();
* Parser-related tests that don't suit for parserTests.txt
*/
- class ExtraParserTest extends PHPUnit_Framework_TestCase {
+class ExtraParserTest extends PHPUnit_Framework_TestCase {
+
+ function setUp() {
+ global $wgMemc;
+
+ $wgMemc = new FakeMemCachedClient;
+ }
+
+ function tearDown() {
+ global $wgMemc;
+
+ $wgMemc = null;
+ }
// Bug 8689 - Long numeric lines kill the parser
function testBug8689() {
$this->assertEquals( "<p>$longLine</p>",
$parser->parse( $longLine, $t, $options )->getText() );
}
- }
\ No newline at end of file
+ }
}
function tearDown() {
- global $wgMemc;
+ global $wgMemc, $wgContLang;
unset( $wgMemc );
unset( $this->lc );
unset( $this->lang );
+ $wgContLang = null;
}
function testGetPreferredVariantDefaults() {
<?php
class MessageTest extends PHPUnit_Framework_TestCase {
+
+ function setUp() {
+ global $wgContLanguageCode;
+
+ $wgContLanguageCode = 'en'; # For mainpage to be 'Main Page'
+ }
+
function testExists() {
$this->assertTrue( Message::key( 'mainpage' )->exists() );
$this->assertTrue( Message::key( 'mainpage' )->params( array() )->exists() );
function testInLanguageThrows() {
Message::key( 'foo' )->inLanguage( 123 );
}
-}
\ No newline at end of file
+}
}
unset( $this->db );
unset( $this->search );
+ $GLOBALS['wgContLang'] = null;
}
}
}
function setUp() {
- global $wgSearchType, $wgDBtype, $wgLBFactoryConf, $wgDBservers;
+ global $wgSearchType, $wgDBtype, $wgLBFactoryConf, $wgDBservers, $wgContLang;
self::$searchType = $wgSearchType;
self::$dbtype = $wgDBtype;
$wgDBtype = 'mock';
$wgLBFactoryConf['class'] = 'LBFactory_Simple';
$wgDBservers = null;
+ $wgContLang = Language::factory( 'en' );
LBFactory::destroyInstance();
}
$wgDBtype = self::$dbtype;
$wgLBFactoryConf = self::$factoryconf;
$wgDBservers = self::$dbservers;
+ $wgContLang = null;
}
function testUpdateText() {
static $altUserName;
function setUp() {
- global $wgLocaltimezone, $wgLocalTZoffset;
+ global $wgLocaltimezone, $wgLocalTZoffset, $wgMemc, $wgContLang, $wgLang, $wgMessageCache;
+
+ $wgMemc = new FakeMemCachedClient;
+ $wgMessageCache = new MessageCache( $wgMemc, true, 3600 );
+ $wgContLang = $wgLang = Language::factory( 'en' );
+
self::$userName = "Useruser";
self::$altUserName = "Altuseruser";
date_default_timezone_set( $wgLocaltimezone );
}
}
+ function tearDown() {
+ global $wgMemc, $wgContLang, $wgLang;
+ $wgMemc = $wgContLang = $wgLang = null;
+ }
+
function setUserPerm( $perm ) {
if ( is_array( $perm ) ) {
self::$user->mRights = $perm;
# $user->blockedFor() == ''
# $user->mBlock->mExpiry == 'infinity'
}
-}
\ No newline at end of file
+}
function setUp() {
+ global $wgContLang;
parent::setup();
+ $wgContLang = Language::factory( 'en' );
$this->upload = new UploadTestHandler;
}