public function BasicAuthTest::testLocale in Drupal 9
Same name and namespace in other branches
- 8 core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php \Drupal\Tests\basic_auth\Functional\BasicAuthTest::testLocale()
Tests compatibility with locale/UI translation.
File
- core/
modules/ basic_auth/ tests/ src/ Functional/ BasicAuthTest.php, line 159
Class
- BasicAuthTest
- Tests for BasicAuth authentication provider.
Namespace
Drupal\Tests\basic_auth\FunctionalCode
public 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
->getAccountName(), $account->pass_raw);
$this
->assertSession()
->pageTextContains($account
->getAccountName());
$this
->assertSession()
->statusCodeEquals(200);
}