MediaWiki
REL1_32
LanguageMlTest.php
Go to the documentation of this file.
1
<?php
11
class
LanguageMlTest
extends
LanguageClassesTestCase
{
12
17
public
function
testFormatNum
( $result,
$value
) {
18
// For T31495
19
$this->assertEquals( $result, $this->
getLang
()->formatNum(
$value
) );
20
}
21
22
public
static
function
provideFormatNum
() {
23
return
[
24
[
'12,34,567'
,
'1234567'
],
25
[
'12,345'
,
'12345'
],
26
[
'1'
,
'1'
],
27
[
'123'
,
'123'
],
28
[
'1,234'
,
'1234'
],
29
[
'12,345.56'
,
'12345.56'
],
30
[
'12,34,56,79,81,23,45,678'
,
'12345679812345678'
],
31
[
'.12345'
,
'.12345'
],
32
[
'-12,00,000'
,
'-1200000'
],
33
[
'-98'
,
'-98'
],
34
[
'-98'
, -98 ],
35
[
'-1,23,45,678'
, -12345678 ],
36
[
''
,
''
],
37
[
''
, null ],
38
];
39
}
40
46
public
function
testNormalize
(
$input
, $expected ) {
47
if
(
$input
=== $expected ) {
48
throw
new
Exception(
'Expected output must differ.'
);
49
}
50
51
$this->
setMwGlobals
(
'wgFixMalayalamUnicode'
,
true
);
52
$this->assertSame( $expected, $this->
getLang
()->normalize(
$input
),
'ml-normalised form'
);
53
54
$this->
setMwGlobals
(
'wgFixMalayalamUnicode'
,
false
);
55
$this->assertSame(
$input
, $this->
getLang
()->normalize(
$input
),
'regular normalised form'
);
56
}
57
58
public
static
function
provideNormalize
() {
59
return
[
60
[
61
'ല്'
,
62
'ൽ'
,
63
],
64
];
65
}
66
}
LanguageClassesTestCase
Helping class to run tests using a clean language instance.
Definition
LanguageClassesTestCase.php:21
LanguageClassesTestCase\getLang
getLang()
Definition
LanguageClassesTestCase.php:41
LanguageMlTest
LanguageMl.
Definition
LanguageMlTest.php:11
LanguageMlTest\provideFormatNum
static provideFormatNum()
Definition
LanguageMlTest.php:22
LanguageMlTest\provideNormalize
static provideNormalize()
Definition
LanguageMlTest.php:58
LanguageMlTest\testFormatNum
testFormatNum( $result, $value)
provideFormatNum Language::formatNum
Definition
LanguageMlTest.php:17
LanguageMlTest\testNormalize
testNormalize( $input, $expected)
LanguageMl::normalize Language::normalize provideNormalize.
Definition
LanguageMlTest.php:46
MediaWikiTestCase\setMwGlobals
setMwGlobals( $pairs, $value=null)
Sets a global, maintaining a stashed version of the previous global to be restored in tearDown.
Definition
MediaWikiTestCase.php:706
$input
if(is_array($mode)) switch( $mode) $input
Definition
postprocess-phan.php:141
$value
$value
Definition
styleTest.css.php:49
tests
phpunit
languages
classes
LanguageMlTest.php
Generated on Mon Nov 25 2024 15:59:01 for MediaWiki by
1.10.0