From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- tests/phpunit/languages/LanguageTrTest.php | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tests/phpunit/languages/LanguageTrTest.php (limited to 'tests/phpunit/languages/LanguageTrTest.php') diff --git a/tests/phpunit/languages/LanguageTrTest.php b/tests/phpunit/languages/LanguageTrTest.php new file mode 100644 index 00000000..d2a5ff36 --- /dev/null +++ b/tests/phpunit/languages/LanguageTrTest.php @@ -0,0 +1,65 @@ +lang = Language::factory( 'Tr' ); + } + function tearDown() { + unset( $this->lang ); + } + + /** + * 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 testDottedAndDotlessI( $func, $input, $inputCase, $expected ) { + if( $func == 'ucfirst' ) { + $res = $this->lang->ucfirst( $input ); + } elseif( $func == 'lcfirst' ) { + $res = $this->lang->lcfirst( $input ); + } else { + throw new MWException( __METHOD__ . " given an invalid function name '$func'" ); + } + + $msg = "Converting $inputCase case '$input' with $func should give '$expected'"; + + $this->assertEquals( $expected, $res, $msg ); + } + + function provideDottedAndDotlessI() { + return array( + # function, input, input case, expected + # Case changed: + array( 'ucfirst', 'ı', 'lower', 'I' ), + array( 'ucfirst', 'i', 'lower', 'İ' ), + array( 'lcfirst', 'I', 'upper', 'ı' ), + array( 'lcfirst', 'İ', 'upper', 'i' ), + + # Already using the correct case + array( 'ucfirst', 'I', 'upper', 'I' ), + array( 'ucfirst', 'İ', 'upper', 'İ' ), + array( 'lcfirst', 'ı', 'lower', 'ı' ), + array( 'lcfirst', 'i', 'lower', 'i' ), + + # A real example taken from bug 28040 using + # http://tr.wikipedia.org/wiki/%C4%B0Phone + array( 'lcfirst', 'iPhone', 'lower', 'iPhone' ), + + # next case is valid in Turkish but are different words if we + # consider IPhone is English! + array( 'lcfirst', 'IPhone', 'upper', 'ıPhone' ), + + ); + } + +} -- cgit v1.2.2