From 2e44b49a2db3026050b136de9b00f749dd3ff939 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 25 Apr 2014 06:26:49 +0200 Subject: Update to MediaWiki 1.22.6 --- tests/phpunit/languages/LanguageUzTest.php | 121 ----------------------------- 1 file changed, 121 deletions(-) delete mode 100644 tests/phpunit/languages/LanguageUzTest.php (limited to 'tests/phpunit/languages/LanguageUzTest.php') diff --git a/tests/phpunit/languages/LanguageUzTest.php b/tests/phpunit/languages/LanguageUzTest.php deleted file mode 100644 index 13f57c16..00000000 --- a/tests/phpunit/languages/LanguageUzTest.php +++ /dev/null @@ -1,121 +0,0 @@ - - * @copyright Copyright © 2012, Robin Pepermans - * @copyright Copyright © 2011, Antoine Musso - * @file - * - * @todo methods in test class should be tidied: - * - Should be split into separate test methods and data providers - * - Tests for LanguageConverter and Language should probably be separate.. - */ - -/** Tests for MediaWiki languages/LanguageUz.php */ -class LanguageUzTest extends LanguageClassesTestCase { - - /** - * @author Nikola Smolenski - * @covers LanguageConverter::convertTo - */ - public function testConversionToCyrillic() { - // A convertion of Latin to Cyrillic - $this->assertEquals( 'абвгғ', - $this->convertToCyrillic( 'abvggʻ' ) - ); - // Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгўоdb', - $this->convertToCyrillic( '-{lj}-ab-{nj}-vgoʻo-{db}-' ) - ); - // A simple convertion of Cyrillic to Cyrillic - $this->assertEquals( 'абвг', - $this->convertToCyrillic( 'абвг' ) - ); - // Same as above, but assert that -{}-s must be removed and not converted - $this->assertEquals( 'ljабnjвгdaž', - $this->convertToCyrillic( '-{lj}-аб-{nj}-вг-{da}-ž' ) - ); - } - - /** - * @covers LanguageConverter::convertTo - */ - public function testConversionToLatin() { - // A simple convertion of Latin to Latin - $this->assertEquals( 'abdef', - $this->convertToLatin( 'abdef' ) - ); - // A convertion of Cyrillic to Latin - $this->assertEquals( 'gʻabtsdOʻQyo', - $this->convertToLatin( 'ғабцдЎҚё' ) - ); - } - - ##### HELPERS ##################################################### - /** - * Wrapper to verify text stay the same after applying conversion - * @param $text string Text to convert - * @param $variant string Language variant 'uz-cyrl' or 'uz-latn' - * @param $msg string Optional message - */ - protected function assertUnConverted( $text, $variant, $msg = '' ) { - $this->assertEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Wrapper to verify a text is different once converted to a variant. - * @param $text string Text to convert - * @param $variant string Language variant 'uz-cyrl' or 'uz-latn' - * @param $msg string Optional message - */ - protected function assertConverted( $text, $variant, $msg = '' ) { - $this->assertNotEquals( - $text, - $this->convertTo( $text, $variant ), - $msg - ); - } - - /** - * Verifiy the given Cyrillic text is not converted when using - * using the cyrillic variant and converted to Latin when using - * the Latin variant. - */ - protected function assertCyrillic( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'uz-cyrl', $msg ); - $this->assertConverted( $text, 'uz-latn', $msg ); - } - - /** - * Verifiy the given Latin text is not converted when using - * using the Latin variant and converted to Cyrillic when using - * the Cyrillic variant. - */ - protected function assertLatin( $text, $msg = '' ) { - $this->assertUnConverted( $text, 'uz-latn', $msg ); - $this->assertConverted( $text, 'uz-cyrl', $msg ); - } - - - /** Wrapper for converter::convertTo() method*/ - protected function convertTo( $text, $variant ) { - return $this->getLang()->mConverter->convertTo( $text, $variant ); - } - - protected function convertToCyrillic( $text ) { - return $this->convertTo( $text, 'uz-cyrl' ); - } - - protected function convertToLatin( $text ) { - return $this->convertTo( $text, 'uz-latn' ); - } -} -- cgit v1.2.2