MediaWiki
REL1_33
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:2914
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:17
MediaWikiTestCase\setContentLang
setContentLang( $lang)
Definition
MediaWikiTestCase.php:1066
MediaWikiTestCase\setUserLang
setUserLang( $lang)
Definition
MediaWikiTestCase.php:1057
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition
MediaWikiServices.php:103
tests
phpunit
MediaWikiLangTestCase.php
Generated on Mon Nov 25 2024 15:51:24 for MediaWiki by
1.10.0