]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - tests/phpunit/languages/classes/LanguageLvTest.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / tests / phpunit / languages / classes / LanguageLvTest.php
diff --git a/tests/phpunit/languages/classes/LanguageLvTest.php b/tests/phpunit/languages/classes/LanguageLvTest.php
new file mode 100644 (file)
index 0000000..9827c68
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for Latvian */
+class LanguageLvTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider providePlural
+        * @covers Language::convertPlural
+        */
+       public function testPlural( $result, $value ) {
+               $forms = [ 'zero', 'one', 'other' ];
+               $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+       }
+
+       /**
+        * @dataProvider providePlural
+        * @covers Language::getPluralRuleType
+        */
+       public function testGetPluralRuleType( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->getPluralRuleType( $value ) );
+       }
+
+       public static function providePlural() {
+               return [
+                       [ 'zero', 0 ],
+                       [ 'one', 1 ],
+                       [ 'zero', 11 ],
+                       [ 'one', 21 ],
+                       [ 'zero', 411 ],
+                       [ 'other', 2 ],
+                       [ 'other', 9 ],
+                       [ 'zero', 12 ],
+                       [ 'other', 12.345 ],
+                       [ 'zero', 20 ],
+                       [ 'other', 22 ],
+                       [ 'one', 31 ],
+                       [ 'zero', 200 ],
+               ];
+       }
+}