function UserAdminLanguageTest::setLanguageNegotiation

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

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 186

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->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.