You are here

protected function UserAgentTest::getMappings in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php \Drupal\Tests\Component\Utility\UserAgentTest::getMappings()
  2. 10 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
Test matching language from user agent.

File

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

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',
  ];
}