28 $this->assertTrue( $this->
getLang()->hasVariants(),
'sr has variants' );
37 'sr-ec' => Language::factory(
'sr-ec' ),
38 'sr-cyrl' => Language::factory(
'sr-cyrl' ),
40 foreach ( $langs as
$code => $l ) {
41 $p = $l->getParentLanguage();
42 $this->assertTrue( $p !==
null,
'parent language exists' );
43 $this->assertEquals(
'sr', $p->getCode(),
'sr is parent language' );
44 $this->assertTrue( $p instanceof
LanguageSr,
'parent is LanguageSr' );
46 $this->assertTrue( $p->hasVariant( $l->getCode() ) );
49 $this->assertTrue( $l->hasVariant(
'sr-ec' ),
'sr-ec exists' );
51 foreach ( [
'sr-EC',
'sr-Cyrl',
'sr-cyrl',
'sr-bogus' ] as $v ) {
52 $this->assertFalse( $l->hasVariant( $v ),
"$v is not a variant of $code" );
64 'sr-EC' => Language::factory(
'sr-EC' ),
65 'sr-Cyrl' => Language::factory(
'sr-Cyrl' ),
66 'sr-bogus' => Language::factory(
'sr-bogus' ),
68 foreach ( $langs as
$code => $l ) {
69 $p = $l->getParentLanguage();
70 $this->assertTrue( $p ===
null,
'no parent for bogus language' );
71 $this->assertFalse( $l instanceof
LanguageSr,
"$code is not sr" );
72 $this->assertFalse( $this->
getLang()->hasVariant(
$code ),
"$code is not a sr variant" );
73 foreach ( [
'sr',
'sr-ec',
'sr-EC',
'sr-Cyrl',
'sr-cyrl',
'sr-bogus' ] as $v ) {
75 $this->assertFalse( $l->hasVariant( $v ),
"no variant $v" );
87 'Cyrillic guessing characters'
91 'Latin guessing characters'
100 'шђчћжШЂЧЋЖ - šđčćž',
101 'Mostly Cyrillic characters'
104 'šđč枊ĐČĆŽ - шђчћж',
105 'Mostly Latin characters'
114 '4 Latin: šđčć | 4 Cyrillic: шђчћ',
118 '4 Latin: šđčć | 4 Cyrillic: шђчћ',
129 $this->assertEquals(
'абвг',
133 $this->assertEquals(
'ljабnjвгdž',
137 $this->assertEquals(
'абвг',
141 $this->assertEquals(
'ljабnjвгdž',
145 $this->assertEquals(
'abvgшђжчћ',
149 $this->assertEquals(
'љabvgњшђжчћџ',
153 $this->assertEquals(
'абвгшђжчћ',
157 $this->assertEquals(
'ljабвгnjшђжчћdž',
161 $this->assertEquals(
'а I б II в III г IV шђжчћ',
171 $this->assertEquals(
'abcd',
175 $this->assertEquals(
'abcd',
179 $this->assertEquals(
'abcdšđžčć',
183 $this->assertEquals(
'абцдšđžčć',
193 $forms = [
'one',
'few',
'other' ];
194 $this->assertEquals( $result, $this->
getLang()->convertPlural(
$value, $forms ) );
202 $this->assertEquals( $result, $this->
getLang()->getPluralRuleType(
$value ) );
226 $forms = [
'one',
'other' ];
227 $this->assertEquals( $result, $this->
getLang()->convertPlural(
$value, $forms ) );
240 # #### HELPERS #####################################################
262 $this->assertNotEquals(
303 return $this->
convertTo( $text,
'sr-ec' );
307 return $this->
convertTo( $text,
'sr-el' );
Helping class to run tests using a clean language instance.
testPlural( $result, $value)
providePlural Language::convertPlural
testGetPluralRuleType( $result, $value)
providePlural Language::getPluralRuleType
assertConverted( $text, $variant, $msg='')
Wrapper to verify a text is different once converted to a variant.
static providePluralTwoForms()
testHasVariantBogus()
Language::hasVariant.
testEasyConversions()
LanguageConverter::convertTo.
assertCyrillic( $text, $msg='')
Verifiy the given Cyrillic text is not converted when using using the Cyrillic variant and converted ...
convertToCyrillic( $text)
testConversionToCyrillic()
assertUnConverted( $text, $variant, $msg='')
Wrapper to verify text stay the same after applying conversion.
testMixedConversions()
LanguageConverter::convertTo.
convertTo( $text, $variant)
Wrapper for converter::convertTo() method.
assertLatin( $text, $msg='')
Verifiy the given Latin text is not converted when using using the Latin variant and converted to Cyr...
testConversionToLatin()
LanguageConverter::convertTo.
testHasVariants()
Language::hasVariants.
testHasVariant()
Language::hasVariant.
testPluralTwoForms( $result, $value)
providePluralTwoForms Language::convertPlural
testSameAmountOfLatinAndCyrillicGetConverted()
LanguageConverter::convertTo.
Serbian (Српски / Srpski)
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code