You are here

public function UserAdminLanguageTest::testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/user/tests/src/Functional/UserAdminLanguageTest.php \Drupal\Tests\user\Functional\UserAdminLanguageTest::testUserAdminLanguageConfigurationNotAvailableWithOnlyOneLanguage()
  2. 9 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
    ->assertSession()
    ->fieldNotExists('edit-preferred-admin-langcode');
}