summaryrefslogtreecommitdiff
path: root/www/wiki/tests/phpunit/languages/classes/LanguageHsbTest.php
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2020-06-04 11:01:00 -0300
committerYaco <franco@reevo.org>2020-06-04 11:01:00 -0300
commitfc7369835258467bf97eb64f184b93691f9a9fd5 (patch)
treedaabd60089d2dd76d9f5fb416b005fbe159c799d /www/wiki/tests/phpunit/languages/classes/LanguageHsbTest.php
first commit
Diffstat (limited to 'www/wiki/tests/phpunit/languages/classes/LanguageHsbTest.php')
-rw-r--r--www/wiki/tests/phpunit/languages/classes/LanguageHsbTest.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/www/wiki/tests/phpunit/languages/classes/LanguageHsbTest.php b/www/wiki/tests/phpunit/languages/classes/LanguageHsbTest.php
new file mode 100644
index 00000000..0841f6f9
--- /dev/null
+++ b/www/wiki/tests/phpunit/languages/classes/LanguageHsbTest.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * @author Santhosh Thottingal
+ * @copyright Copyright © 2012, Santhosh Thottingal
+ * @file
+ */
+
+/**
+ * @covers LanguageHsb
+ */
+class LanguageHsbTest extends LanguageClassesTestCase {
+ /**
+ * @dataProvider providePlural
+ * @covers Language::convertPlural
+ */
+ public function testPlural( $result, $value ) {
+ $forms = [ 'one', 'two', 'few', '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 [
+ [ 'other', 0 ],
+ [ 'one', 1 ],
+ [ 'one', 101 ],
+ [ 'one', 90001 ],
+ [ 'two', 2 ],
+ [ 'few', 3 ],
+ [ 'few', 203 ],
+ [ 'few', 4 ],
+ [ 'other', 99 ],
+ [ 'other', 555 ],
+ ];
+ }
+}