LanguageFactory::getLanguage() will accept *lowercased* BCP-47 codes, so
this method is equivalent to
LanguageFactory::getLanguage(strtolower($code))->getCode()
but should be much more efficient in practice.
Change-Id: I180765604d08ed57f655b69dfb32686f0b2a0dce
This shows that 'zh-classical' is not even a well-formed language tag
because 'classical' has more than 8 characters.
Change-Id: Ic07baf98ca4d92fa4c196895533650145c440584
The static function isWellFormedLanguageTag is related to BCP 47
language codes not to the internal language codes or language names.
The new function LanguageCode::isWellFormedLanguageTag uses type hints.
THe explicit type cast (bool) is not necessary anymore.
The old function Language::isWellFormedLanguageTag is now deprecated.
Change-Id: I6431dbd82ed6dfcc2a7c3495eca025506551db05
Done automatically using the master version of MW codesniffer and
running composer fix.
Bug: T192167
Change-Id: If6b40f515fde32ab5eff074a90e821c30c791827
assertEquals( null, … ) still succeeds when the actual value is 0, false,
an empty string, even an empty array. All these should be reported as a
failure, I would argue.
Note this patch previously also touched assertSame( null ). I reverted
these. The only benefit would have been consistency within this codebase,
but there is no strict reason to prefer one over the other. assertNull()
and assertSame( null ) are functionally identical.
Change-Id: I92102e833a8bc6af90b9516826abf111e2b79aac
These source classes they test were also moved from
languages/ to includes/languages/.
Bug: T225756
Change-Id: I6931d459bbfa243d2a28f391f92bce70f1e52256
2019-07-15 00:16:44 +01:00
Renamed from tests/phpunit/unit/languages/LanguageCodeTest.php (Browse further)