Utilities - Locale - getLocale() method - returns locale for given category

This commit is contained in:
Meritoo
2018-01-27 13:05:20 +01:00
parent af38c35a1b
commit 470b8244ec
2 changed files with 36 additions and 0 deletions

View File

@@ -75,6 +75,21 @@ class LocaleTest extends BaseTestCase
self::assertEquals($expectedLocale, Locale::setLocale($category, $languageCode, $countryCode));
}
/**
* @param int $category Named constant specifying the category of the functions affected by the locale setting.
* It's the same constant as required by setlocale() function.
* @param string $languageCode Language code, in ISO 639-1 format. Short form of the locale, e.g. "fr".
* @param string $countryCode Country code, in ISO 3166-1 alpha-2 format, e.g. "FR"
* @param string $expectedLocale Expected locale
*
* @dataProvider provideCategoryLanguageCodeAndExpectedLocale
*/
public function testGetLocale($category, $languageCode, $countryCode, $expectedLocale)
{
Locale::setLocale($category, $languageCode, $countryCode);
self::assertEquals($expectedLocale, Locale::getLocale($category));
}
/**
* Provides language, encoding and country code
*