mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 06:48:41 +00:00
load locale with invalid country code
This commit is contained in:
parent
cb4c6a4a2e
commit
719996dc07
|
|
@ -162,7 +162,9 @@ class Localization
|
||||||
throw new InvalidEnumValue($langCode);
|
throw new InvalidEnumValue($langCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($countryCode !== '*' && !\file_exists(__DIR__ . '/../Localization/Defaults/Definitions/' . $langCode . '_' . $countryCode . '.json')) {
|
if ($countryCode !== '*'
|
||||||
|
&& !\file_exists(__DIR__ . '/../Localization/Defaults/Definitions/' . $langCode . '_' . $countryCode . '.json')
|
||||||
|
) {
|
||||||
$countryCode = '*';
|
$countryCode = '*';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,9 @@ class LocalizationTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
$localization->loadFromLanguage(ISO639x1Enum::_AA);
|
$localization->loadFromLanguage(ISO639x1Enum::_AA);
|
||||||
self::assertEquals(ISO4217CharEnum::_USD, $localization->getCurrency());
|
self::assertEquals(ISO4217CharEnum::_USD, $localization->getCurrency());
|
||||||
|
|
||||||
|
$localization->loadFromLanguage(ISO639x1Enum::_AA, 'ABC');
|
||||||
|
self::assertEquals(ISO4217CharEnum::_USD, $localization->getCurrency());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testInvalidLocalizationLoading() : void
|
public function testInvalidLocalizationLoading() : void
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user