* @copyright Copyright © 2012, Robin Pepermans
* @copyright Copyright © 2011, Antoine Musso <hashar at free dot fr>
* @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..
*/
-require_once dirname( __DIR__ ) . '/bootstrap.php';
-
/** Tests for MediaWiki languages/LanguageUz.php */
class LanguageUzTest extends LanguageClassesTestCase {
/**
* @author Nikola Smolenski
+ * @covers LanguageConverter::convertTo
*/
- function testConversionToCyrillic() {
+ public function testConversionToCyrillic() {
// A convertion of Latin to Cyrillic
$this->assertEquals( 'абвгғ',
$this->convertToCyrillic( 'abvggʻ' )
);
}
- function testConversionToLatin() {
+ /**
+ * @covers LanguageConverter::convertTo
+ */
+ public function testConversionToLatin() {
// A simple convertion of Latin to Latin
$this->assertEquals( 'abdef',
$this->convertToLatin( 'abdef' )
* @param $variant string Language variant 'uz-cyrl' or 'uz-latn'
* @param $msg string Optional message
*/
- function assertUnConverted( $text, $variant, $msg = '' ) {
+ protected function assertUnConverted( $text, $variant, $msg = '' ) {
$this->assertEquals(
$text,
$this->convertTo( $text, $variant ),
* @param $variant string Language variant 'uz-cyrl' or 'uz-latn'
* @param $msg string Optional message
*/
- function assertConverted( $text, $variant, $msg = '' ) {
+ protected function assertConverted( $text, $variant, $msg = '' ) {
$this->assertNotEquals(
$text,
$this->convertTo( $text, $variant ),
* using the cyrillic variant and converted to Latin when using
* the Latin variant.
*/
- function assertCyrillic( $text, $msg = '' ) {
+ protected function assertCyrillic( $text, $msg = '' ) {
$this->assertUnConverted( $text, 'uz-cyrl', $msg );
$this->assertConverted( $text, 'uz-latn', $msg );
}
* using the Latin variant and converted to Cyrillic when using
* the Cyrillic variant.
*/
- function assertLatin( $text, $msg = '' ) {
+ protected function assertLatin( $text, $msg = '' ) {
$this->assertUnConverted( $text, 'uz-latn', $msg );
$this->assertConverted( $text, 'uz-cyrl', $msg );
}
-
/** Wrapper for converter::convertTo() method*/
- function convertTo( $text, $variant ) {
+ protected function convertTo( $text, $variant ) {
return $this->getLang()->mConverter->convertTo( $text, $variant );
}
- function convertToCyrillic( $text ) {
+ protected function convertToCyrillic( $text ) {
return $this->convertTo( $text, 'uz-cyrl' );
}
- function convertToLatin( $text ) {
+ protected function convertToLatin( $text ) {
return $this->convertTo( $text, 'uz-latn' );
}
}