function UserAdminLanguageTest::setLanguageNegotiation
Same name and namespace in other branches
- 11.x core/modules/user/tests/src/Functional/UserAdminLanguageTest.php \Drupal\Tests\user\Functional\UserAdminLanguageTest::setLanguageNegotiation()
- 10 core/modules/user/tests/src/Functional/UserAdminLanguageTest.php \Drupal\Tests\user\Functional\UserAdminLanguageTest::setLanguageNegotiation()
- 8.9.x core/modules/user/tests/src/Functional/UserAdminLanguageTest.php \Drupal\Tests\user\Functional\UserAdminLanguageTest::setLanguageNegotiation()
Sets the User interface negotiation detection method.
Enables the "Account preference for administration pages" language detection method for the User interface language negotiation type.
Parameters
bool $admin_first: Whether the admin negotiation should be first.
File
-
core/
modules/ user/ tests/ src/ Functional/ UserAdminLanguageTest.php, line 179
Class
- UserAdminLanguageTest
- Tests users' ability to change their own administration language.
Namespace
Drupal\Tests\user\FunctionalCode
public function setLanguageNegotiation($admin_first = FALSE) {
$edit = [
'language_interface[enabled][language-user-admin]' => TRUE,
'language_interface[enabled][language-url]' => TRUE,
'language_interface[weight][language-user-admin]' => $admin_first ? -12 : -8,
'language_interface[weight][language-url]' => -10,
];
$this->drupalGet('admin/config/regional/language/detection');
$this->submitForm($edit, 'Save settings');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.