You are here

function BasicAuthTest::testLocale in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php \Drupal\basic_auth\Tests\Authentication\BasicAuthTest::testLocale()

Tests compatibility with locale/UI translation.

File

core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php, line 146
Contains \Drupal\basic_auth\Tests\Authentication\BasicAuthTest.

Class

BasicAuthTest
Tests for BasicAuth authentication provider.

Namespace

Drupal\basic_auth\Tests\Authentication

Code

function testLocale() {
  ConfigurableLanguage::createFromLangcode('de')
    ->save();
  $this
    ->config('system.site')
    ->set('default_langcode', 'de')
    ->save();
  $account = $this
    ->drupalCreateUser();
  $url = Url::fromRoute('router_test.11');
  $this
    ->basicAuthGet($url, $account
    ->getUsername(), $account->pass_raw);
  $this
    ->assertText($account
    ->getUsername(), 'Account name is displayed.');
  $this
    ->assertResponse('200', 'HTTP response is OK');
  $this
    ->curlClose();
}