followup r99246: fixes for test cases
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 8 Oct 2011 00:27:53 +0000 (00:27 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 8 Oct 2011 00:27:53 +0000 (00:27 +0000)
tests/parser/bug31490.txt
tests/parser/parserTests.txt
tests/phpunit/languages/LanguageTrTest.php

index ca28ad7..edb6cd0 100644 (file)
@@ -16,7 +16,7 @@ language=tr
 !! input
 {{ucfirst:ix}}
 !! result
-<p>Ix
+<p>İx
 </p>
 !! end
 
@@ -38,7 +38,7 @@ language=tr
 !! input
 {{ucfırst:blah}}
 !! result
-<p><a href="/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
+<p><a href="/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
 </p>
 !! end
 
index c6bdb44..e5522e8 100644 (file)
@@ -8815,6 +8815,61 @@ Deprecated presentational attributes are converted to css
 
 !! end
 
+!! test
+Bug31490 Turkish: ucfirst 'blah'
+!! options
+language=tr
+!! input
+{{ucfirst:blah}}
+!! result
+<p>Blah
+</p>
+!! end
+
+!! test
+Bug31490 Turkish: ucfirst 'ix'
+!! options
+language=tr
+!! input
+{{ucfirst:ix}}
+!! result
+<p>İx
+</p>
+!! end
+
+!! test
+Bug31490 Turkish: lcfirst 'BLAH'
+!! options
+language=tr
+!! input
+{{lcfirst:BLAH}}
+!! result
+<p>bLAH
+</p>
+!! end
+
+!! test
+Bug31490 Turkish: ucfırst (with a dotless i)
+!! options
+language=tr
+!! input
+{{ucfırst:blah}}
+!! result
+<p><a href="/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
+</p>
+!! end
+
+!! test
+Bug31490 ucfırst (with a dotless i) with English language
+!! options
+language=en
+!! input
+{{ucfırst:blah}}
+!! result
+<p><a href="/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
+</p>
+!! end
+
 TODO:
 more images
 more tables
index 96b0780..d2a5ff3 100644 (file)
@@ -16,40 +16,13 @@ class LanguageTrTest extends MediaWikiTestCase {
                unset( $this->lang );
        }
 
-##### Full Turkish alphabet #################################################
-
-       function testLowerCaseTurkishAlphabetToUppercase() {
-               $this->assertEquals( 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ',
-                       $this->lang->uc( 'abcçdefgğhıijklmnoöprsştuüvyz' ),
-                       'Lower case Turkish alphabet to upper case'
-               );
-       }
-       function testUpperCaseTurkishAlphabetToUppercase() {
-               $this->assertEquals( 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ',
-                       $this->lang->uc( 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ' ),
-                       'Upper case Turkish alphabet to upper case'
-               );
-       }
-       function testUpperCaseTurkishAlphabetToLowercase() {
-               $this->assertEquals( 'abcçdefgğhıijklmnoöprsştuüvyz',
-                       $this->lang->lc( 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ' ),
-                       'Upper case Turkish alphabet to lower case'
-               );
-       }       
-       function testLowerCaseTurkishAlphabetToLowercase() {
-               $this->assertEquals( 'abcçdefgğhıijklmnoöprsştuüvyz',
-                       $this->lang->lc( 'abcçdefgğhıijklmnoöprsştuüvyz' ),
-                       'Lower case Turkish alphabet to lower case'
-               );
-       }
-
        /**
         * See @bug 28040
         * Credits to #wikipedia-tr users berm, []LuCkY[] and Emperyan
         * @see http://en.wikipedia.org/wiki/Dotted_and_dotless_I
         * @dataProvider provideDottedAndDotlessI
         */
-       function testChangeCaseOfFirstCharBeingDottedAndDotlessI( $func, $input, $inputCase, $expected ) {
+       function testDottedAndDotlessI( $func, $input, $inputCase, $expected ) {
                if( $func == 'ucfirst' ) {
                        $res = $this->lang->ucfirst( $input );
                } elseif( $func == 'lcfirst' ) {
@@ -87,60 +60,6 @@ class LanguageTrTest extends MediaWikiTestCase {
                        array( 'lcfirst', 'IPhone', 'upper', 'ıPhone' ),
 
                );
-       } 
-
-##### LanguageTr specificities  #############################################
-       /**
-        * @cover LanguageTr:lc
-        * See @bug 28040
-        */
-       function testLanguageTrLowerCasingOverride() {
-               $this->assertEquals( 'ııııı', $this->lang->lc( 'IIIII') );
-       }
-       /**
-        * @cover LanguageTr:uc
-        * See @bug 28040
-        */
-       function testLanguageTrUpperCasingOverride() {
-               $this->assertEquals( 'İİİİİ', $this->lang->uc( 'iiiii') );
-       }
-
-##### Upper casing a string #################################################
-       /**
-        * Generic test for the Turkish dotted and dotless I strings
-        * See @bug 28040
-        * @dataProvider provideUppercaseStringsWithDottedAndDotlessI
-        */
-       function testUpperCasingOfAStringWithDottedAndDotLessI( $expected, $input ) {
-               $this->assertEquals( $expected, $this->lang->uc( $input ) );
-       }
-       function provideUppercaseStringsWithDottedAndDotlessI() {
-               return array(
-                       # expected, input string to uc()
-                       array( 'IIIII', 'ııııı' ),
-                       array( 'IIIII', 'IIIII' ), #identity
-                       array( 'İİİİİ', 'iiiii' ), # Specifically handled by LanguageTr:uc
-                       array( 'İİİİİ', 'İİİİİ' ), #identity
-               );
-       }
-
-##### Lower casing a string #################################################
-       /**
-        * Generic test for the Turkish dotted and dotless I strings
-        * See @bug 28040
-        * @dataProvider provideLowercaseStringsWithDottedAndDotlessI
-        */
-       function testLowerCasingOfAStringWithDottedAndDotLessI( $expected, $input ) {
-               $this->assertEquals( $expected, $this->lang->lc( $input ) );
-       }
-       function provideLowercaseStringsWithDottedAndDotlessI() {
-               return array(
-                       # expected, input string to lc()
-                       array( 'ııııı', 'IIIII' ), # Specifically handled by LanguageTr:lc
-                       array( 'ııııı', 'ııııı' ), #identity
-                       array( 'iiiii', 'İİİİİ' ),
-                       array( 'iiiii', 'iiiii' ), #identity
-               );
        }
 
 }