You are here

public function UserAdminLanguageTest::setLanguageNegotiation in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/user/tests/src/Functional/UserAdminLanguageTest.php \Drupal\Tests\user\Functional\UserAdminLanguageTest::setLanguageNegotiation()
  2. 10 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.

4 calls to UserAdminLanguageTest::setLanguageNegotiation()
UserAdminLanguageTest::testActualNegotiation in core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
Tests the actual language negotiation.
UserAdminLanguageTest::testUserAdminLanguageConfigurationAvailableIfAdminLanguageNegotiationIsEnabled in core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
Tests that the admin language is configurable only for administrators.
UserAdminLanguageTest::testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation in core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
Tests that admin language negotiation is configurable only if enabled.
UserAdminLanguageTest::testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage in core/modules/user/tests/src/Functional/UserAdminLanguageTest.php
Tests that admin language is not configurable in single language sites.

File

core/modules/user/tests/src/Functional/UserAdminLanguageTest.php, line 174

Class

UserAdminLanguageTest
Tests users' ability to change their own administration language.

Namespace

Drupal\Tests\user\Functional

Code

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
    ->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
}