function UserAdminLanguageTest::testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/user/src/Tests/UserAdminLanguageTest.php \Drupal\user\Tests\UserAdminLanguageTest::testUserAdminLanguageConfigurationAvailableWithAdminLanguageNegotiation()
Tests that admin language negotiation is configurable only if enabled.
File
- core/
modules/ user/ src/ Tests/ UserAdminLanguageTest.php, line 64 - Contains \Drupal\user\Tests\UserAdminLanguageTest.
Class
- UserAdminLanguageTest
- Tests users' ability to change their own administration language.
Namespace
Drupal\user\TestsCode
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.');
}