public function UserAdminLanguageTest::testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation in Drupal 8
Same name and namespace in other branches
- 9 core/modules/user/tests/src/Functional/UserAdminLanguageTest.php \Drupal\Tests\user\Functional\UserAdminLanguageTest::testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation()
- 10 core/modules/user/tests/src/Functional/UserAdminLanguageTest.php \Drupal\Tests\user\Functional\UserAdminLanguageTest::testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation()
Tests that admin language negotiation is configurable only if enabled.
File
- core/
modules/ user/ tests/ src/ Functional/ UserAdminLanguageTest.php, line 67
Class
- UserAdminLanguageTest
- Tests users' ability to change their own administration language.
Namespace
Drupal\Tests\user\FunctionalCode
public function testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation() {
$this
->drupalLogin($this->adminUser);
$this
->addCustomLanguage();
$path = 'user/' . $this->adminUser
->id() . '/edit';
// Checks with user administration pages language negotiation disabled.
$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.');
// Checks with user administration pages language negotiation enabled.
$this
->setLanguageNegotiation();
$this
->drupalGet($path);
// Ensure administration pages language settings widget is available.
$this
->assertFieldByXPath($this
->constructFieldXpath('id', 'edit-preferred-admin-langcode'), NULL, 'Administration pages language selector is available.');
}