]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - tests/phpunit/languages/classes/LanguageIuTest.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / tests / phpunit / languages / classes / LanguageIuTest.php
diff --git a/tests/phpunit/languages/classes/LanguageIuTest.php b/tests/phpunit/languages/classes/LanguageIuTest.php
new file mode 100644 (file)
index 0000000..ff9c4d0
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+class LanguageIuTest extends LanguageClassesTestCase {
+       /**
+        * @dataProvider provideAutoConvertToAllVariants
+        * @covers Language::autoConvertToAllVariants
+        */
+       public function testAutoConvertToAllVariants( $result, $value ) {
+               $this->assertEquals( $result, $this->getLang()->autoConvertToAllVariants( $value ) );
+       }
+
+       public static function provideAutoConvertToAllVariants() {
+               return [
+                       // ike-cans
+                       [
+                               [
+                                       'ike-cans' => 'ᐴ',
+                                       'ike-latn' => 'PUU',
+                                       'iu' => 'PUU',
+                               ],
+                               'PUU'
+                       ],
+                       // ike-latn
+                       [
+                               [
+                                       'ike-cans' => 'ᐴ',
+                                       'ike-latn' => 'puu',
+                                       'iu' => 'ᐴ',
+                               ],
+                               'ᐴ'
+                       ],
+               ];
+       }
+}