From 9252e92c997be694786e3dd6653d248041cb2a5d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 8 Oct 2011 00:27:53 +0000 Subject: [PATCH] followup r99246: fixes for test cases --- tests/parser/bug31490.txt | 4 +- tests/parser/parserTests.txt | 55 ++++++++++++++ tests/phpunit/languages/LanguageTrTest.php | 83 +--------------------- 3 files changed, 58 insertions(+), 84 deletions(-) diff --git a/tests/parser/bug31490.txt b/tests/parser/bug31490.txt index ca28ad7283..edb6cd06d6 100644 --- a/tests/parser/bug31490.txt +++ b/tests/parser/bug31490.txt @@ -16,7 +16,7 @@ language=tr !! input {{ucfirst:ix}} !! result -

Ix +

Ä°x

!! end @@ -38,7 +38,7 @@ language=tr !! input {{ucfırst:blah}} !! result -

Template:Ucfırst:blah +

Şablon:Ucfırst:blah

!! end diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index c6bdb44c91..e5522e8397 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -8815,6 +8815,61 @@ Deprecated presentational attributes are converted to css !! end +!! test +Bug31490 Turkish: ucfirst 'blah' +!! options +language=tr +!! input +{{ucfirst:blah}} +!! result +

Blah +

+!! end + +!! test +Bug31490 Turkish: ucfirst 'ix' +!! options +language=tr +!! input +{{ucfirst:ix}} +!! result +

Ä°x +

+!! end + +!! test +Bug31490 Turkish: lcfirst 'BLAH' +!! options +language=tr +!! input +{{lcfirst:BLAH}} +!! result +

bLAH +

+!! end + +!! test +Bug31490 Turkish: ucfırst (with a dotless i) +!! options +language=tr +!! input +{{ucfırst:blah}} +!! result +

Şablon:Ucfırst:blah +

+!! end + +!! test +Bug31490 ucfırst (with a dotless i) with English language +!! options +language=en +!! input +{{ucfırst:blah}} +!! result +

Template:Ucfırst:blah +

+!! end + TODO: more images more tables diff --git a/tests/phpunit/languages/LanguageTrTest.php b/tests/phpunit/languages/LanguageTrTest.php index 96b0780148..d2a5ff3663 100644 --- a/tests/phpunit/languages/LanguageTrTest.php +++ b/tests/phpunit/languages/LanguageTrTest.php @@ -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 - ); } } -- 2.20.1