Skip to content

Commit

Permalink
ltb-project#19: Removed unneccessarily long list of User-Agent langua…
Browse files Browse the repository at this point in the history
…ges.
  • Loading branch information
abpai94 committed Jul 18, 2024
1 parent 0bbb8dc commit d0c1456
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Ltb/LanguageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ final class LanguageTest extends \Mockery\Adapter\Phpunit\MockeryTestCase
{
function test_accept_all_language() {
# User-Agent Language
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = "ar;q=1, cn;q=1, de;q=1, el;q=1, es;q=1, fr;q=1, it;q=1, nb-NO;q=1, pl;q=1, pt-PT;q=1, ru;q=1, sl;q=1, tr;q=1, zh-CN;q=1, ca;q=1, cs;q=1, ee;q=1, en;q=1, eu;q=1, hu;q=1, ja;q=1, nl;q=1, pt-BR;q=1, rs;q=1, sk;q=1, sv;q=1, uk;q=1, zh-TW;q=1";
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = "en";

$availableLanguages = array("ar", "cn", "de", "el", "es", "fr", "it", "nb-NO", "pl", "pt-PT", "ru", "sl", "tr", "zh-CN", "ca", "cs", "ee", "en", "eu", "hu", "ja", "nl", "pt-BR", "rs", "sk", "sv", "uk", "zh-TW");
$defaultLanguage = "en";

# Execute function
$chosenLanguage = \Ltb\Language::detect_language($defaultLanguage, $availableLanguages);

$this->assertEquals("ar", $chosenLanguage);
$this->assertEquals("en", $chosenLanguage);
}

function test_restrict_language() {
Expand Down

0 comments on commit d0c1456

Please sign in to comment.