Merge "Fix class name handling in DeprecationHelper"
[lhc/web/wiklou.git] / tests / phpunit / languages / classes / LanguageMlTest.php
index 673b5c7..f5b33e9 100644 (file)
 class LanguageMlTest extends LanguageClassesTestCase {
 
        /**
-        * @dataProvider providerFormatNum
-        * T31495
+        * @dataProvider provideFormatNum
         * @covers Language::formatNum
         */
        public function testFormatNum( $result, $value ) {
+               // For T31495
                $this->assertEquals( $result, $this->getLang()->formatNum( $value ) );
        }
 
-       public static function providerFormatNum() {
+       public static function provideFormatNum() {
                return [
                        [ '12,34,567', '1234567' ],
                        [ '12,345', '12345' ],
@@ -37,4 +37,31 @@ class LanguageMlTest extends LanguageClassesTestCase {
                        [ '', null ],
                ];
        }
+
+       /**
+        * @covers LanguageMl::normalize
+        * @covers Language::normalize
+        * @dataProvider provideNormalize
+        */
+       public function testNormalize( $input, $expected ) {
+               if ( $input === $expected ) {
+                       throw new Exception( 'Expected output must differ.' );
+               }
+
+               $this->setMwGlobals( 'wgFixMalayalamUnicode', true );
+               $this->assertSame( $expected, $this->getLang()->normalize( $input ), 'ml-normalised form' );
+
+               $this->setMwGlobals( 'wgFixMalayalamUnicode', false );
+               $this->hideDeprecated( '$wgFixMalayalamUnicode = false' );
+               $this->assertSame( $input, $this->getLang()->normalize( $input ), 'regular normalised form' );
+       }
+
+       public static function provideNormalize() {
+               return [
+                       [
+                               'ല്‍',
+                               'ൽ',
+                       ],
+               ];
+       }
 }