Merge "jpegmeta: Add links to source version and improve documentation"
[lhc/web/wiklou.git] / tests / phpunit / languages / LanguageHeTest.php
index 7849349..8edc6dd 100644 (file)
@@ -7,43 +7,58 @@
 
 /** Tests for MediaWiki languages/classes/LanguageHe.php */
 class LanguageHeTest extends LanguageClassesTestCase {
-       /*
-       The most common usage for the plural forms is two forms,
-       for singular and plural. In this case, the second form
-       is technically dual, but in practice it's used as plural.
-       In some cases, usually with expressions of time, three forms
-       are needed - singular, dual and plural.
-       CLDR also specifies a fourth form for multiples of 10,
-       which is very rare. It also has a mistake, because
-       the number 10 itself is supposed to be just plural,
-       so currently it's overridden in MediaWiki.
+       /**
+        * The most common usage for the plural forms is two forms,
+        * for singular and plural. In this case, the second form
+        * is technically dual, but in practice it's used as plural.
+        * In some cases, usually with expressions of time, three forms
+        * are needed - singular, dual and plural.
+        * CLDR also specifies a fourth form for multiples of 10,
+        * which is very rare. It also has a mistake, because
+        * the number 10 itself is supposed to be just plural,
+        * so currently it's overridden in MediaWiki.
        */
 
-       /** @dataProvider provideTwoPluralForms */
-       function testTwoPluralForms( $result, $value ) {
+       // @todo the below test*PluralForms test methods can be refactored
+       //  to use a single test method and data provider..
+
+       /**
+        * @dataProvider provideTwoPluralForms
+        * @covers Language::convertPlural
+        */
+       public function testTwoPluralForms( $result, $value ) {
                $forms = array( 'one', 'other' );
                $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
        }
 
-       /** @dataProvider provideThreePluralForms */
-       function testThreePluralForms( $result, $value ) {
+       /**
+        * @dataProvider provideThreePluralForms
+        * @covers Language::convertPlural
+        */
+       public function testThreePluralForms( $result, $value ) {
                $forms = array( 'one', 'two', 'other' );
                $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
        }
 
-       /** @dataProvider provideFourPluralForms */
-       function testFourPluralForms( $result, $value ) {
+       /**
+        * @dataProvider provideFourPluralForms
+        * @covers Language::convertPlural
+        */
+       public function testFourPluralForms( $result, $value ) {
                $forms = array( 'one', 'two', 'many', 'other' );
                $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
        }
 
-       /** @dataProvider provideFourPluralForms */
-       function testGetPluralRuleType( $result, $value ) {
+       /**
+        * @dataProvider provideFourPluralForms
+        * @covers Language::convertPlural
+        */
+       public function testGetPluralRuleType( $result, $value ) {
                $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
        }
 
        public static function provideTwoPluralForms() {
-               return array (
+               return array(
                        array( 'other', 0 ), // Zero - plural
                        array( 'one', 1 ), // Singular
                        array( 'other', 2 ), // No third form provided, use it as plural
@@ -54,7 +69,7 @@ class LanguageHeTest extends LanguageClassesTestCase {
        }
 
        public static function provideThreePluralForms() {
-               return array (
+               return array(
                        array( 'other', 0 ), // Zero - plural
                        array( 'one', 1 ), // Singular
                        array( 'two', 2 ), // Dual
@@ -65,7 +80,7 @@ class LanguageHeTest extends LanguageClassesTestCase {
        }
 
        public static function provideFourPluralForms() {
-               return array (
+               return array(
                        array( 'other', 0 ), // Zero - plural
                        array( 'one', 1 ), // Singular
                        array( 'two', 2 ), // Dual
@@ -75,39 +90,42 @@ class LanguageHeTest extends LanguageClassesTestCase {
                );
        }
 
-       /** @dataProvider provideGrammar */
-       function testGrammar( $result, $word, $case ) {
+       /**
+        * @dataProvider provideGrammar
+        * @covers Language::convertGrammar
+        */
+       public function testGrammar( $result, $word, $case ) {
                $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
        }
 
        // The comments in the beginning of the line help avoid RTL problems
        // with text editors.
        public static function provideGrammar() {
-               return array (
+               return array(
                        array(
-                               /* result */ 'וויקיפדיה',
-                               /* word   */ 'ויקיפדיה',
-                               /* case   */ 'תחילית',
+                               /* result */'וויקיפדיה',
+                               /* word   */'ויקיפדיה',
+                               /* case   */'תחילית',
                        ),
                        array(
-                               /* result */ 'וולפגנג',
-                               /* word   */ 'וולפגנג',
-                               /* case   */ 'prefixed',
+                               /* result */'וולפגנג',
+                               /* word   */'וולפגנג',
+                               /* case   */'prefixed',
                        ),
                        array(
-                               /* result */ 'קובץ',
-                               /* word   */ 'הקובץ',
-                               /* case   */ 'תחילית',
+                               /* result */'קובץ',
+                               /* word   */'הקובץ',
+                               /* case   */'תחילית',
                        ),
                        array(
-                               /* result */ '־Wikipedia',
-                               /* word   */ 'Wikipedia',
-                               /* case   */ 'תחילית',
+                               /* result */'־Wikipedia',
+                               /* word   */'Wikipedia',
+                               /* case   */'תחילית',
                        ),
                        array(
-                               /* result */ '־1995',
-                               /* word   */ '1995',
-                               /* case   */ 'תחילית',
+                               /* result */'־1995',
+                               /* word   */'1995',
+                               /* case   */'תחילית',
                        ),
                );
        }