function UserAgentTest::getMappings

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php \Drupal\Tests\Component\Utility\UserAgentTest::getMappings()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php \Drupal\Tests\Component\Utility\UserAgentTest::getMappings()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php \Drupal\Tests\Component\Utility\UserAgentTest::getMappings()

Helper method to supply language mappings to testGetBestMatchingLangcode().

Return value

array Language mappings.

1 call to UserAgentTest::getMappings()
UserAgentTest::testGetBestMatchingLangcode in core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php
Tests matching language from user agent.

File

core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php, line 56

Class

UserAgentTest
Tests bytes size parsing helper methods.

Namespace

Drupal\Tests\Component\Utility

Code

protected function getMappings() {
    return [
        'no' => 'nb',
        'pt' => 'pt-pt',
        'zh' => 'zh-hans',
        'zh-tw' => 'zh-hant',
        'zh-hk' => 'zh-hant',
        'zh-mo' => 'zh-hant',
        'zh-cht' => 'zh-hant',
        'zh-cn' => 'zh-hans',
        'zh-sg' => 'zh-hans',
        'zh-chs' => 'zh-hans',
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.