Add @covers tags for Collation tests
[lhc/web/wiklou.git] / tests / phpunit / includes / collation / CollationFaTest.php
1 <?php
2
3 /**
4 * @covers CollationFa
5 */
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 if ( !extension_loaded( 'intl' ) ) {
17 $this->markTestSkipped( "PHP extension 'intl' is not loaded, skipping." );
18 }
19 }
20
21 /**
22 * @dataProvider provideGetFirstLetter
23 */
24 public function testGetFirstLetter( $letter, $str ) {
25 $coll = new CollationFa;
26 $this->assertEquals( $letter, $coll->getFirstLetter( $str ), $str );
27 }
28
29 public function provideGetFirstLetter() {
30 return [
31 [
32 '۷',
33 '۷'
34 ],
35 [
36 'ا',
37 'ا'
38 ],
39 [
40 'ا',
41 'ایران'
42 ],
43 [
44 'ب',
45 'برلین'
46 ],
47 [
48 'و',
49 'واو'
50 ],
51 [ "\xd8\xa7", "\xd8\xa7Foo" ],
52 [ "\xd9\x88", "\xd9\x88Foo" ],
53 [ "\xd9\xb2", "\xd9\xb2Foo" ],
54 [ "\xd9\xb3", "\xd9\xb3Foo" ],
55 ];
56 }
57 }