diff options
author | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
commit | fc7369835258467bf97eb64f184b93691f9a9fd5 (patch) | |
tree | daabd60089d2dd76d9f5fb416b005fbe159c799d /www/wiki/tests/phpunit/MediaWikiLangTestCase.php |
first commit
Diffstat (limited to 'www/wiki/tests/phpunit/MediaWikiLangTestCase.php')
-rw-r--r-- | www/wiki/tests/phpunit/MediaWikiLangTestCase.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/www/wiki/tests/phpunit/MediaWikiLangTestCase.php b/www/wiki/tests/phpunit/MediaWikiLangTestCase.php new file mode 100644 index 00000000..fd308b2d --- /dev/null +++ b/www/wiki/tests/phpunit/MediaWikiLangTestCase.php @@ -0,0 +1,24 @@ +<?php + +/** + * Base class that store and restore the Language objects + */ +abstract class MediaWikiLangTestCase extends MediaWikiTestCase { + protected function setUp() { + global $wgLanguageCode, $wgContLang; + + if ( $wgLanguageCode != $wgContLang->getCode() ) { + throw new MWException( "Error in MediaWikiLangTestCase::setUp(): " . + "\$wgLanguageCode ('$wgLanguageCode') is different from " . + "\$wgContLang->getCode() (" . $wgContLang->getCode() . ")" ); + } + + parent::setUp(); + + $this->setUserLang( 'en' ); + // For mainpage to be 'Main Page' + $this->setContentLang( 'en' ); + + MessageCache::singleton()->disable(); + } +} |