MediaWiki
REL1_32
MediaWikiLangTestCase.php
Go to the documentation of this file.
1
<?php
2
3
use
MediaWiki\MediaWikiServices
;
4
8
abstract
class
MediaWikiLangTestCase
extends
MediaWikiTestCase
{
9
protected
function
setUp
() {
10
global
$wgLanguageCode
;
11
12
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
13
if
(
$wgLanguageCode
!= $contLang->getCode() ) {
14
throw
new
MWException
(
"Error in MediaWikiLangTestCase::setUp(): "
.
15
"\$wgLanguageCode ('$wgLanguageCode') is different from content language code ("
.
16
$contLang->getCode() .
")"
);
17
}
18
19
parent::setUp();
20
21
$this->
setUserLang
(
'en'
);
22
// For mainpage to be 'Main Page'
23
$this->
setContentLang
(
'en'
);
24
25
MessageCache::singleton()->disable();
26
}
27
}
$wgLanguageCode
$wgLanguageCode
Site language code.
Definition
DefaultSettings.php:2942
MWException
MediaWiki exception.
Definition
MWException.php:26
MediaWikiLangTestCase
Base class that store and restore the Language objects.
Definition
MediaWikiLangTestCase.php:8
MediaWikiLangTestCase\setUp
setUp()
Definition
MediaWikiLangTestCase.php:9
MediaWikiTestCase
Definition
MediaWikiTestCase.php:16
MediaWikiTestCase\setContentLang
setContentLang( $lang)
Definition
MediaWikiTestCase.php:1063
MediaWikiTestCase\setUserLang
setUserLang( $lang)
Definition
MediaWikiTestCase.php:1054
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition
MediaWikiServices.php:99
tests
phpunit
MediaWikiLangTestCase.php
Generated on Mon Nov 25 2024 15:59:03 for MediaWiki by
1.10.0