MediaWiki
REL1_31
MockMessageLocalizer.php
Go to the documentation of this file.
1
<?php
2
11
class
MockMessageLocalizer
implements
MessageLocalizer
{
12
16
private
$languageCode
;
17
23
public
function
__construct
(
$languageCode
=
'qqx'
) {
24
$this->languageCode =
$languageCode
;
25
}
26
36
public
function
msg
( $key ) {
37
$args
= func_get_args();
38
40
$message = call_user_func_array(
'wfMessage'
,
$args
);
41
42
if
( $this->languageCode !==
null
) {
43
$message->inLanguage( $this->languageCode );
44
}
45
46
return
$message;
47
}
48
49
}
$args
if( $line===false) $args
Definition
cdb.php:64
MockMessageLocalizer
A simple MessageLocalizer implementation for use in tests.
Definition
MockMessageLocalizer.php:11
MockMessageLocalizer\$languageCode
string null $languageCode
Definition
MockMessageLocalizer.php:16
MockMessageLocalizer\__construct
__construct( $languageCode='qqx')
Definition
MockMessageLocalizer.php:23
MockMessageLocalizer\msg
msg( $key)
Get a Message object.
Definition
MockMessageLocalizer.php:36
MessageLocalizer
Interface for localizing messages in MediaWiki.
Definition
MessageLocalizer.php:28
tests
phpunit
mocks
MockMessageLocalizer.php
Generated on Mon Nov 25 2024 15:36:44 for MediaWiki by
1.10.0