summaryrefslogtreecommitdiff
path: root/tests/phpunit/languages/LanguageMoTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-09-04 05:51:59 +0200
committerPierre Schmitz <pierre@archlinux.de>2013-09-04 05:51:59 +0200
commit91e194556c52d2f354344f930419eef2dd6267f0 (patch)
tree0cd12490d3cd3499274017c9b799d0f738d3719e /tests/phpunit/languages/LanguageMoTest.php
parent08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (diff)
Update to MediaWiki 1.21.2
Diffstat (limited to 'tests/phpunit/languages/LanguageMoTest.php')
-rw-r--r--tests/phpunit/languages/LanguageMoTest.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/phpunit/languages/LanguageMoTest.php b/tests/phpunit/languages/LanguageMoTest.php
new file mode 100644
index 00000000..f7da1cd6
--- /dev/null
+++ b/tests/phpunit/languages/LanguageMoTest.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/** Tests for MediaWiki languages/classes/LanguageMo.php */
+class LanguageMoTest extends LanguageClassesTestCase {
+
+ /** @dataProvider providerPlural */
+ function testPlural( $result, $value ) {
+ $forms = array( 'one', 'few', 'other' );
+ $this->assertEquals( $result, $this->getLang()->convertPlural( $value, $forms ) );
+ }
+
+ function providerPlural() {
+ return array(
+ array( 'few', 0 ),
+ array( 'one', 1 ),
+ array( 'few', 2 ),
+ array( 'few', 19 ),
+ array( 'other', 20 ),
+ array( 'other', 99 ),
+ array( 'other', 100 ),
+ array( 'few', 101 ),
+ array( 'few', 119 ),
+ array( 'other', 120 ),
+ array( 'other', 200 ),
+ array( 'few', 201 ),
+ array( 'few', 219 ),
+ array( 'other', 220 ),
+ );
+ }
+}