dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Makes WebRequest::detectProtocolAndStdPort() take HTTP_X_FORWARDED_PROTO heade...
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
MediaWikiLangTestCase.php
diff --git
a/tests/phpunit/MediaWikiLangTestCase.php
b/tests/phpunit/MediaWikiLangTestCase.php
index
78b85c5
..
3034601
100644
(file)
--- a/
tests/phpunit/MediaWikiLangTestCase.php
+++ b/
tests/phpunit/MediaWikiLangTestCase.php
@@
-4,29
+4,26
@@
* Base class that store and restore the Language objects
*/
abstract class MediaWikiLangTestCase extends MediaWikiTestCase {
* Base class that store and restore the Language objects
*/
abstract class MediaWikiLangTestCase extends MediaWikiTestCase {
- private static $oldLang;
- private static $oldContLang;
- public function setUp() {
- global $wgLanguageCode, $wgLang, $wgContLang;
+ protected function setUp() {
+ global $wgLanguageCode, $wgContLang;
+ parent::setUp();
- self::$oldLang = $wgLang;
- self::$oldContLang = $wgContLang;
+ if ( $wgLanguageCode != $wgContLang->getCode() ) {
+ throw new MWException("Error in MediaWikiLangTestCase::setUp(): " .
+ "\$wgLanguageCode ('$wgLanguageCode') is different from " .
+ "\$wgContLang->getCode() (" . $wgContLang->getCode() . ")" );
+ }
- if( $wgLanguageCode != $wgContLang->getCode() ) die("nooo!");
+ $langCode = 'en'; # For mainpage to be 'Main Page'
+ $langObj = Language::factory( $langCode );
- $wgLanguageCode = 'en'; # For mainpage to be 'Main Page'
+ $this->setMwGlobals( array(
+ 'wgLanguageCode' => $langCode,
+ 'wgLang' => $langObj,
+ 'wgContLang' => $langObj,
+ ) );
- $wgContLang = $wgLang = Language::factory( $wgLanguageCode );
MessageCache::singleton()->disable();
}
MessageCache::singleton()->disable();
}
-
- public function tearDown() {
- global $wgContLang, $wgLang, $wgLanguageCode;
- $wgLang = self::$oldLang;
-
- $wgContLang = self::$oldContLang;
- $wgLanguageCode = $wgContLang->getCode();
- }
-
}
}