X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FCollationTest.php;h=bf283aae73e62541003f6abb3326987a087552a7;hb=efa60ac8e93870afd96ecadbddc09de1f70c356f;hp=213e610f3a985784199d32fa17848629da1096cb;hpb=a5b5f90fb956605601bd14aed695c8c962b0d064;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/CollationTest.php b/tests/phpunit/includes/CollationTest.php index 213e610f3a..bf283aae73 100644 --- a/tests/phpunit/includes/CollationTest.php +++ b/tests/phpunit/includes/CollationTest.php @@ -20,9 +20,9 @@ class CollationTest extends MediaWikiLangTestCase { * prefix of "XY". Our collation * code makes this assumption. * - * @param $lang String Language code for collator - * @param $base String Base string - * @param $extended String String containing base as a prefix. + * @param string $lang Language code for collator + * @param string $base Base string + * @param string $extended String containing base as a prefix. * * @dataProvider prefixDataProvider */ @@ -37,21 +37,21 @@ class CollationTest extends MediaWikiLangTestCase { } public static function prefixDataProvider() { - return array( - array( 'en', 'A', 'AA' ), - array( 'en', 'A', 'AAA' ), - array( 'en', 'Д', 'ДЂ' ), - array( 'en', 'Д', 'ДA' ), + return [ + [ 'en', 'A', 'AA' ], + [ 'en', 'A', 'AAA' ], + [ 'en', 'Д', 'ДЂ' ], + [ 'en', 'Д', 'ДA' ], // 'Ʒ' should expand to 'Z ' (note space). - array( 'fi', 'Z', 'Ʒ' ), + [ 'fi', 'Z', 'Ʒ' ], // 'Þ' should expand to 'th' - array( 'sv', 't', 'Þ' ), + [ 'sv', 't', 'Þ' ], // Javanese is a limited use alphabet, so should have 3 bytes // per character, so do some tests with it. - array( 'en', 'ꦲ', 'ꦲꦤ' ), - array( 'en', 'ꦲ', 'ꦲД' ), - array( 'en', 'A', 'Aꦲ' ), - ); + [ 'en', 'ꦲ', 'ꦲꦤ' ], + [ 'en', 'ꦲ', 'ꦲД' ], + [ 'en', 'A', 'Aꦲ' ], + ]; } /** @@ -70,20 +70,20 @@ class CollationTest extends MediaWikiLangTestCase { } public static function notPrefixDataProvider() { - return array( - array( 'en', 'A', 'B' ), - array( 'en', 'AC', 'ABC' ), - array( 'en', 'Z', 'Ʒ' ), - array( 'en', 'A', 'ꦲ' ), - ); + return [ + [ 'en', 'A', 'B' ], + [ 'en', 'AC', 'ABC' ], + [ 'en', 'Z', 'Ʒ' ], + [ 'en', 'A', 'ꦲ' ], + ]; } /** * Test correct first letter is fetched. * - * @param $collation String Collation name (aka uca-en) - * @param $string String String to get first letter of - * @param $firstLetter String Expected first letter. + * @param string $collation Collation name (aka uca-en) + * @param string $string String to get first letter of + * @param string $firstLetter Expected first letter. * * @dataProvider firstLetterProvider */ @@ -93,25 +93,25 @@ class CollationTest extends MediaWikiLangTestCase { } function firstLetterProvider() { - return array( - array( 'uppercase', 'Abc', 'A' ), - array( 'uppercase', 'abc', 'A' ), - array( 'identity', 'abc', 'a' ), - array( 'uca-en', 'abc', 'A' ), - array( 'uca-en', ' ', ' ' ), - array( 'uca-en', 'Êveryone', 'E' ), - array( 'uca-vi', 'Êveryone', 'Ê' ), + return [ + [ 'uppercase', 'Abc', 'A' ], + [ 'uppercase', 'abc', 'A' ], + [ 'identity', 'abc', 'a' ], + [ 'uca-en', 'abc', 'A' ], + [ 'uca-en', ' ', ' ' ], + [ 'uca-en', 'Êveryone', 'E' ], + [ 'uca-vi', 'Êveryone', 'Ê' ], // Make sure thorn is not a first letter. - array( 'uca-sv', 'The', 'T' ), - array( 'uca-sv', 'Å', 'Å' ), - array( 'uca-hu', 'dzsdo', 'Dzs' ), - array( 'uca-hu', 'dzdso', 'Dz' ), - array( 'uca-hu', 'CSD', 'Cs' ), - array( 'uca-root', 'CSD', 'C' ), - array( 'uca-fi', 'Ǥ', 'G' ), - array( 'uca-fi', 'Ŧ', 'T' ), - array( 'uca-fi', 'Ʒ', 'Z' ), - array( 'uca-fi', 'Ŋ', 'N' ), - ); + [ 'uca-sv', 'The', 'T' ], + [ 'uca-sv', 'Å', 'Å' ], + [ 'uca-hu', 'dzsdo', 'Dzs' ], + [ 'uca-hu', 'dzdso', 'Dz' ], + [ 'uca-hu', 'CSD', 'Cs' ], + [ 'uca-root', 'CSD', 'C' ], + [ 'uca-fi', 'Ǥ', 'G' ], + [ 'uca-fi', 'Ŧ', 'T' ], + [ 'uca-fi', 'Ʒ', 'Z' ], + [ 'uca-fi', 'Ŋ', 'N' ], + ]; } }