convert($languageCode)); } public static function languageCodeProvider(): iterable { yield ['en', 'en']; yield ['de', 'de']; yield ['es', 'es']; yield ['fr', 'fr']; yield ['it', 'it']; yield ['ja', 'ja']; yield ['pl', 'pl']; yield ['pt_br', 'pt_BR']; yield ['pt_BR', 'pt_BR']; yield ['ro', 'ro']; yield ['ru', 'ru']; yield ['tr', 'tr']; yield ['uk', 'uk']; yield ['zh', 'zh']; yield ['zh_cn', 'zh']; yield ['zh_CN', 'zh']; yield ['unknown', 'en']; yield ['', 'en']; } public function testConstantsDifference(): void { self::assertSame( array_diff(Languages::LANGUAGES, Languages::INACTIVE_ONLINE_LANGUAGES), Languages::ACTIVE_ONLINE_LANGUAGES, ); } public function testLanguagesIncGlobalVariables(): void { global $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES, $ACTIVE_ONLINE_LANGUAGES; include __DIR__ . '/../../../include/languages.inc'; self::assertSame(Languages::LANGUAGES, $LANGUAGES); self::assertSame(Languages::INACTIVE_ONLINE_LANGUAGES, $INACTIVE_ONLINE_LANGUAGES); self::assertSame(Languages::ACTIVE_ONLINE_LANGUAGES, $ACTIVE_ONLINE_LANGUAGES); } }