MediaWiki
REL1_31
CollationFaTest.php
Go to the documentation of this file.
1
<?php
2
6
class
CollationFaTest
extends
MediaWikiTestCase
{
7
8
/*
9
* The ordering is a weird hack designed to work only with a very
10
* specific version of libicu, and as such can't really be unit tested
11
* against a random version of libicu
12
*/
13
14
public
function
setUp
() {
15
parent::setUp();
16
$this->
checkPHPExtension
(
'intl'
);
17
}
18
22
public
function
testGetFirstLetter
( $letter, $str ) {
23
$coll =
new
CollationFa
;
24
$this->assertEquals( $letter, $coll->getFirstLetter( $str ), $str );
25
}
26
27
public
function
provideGetFirstLetter
() {
28
return
[
29
[
30
'۷'
,
31
'۷'
32
],
33
[
34
'ا'
,
35
'ا'
36
],
37
[
38
'ا'
,
39
'ایران'
40
],
41
[
42
'ب'
,
43
'برلین'
44
],
45
[
46
'و'
,
47
'واو'
48
],
49
[
"\xd8\xa7"
,
"\xd8\xa7Foo"
],
50
[
"\xd9\x88"
,
"\xd9\x88Foo"
],
51
[
"\xd9\xb2"
,
"\xd9\xb2Foo"
],
52
[
"\xd9\xb3"
,
"\xd9\xb3Foo"
],
53
];
54
}
55
}
CollationFaTest
CollationFa.
Definition
CollationFaTest.php:6
CollationFaTest\provideGetFirstLetter
provideGetFirstLetter()
Definition
CollationFaTest.php:27
CollationFaTest\testGetFirstLetter
testGetFirstLetter( $letter, $str)
provideGetFirstLetter
Definition
CollationFaTest.php:22
CollationFaTest\setUp
setUp()
Definition
CollationFaTest.php:14
CollationFa
Temporary workaround for incorrect collation of Persian language ('fa') in ICU 52 (bug T139110).
Definition
CollationFa.php:31
MediaWikiTestCase
Definition
MediaWikiTestCase.php:17
MediaWikiTestCase\checkPHPExtension
checkPHPExtension( $extName)
Check if $extName is a loaded PHP extension, will skip the test whenever it is not loaded.
Definition
MediaWikiTestCase.php:1989
tests
phpunit
includes
collation
CollationFaTest.php
Generated on Mon Nov 25 2024 15:36:18 for MediaWiki by
1.10.0