Skip to content
Snippets Groups Projects
Commit 6dcd97cf authored by Sascha Eggenberger's avatar Sascha Eggenberger
Browse files

Update Functional tests

parent fc1825ba
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ class GinTest extends BrowserTestBase {
*
* @var string[]
*/
public static $modules = ['shortcut'];
protected static $modules = ['shortcut'];
/**
* {@inheritdoc}
......@@ -106,18 +106,20 @@ class GinTest extends BrowserTestBase {
$user1 = $this->createUser();
$this->drupalLogin($user1);
// Change something on the logged in user form.
$this->drupalGet($user1->toUrl('edit-form'));
$this->assertSession()->pageTextContains('"darkmode":"0"');
$this->assertStringContainsString('"darkmode":"0"', $this->drupalGet($user1->toUrl('edit-form')));
$this->submitForm([
'enable_user_settings' => TRUE,
'enable_darkmode' => '1',
], 'Save');
$this->assertSession()->pageTextContains('"darkmode":"1"');
$this->assertStringContainsString('"darkmode":"1"', $this->drupalGet($user1->toUrl('edit-form')));
// Login as admin.
$this->drupalLogin($this->rootUser);
$this->assertSession()->pageTextContains('"darkmode":"0"');
$this->assertStringContainsString('"darkmode":"0"', $this->drupalGet('edit-form'));
// Change something on user1 edit form.
$this->drupalGet($user1->toUrl('edit-form'));
$this->submitForm([
......@@ -127,13 +129,15 @@ class GinTest extends BrowserTestBase {
], 'Save');
// Check logged-in's user is not affected.
$this->assertSession()->pageTextContains('"highcontrastmode":false');
$this->assertSession()->pageTextContains('"darkmode":"0"');
$loggedInUserResponse = $this->drupalGet('edit-form');
$this->assertStringContainsString('"highcontrastmode":false', $loggedInUserResponse);
$this->assertStringContainsString('"darkmode":"0"', $loggedInUserResponse);
// Check settings of user1.
$this->drupalLogin($user1);
$this->assertSession()->pageTextContains('"highcontrastmode":true');
$this->assertSession()->pageTextContains('"darkmode":"1"');
$rootUserResponse = $this->drupalGet($user1->toUrl('edit-form'));
$this->assertStringContainsString('"highcontrastmode":true', $rootUserResponse);
$this->assertStringContainsString('"darkmode":"1"', $rootUserResponse);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment