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