Index: trunk/phase3/tests/phpunit/includes/ArticleTablesTest.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | global $wgLanguageCode, $wgContLang, $wgLang; |
18 | 18 | $wgLanguageCode = $this->languageCode; |
19 | 19 | $wgContLang = Language::factory( $wgLanguageCode ); |
20 | | - $wgLang = RequestContext::getMain()->getLang(); |
| 20 | + $wgLang = new StubUserLang; |
21 | 21 | } |
22 | 22 | |
23 | 23 | /** |
Index: trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | |
78 | 78 | // $tmpGlobals['wgContLang'] = new StubContLang; |
79 | 79 | $tmpGlobals['wgUser'] = new User; |
80 | | - $tmpGlobals['wgLang'] = Language::factory( 'en' ); |
| 80 | + $tmpGlobals['wgLang'] = new StubUserLang; |
81 | 81 | $tmpGlobals['wgOut'] = new StubObject( 'wgOut', 'OutputPage' ); |
82 | 82 | $tmpGlobals['wgParser'] = new StubObject( 'wgParser', $GLOBALS['wgParserConf']['class'], array( $GLOBALS['wgParserConf'] ) ); |
83 | 83 | $tmpGlobals['wgRequest'] = new WebRequest; |
Index: trunk/phase3/tests/phpunit/suites/UploadFromUrlTestSuite.php |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | |
50 | 50 | // $wgContLang = new StubContLang; |
51 | 51 | $wgUser = new User; |
52 | | - $wgLang = Language::factory( 'en' ); |
| 52 | + $wgLang = new StubUserLang; |
53 | 53 | $wgOut = new StubObject( 'wgOut', 'OutputPage' ); |
54 | 54 | $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); |
55 | 55 | $wgRequest = new WebRequest; |
Index: trunk/phase3/tests/parser/parserTest.inc |
— | — | @@ -166,7 +166,7 @@ |
167 | 167 | |
168 | 168 | // $wgContLang = new StubContLang; |
169 | 169 | $wgUser = new User; |
170 | | - $wgLang = Language::factory( 'en' ); |
| 170 | + $wgLang = new StubUserLang; |
171 | 171 | $wgOut = new StubObject( 'wgOut', 'OutputPage' ); |
172 | 172 | $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); |
173 | 173 | $wgRequest = new WebRequest; |
Index: trunk/phase3/includes/StubObject.php |
— | — | @@ -136,8 +136,6 @@ |
137 | 137 | * Stub object for the user language. It depends of the user preferences and |
138 | 138 | * "uselang" parameter that can be passed to index.php. This object have to be |
139 | 139 | * in $wgLang global. |
140 | | - * |
141 | | - * @deprecated since 1.18 |
142 | 140 | */ |
143 | 141 | class StubUserLang extends StubObject { |
144 | 142 | |
Index: trunk/phase3/includes/Message.php |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | * @return Message: $this |
210 | 210 | */ |
211 | 211 | public function inLanguage( $lang ) { |
212 | | - if ( $lang instanceof Language ) { |
| 212 | + if ( $lang instanceof Language || $lang instanceof StubUserLang ) { |
213 | 213 | $this->language = $lang; |
214 | 214 | } elseif ( is_string( $lang ) ) { |
215 | 215 | if( $this->language->getCode() != $lang ) { |
Index: trunk/phase3/includes/Setup.php |
— | — | @@ -408,7 +408,7 @@ |
409 | 409 | /** |
410 | 410 | * @var Language |
411 | 411 | */ |
412 | | -$wgLang = RequestContext::getMain()->getLang(); |
| 412 | +$wgLang = new StubUserLang; |
413 | 413 | |
414 | 414 | /** |
415 | 415 | * @var OutputPage |