wiki.techinc.nl/tests/phpunit/languages/classes/LanguageShiTest.php
Peter Ovchyn 61e0908fa2 languages: Introduce LanguageConverterFactory
Done:
* Replace LanguageConverter::newConverter by LanguageConverterFactory::getLanguageConverter
* Remove LanguageConverter::newConverter from all subclasses
* Add LanguageConverterFactory integration tests which covers all languages by their code.
* Caching of LanguageConverters in factory
* Make all tests running (hope that's would be enough)
* Uncomment  the deprecated functions.
* Rename FakeConverter to TrivialLanguageConverter
* Create ILanguageConverter to have shared ancestor
* Make the LanguageConverter class abstract.
* Create table with mapping between lang code and converter instead of using name convention
* ILanguageConverter @internal
* Clean up code

Change-Id: I0e4d77de0f44e18c19956a1ffd69d30e63cf51bf
Bug: T226833, T243332
2020-02-03 11:38:03 +02:00

35 lines
678 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* @covers ShiConverter
*/
class LanguageShiTest extends LanguageClassesTestCase {
/**
* @dataProvider provideAutoConvertToAllVariants
* @covers Language::autoConvertToAllVariants
*/
public function testAutoConvertToAllVariants( $result, $value ) {
$this->assertEquals( $result, $this->getLang()->autoConvertToAllVariants( $value ) );
}
public static function provideAutoConvertToAllVariants() {
return [
[
[
'shi' => 'AƔ',
'shi-tfng' => 'ⴰⵖ',
'shi-latn' => 'AƔ',
],
'AƔ'
],
[
[
'shi' => 'ⴰⵖ',
'shi-tfng' => 'ⴰⵖ',
'shi-latn' => 'aɣ',
],
'ⴰⵖ'
],
];
}
}