You are here

public function UserAgentTest::testGetBestMatchingLangcode in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php \Drupal\Tests\Component\Utility\UserAgentTest::testGetBestMatchingLangcode()

Test matching language from user agent.

@dataProvider providerTestGetBestMatchingLangcode @covers ::getBestMatchingLangcode

File

core/tests/Drupal/Tests/Component/Utility/UserAgentTest.php, line 77
Contains \Drupal\Tests\Component\Utility\UserAgentTest.

Class

UserAgentTest
Tests bytes size parsing helper methods.

Namespace

Drupal\Tests\Component\Utility

Code

public function testGetBestMatchingLangcode($accept_language, $expected) {
  $result = UserAgent::getBestMatchingLangcode($accept_language, $this
    ->getLanguages(), $this
    ->getMappings());
  $this
    ->assertSame($expected, $result);
}