function AdminTest::disabledTestUserSettings
Same name and namespace in other branches
- main core/themes/admin/tests/src/Functional/AdminTest.php \Drupal\Tests\admin\Functional\AdminTest::disabledTestUserSettings()
Disabled: Test user settings.
File
-
core/
themes/ admin/ tests/ src/ Functional/ AdminTest.php, line 125
Class
- AdminTest
- Tests the Admin theme.
Namespace
Drupal\Tests\admin\FunctionalCode
public function disabledTestUserSettings() : void {
$user1 = $this->createUser();
$this->drupalLogin($user1);
// Change something on user1 edit form.
$this->drupalGet($user1->toUrl('edit-form'));
$this->submitForm([
'enable_user_settings' => TRUE,
'high_contrast_mode' => TRUE,
'enable_dark_mode' => '1',
], 'Save');
// Check logged-in's user is not affected.
$loggedInUserResponse = $this->drupalGet('edit-form');
$this->assertStringContainsString('"high_contrast_mode":false', $loggedInUserResponse);
$this->assertStringContainsString('"dark_mode":"0"', $loggedInUserResponse);
// Check settings of user1.
$this->drupalLogin($user1);
$rootUserResponse = $this->drupalGet($user1->toUrl('edit-form'));
$this->assertStringContainsString('"high_contrast_mode":true', $rootUserResponse);
$this->assertStringContainsString('"dark_mode":"1"', $rootUserResponse);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.