Index: trunk/phase3/maintenance/tests/ApiWatchTest.php |
— | — | @@ -6,8 +6,18 @@ |
7 | 7 | ini_set( 'log_errors', 1 ); |
8 | 8 | ini_set( 'error_reporting', 1 ); |
9 | 9 | ini_set( 'display_errors', 1 ); |
| 10 | + |
| 11 | + global $wgMemc; |
| 12 | + $wgMemc = new FakeMemCachedClient; |
10 | 13 | } |
11 | 14 | |
| 15 | + function tearDown() { |
| 16 | + global $wgMemc; |
| 17 | + |
| 18 | + $wgMemc = null; |
| 19 | + } |
| 20 | + |
| 21 | + |
12 | 22 | function doApiRequest( $params, $data = null ) { |
13 | 23 | $_SESSION = isset( $data[2] ) ? $data[2] : array(); |
14 | 24 | |
Index: trunk/phase3/maintenance/tests/ExtraParserTest.php |
— | — | @@ -3,8 +3,20 @@ |
4 | 4 | * Parser-related tests that don't suit for parserTests.txt |
5 | 5 | */ |
6 | 6 | |
7 | | - class ExtraParserTest extends PHPUnit_Framework_TestCase { |
| 7 | +class ExtraParserTest extends PHPUnit_Framework_TestCase { |
8 | 8 | |
| 9 | + function setUp() { |
| 10 | + global $wgMemc; |
| 11 | + |
| 12 | + $wgMemc = new FakeMemCachedClient; |
| 13 | + } |
| 14 | + |
| 15 | + function tearDown() { |
| 16 | + global $wgMemc; |
| 17 | + |
| 18 | + $wgMemc = null; |
| 19 | + } |
| 20 | + |
9 | 21 | // Bug 8689 - Long numeric lines kill the parser |
10 | 22 | function testBug8689() { |
11 | 23 | $longLine = '1.' . str_repeat( '1234567890', 100000 ) . "\n"; |
— | — | @@ -15,4 +27,4 @@ |
16 | 28 | $this->assertEquals( "<p>$longLine</p>", |
17 | 29 | $parser->parse( $longLine, $t, $options )->getText() ); |
18 | 30 | } |
19 | | - } |
\ No newline at end of file |
| 31 | + } |
Index: trunk/phase3/maintenance/tests/SearchDbTest.php |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | } |
26 | 26 | unset( $this->db ); |
27 | 27 | unset( $this->search ); |
| 28 | + $GLOBALS['wgContLang'] = null; |
28 | 29 | } |
29 | 30 | } |
30 | 31 | |
Index: trunk/phase3/maintenance/tests/LanguageConverterTest.php |
— | — | @@ -17,10 +17,11 @@ |
18 | 18 | } |
19 | 19 | |
20 | 20 | function tearDown() { |
21 | | - global $wgMemc; |
| 21 | + global $wgMemc, $wgContLang; |
22 | 22 | unset( $wgMemc ); |
23 | 23 | unset( $this->lc ); |
24 | 24 | unset( $this->lang ); |
| 25 | + $wgContLang = null; |
25 | 26 | } |
26 | 27 | |
27 | 28 | function testGetPreferredVariantDefaults() { |
Index: trunk/phase3/maintenance/tests/UploadTest.php |
— | — | @@ -7,7 +7,9 @@ |
8 | 8 | |
9 | 9 | |
10 | 10 | function setUp() { |
| 11 | + global $wgContLang; |
11 | 12 | parent::setup(); |
| 13 | + $wgContLang = Language::factory( 'en' ); |
12 | 14 | $this->upload = new UploadTestHandler; |
13 | 15 | } |
14 | 16 | |
Index: trunk/phase3/maintenance/tests/MessageTest.php |
— | — | @@ -1,6 +1,13 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class MessageTest extends PHPUnit_Framework_TestCase { |
| 5 | + |
| 6 | + function setUp() { |
| 7 | + global $wgContLanguageCode; |
| 8 | + |
| 9 | + $wgContLanguageCode = 'en'; # For mainpage to be 'Main Page' |
| 10 | + } |
| 11 | + |
5 | 12 | function testExists() { |
6 | 13 | $this->assertTrue( Message::key( 'mainpage' )->exists() ); |
7 | 14 | $this->assertTrue( Message::key( 'mainpage' )->params( array() )->exists() ); |
— | — | @@ -30,4 +37,4 @@ |
31 | 38 | function testInLanguageThrows() { |
32 | 39 | Message::key( 'foo' )->inLanguage( 123 ); |
33 | 40 | } |
34 | | -} |
\ No newline at end of file |
| 41 | +} |
Index: trunk/phase3/maintenance/tests/TitlePermissionTest.php |
— | — | @@ -10,7 +10,12 @@ |
11 | 11 | static $altUserName; |
12 | 12 | |
13 | 13 | function setUp() { |
14 | | - global $wgLocaltimezone, $wgLocalTZoffset; |
| 14 | + global $wgLocaltimezone, $wgLocalTZoffset, $wgMemc, $wgContLang, $wgLang, $wgMessageCache; |
| 15 | + |
| 16 | + $wgMemc = new FakeMemCachedClient; |
| 17 | + $wgMessageCache = new MessageCache( $wgMemc, true, 3600 ); |
| 18 | + $wgContLang = $wgLang = Language::factory( 'en' ); |
| 19 | + |
15 | 20 | self::$userName = "Useruser"; |
16 | 21 | self::$altUserName = "Altuseruser"; |
17 | 22 | date_default_timezone_set( $wgLocaltimezone ); |
— | — | @@ -39,6 +44,11 @@ |
40 | 45 | } |
41 | 46 | } |
42 | 47 | |
| 48 | + function tearDown() { |
| 49 | + global $wgMemc, $wgContLang, $wgLang; |
| 50 | + $wgMemc = $wgContLang = $wgLang = null; |
| 51 | + } |
| 52 | + |
43 | 53 | function setUserPerm( $perm ) { |
44 | 54 | if ( is_array( $perm ) ) { |
45 | 55 | self::$user->mRights = $perm; |
— | — | @@ -638,4 +648,4 @@ |
639 | 649 | # $user->blockedFor() == '' |
640 | 650 | # $user->mBlock->mExpiry == 'infinity' |
641 | 651 | } |
642 | | -} |
\ No newline at end of file |
| 652 | +} |
Index: trunk/phase3/maintenance/tests/SearchUpdateTest.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | } |
64 | 64 | |
65 | 65 | function setUp() { |
66 | | - global $wgSearchType, $wgDBtype, $wgLBFactoryConf, $wgDBservers; |
| 66 | + global $wgSearchType, $wgDBtype, $wgLBFactoryConf, $wgDBservers, $wgContLang; |
67 | 67 | |
68 | 68 | self::$searchType = $wgSearchType; |
69 | 69 | self::$dbtype = $wgDBtype; |
— | — | @@ -73,6 +73,7 @@ |
74 | 74 | $wgDBtype = 'mock'; |
75 | 75 | $wgLBFactoryConf['class'] = 'LBFactory_Simple'; |
76 | 76 | $wgDBservers = null; |
| 77 | + $wgContLang = Language::factory( 'en' ); |
77 | 78 | LBFactory::destroyInstance(); |
78 | 79 | } |
79 | 80 | |
— | — | @@ -85,6 +86,7 @@ |
86 | 87 | $wgDBtype = self::$dbtype; |
87 | 88 | $wgLBFactoryConf = self::$factoryconf; |
88 | 89 | $wgDBservers = self::$dbservers; |
| 90 | + $wgContLang = null; |
89 | 91 | } |
90 | 92 | |
91 | 93 | function testUpdateText() { |