You are here

public function UserAdminLanguageTest::testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage 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::testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage()
  2. 10 core/modules/user/tests/src/Functional/UserAdminLanguageTest.php \Drupal\Tests\user\Functional\UserAdminLanguageTest::testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage()

Tests that admin language is not configurable in single language sites.

File

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

Class

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

Namespace

Drupal\Tests\user\Functional

Code

public function testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage() {
  $this
    ->drupalLogin($this->adminUser);
  $this
    ->setLanguageNegotiation();
  $path = 'user/' . $this->adminUser
    ->id() . '/edit';
  $this
    ->drupalGet($path);

  // Ensure administration pages language settings widget is not available.
  $this
    ->assertNoFieldByXPath($this
    ->constructFieldXpath('id', 'edit-preferred-admin-langcode'), NULL, 'Administration pages language selector not available.');
}