Skip to content

Commit

Permalink
Update tests based on recent settings changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kovah committed Oct 9, 2020
1 parent c6bec43 commit 2a046f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Controller/App/UserSettingsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function testValidUpdateAccountSettingsResponse(): void
public function testValidUpdateApplicationSettingsResponse(): void
{
$response = $this->post('settings/app', [
'locale' => 'en_US',
'timezone' => 'Europe/Berlin',
'links_private_default' => '1',
'notes_private_default' => '1',
Expand All @@ -68,6 +69,7 @@ public function testValidUpdateApplicationSettingsResponse(): void

$this->user->load('rawSettings'); // Reload cached settings from other tests

$this->assertEquals('en_US', usersettings('locale'));
$this->assertEquals('Europe/Berlin', usersettings('timezone'));
$this->assertEquals('1', usersettings('links_private_default'));
$this->assertEquals('1', usersettings('notes_private_default'));
Expand Down
5 changes: 5 additions & 0 deletions tests/Helper/HelperFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,16 @@ public function testGetAllUserSettings(): void
$this->actingAs($this->user);

$this->post('settings/app', [
'locale' => 'en_US',
'timezone' => 'Europe/Berlin',
]);

$this->user->load('rawSettings'); // Reload cached settings from other tests

$settings = usersettings();

$this->assertArrayHasKey('locale', $settings);
$this->assertEquals('en_US', $settings['locale']);
$this->assertArrayHasKey('timezone', $settings);
$this->assertEquals('Europe/Berlin', $settings['timezone']);
}
Expand Down Expand Up @@ -75,6 +78,7 @@ public function testDateTimeFormatterWithUserSettings(): void
$this->actingAs($this->user);

$this->post('settings/app', [
'locale' => 'en_US',
'timezone' => 'Europe/Berlin',
'date_format' => 'd.m.Y',
'time_format' => 'H:i:s',
Expand All @@ -97,6 +101,7 @@ public function testPaginationLimitWithUserSettings(): void
$this->actingAs($this->user);

$this->post('settings/app', [
'locale' => 'en_US',
'timezone' => 'Europe/Berlin',
'listitem_count' => '100',
]);
Expand Down

0 comments on commit 2a046f3

Please sign in to comment.