Index: trunk/phase3/tests/phpunit/includes/HtmlTest.php |
— | — | @@ -4,6 +4,7 @@ |
5 | 5 | class HtmlTest extends MediaWikiTestCase { |
6 | 6 | private static $oldLang; |
7 | 7 | private static $oldContLang; |
| 8 | + private static $oldLanguageCode; |
8 | 9 | private static $oldNamespaces; |
9 | 10 | |
10 | 11 | public function setUp() { |
— | — | @@ -11,6 +12,8 @@ |
12 | 13 | |
13 | 14 | self::$oldLang = $wgLang; |
14 | 15 | self::$oldContLang = $wgContLang; |
| 16 | + self::$oldNamespaces = $wgContLang->namespaceNames; |
| 17 | + self::$oldLanguageCode = $wgLanguageCode; |
15 | 18 | |
16 | 19 | $wgLanguageCode = 'en'; |
17 | 20 | $wgContLang = $wgLang = Language::factory( $wgLanguageCode ); |
— | — | @@ -18,7 +21,6 @@ |
19 | 22 | // Hardcode namespaces during test runs, |
20 | 23 | // so that html output based on existing namespaces |
21 | 24 | // can be properly evaluated. |
22 | | - self::$oldNamespaces = $wgContLang->namespaceNames; |
23 | 25 | $wgContLang->namespaceNames = array( |
24 | 26 | -2 => 'Media', |
25 | 27 | -1 => 'Special', |
— | — | @@ -41,10 +43,11 @@ |
42 | 44 | |
43 | 45 | public function tearDown() { |
44 | 46 | global $wgLang, $wgContLang, $wgLanguageCode; |
| 47 | + |
| 48 | + $wgContLang->namespaceNames = self::$oldNamespaces; |
45 | 49 | $wgLang = self::$oldLang; |
46 | 50 | $wgContLang = self::$oldContLang; |
47 | | - $wgLanguageCode = $wgContLang->getCode(); |
48 | | - $wgContLang->namespaceNames = self::$oldNamespaces; |
| 51 | + $wgLanguageCode = self::$oldLanguageCode; |
49 | 52 | } |
50 | 53 | |
51 | 54 | public function testExpandAttributesSkipsNullAndFalse() { |