aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/tests/ApiTest.php
diff options
context:
space:
mode:
authorBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2024-01-09 00:46:26 +0100
committerBenjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>2024-01-09 17:28:11 +0100
commitcc3a2c351a2db4c30a2f0dc1bde73ba024e88602 (patch)
tree74e8512c4e6eec33b812296dfa90899037daad33 /apps/files_sharing/tests/ApiTest.php
parentd72db91785174ad19b0057264506f24cfc03494c (diff)
downloadnextcloud-server-cc3a2c351a2db4c30a2f0dc1bde73ba024e88602.tar.gz
nextcloud-server-cc3a2c351a2db4c30a2f0dc1bde73ba024e88602.zip
fix(share): use user timezone to parse share expiration date
If an user in UTC+1 try to create a share at 00:00, it's day D for him, but D-1 for the server (UTC). This fix aims to apply the correct offset Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Diffstat (limited to 'apps/files_sharing/tests/ApiTest.php')
-rw-r--r--apps/files_sharing/tests/ApiTest.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php
index a50bfe5bee4..7e916f621aa 100644
--- a/apps/files_sharing/tests/ApiTest.php
+++ b/apps/files_sharing/tests/ApiTest.php
@@ -44,6 +44,7 @@ use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCS\OCSForbiddenException;
use OCP\AppFramework\OCS\OCSNotFoundException;
use OCP\IConfig;
+use OCP\IDateTimeZone;
use OCP\IL10N;
use OCP\IPreview;
use OCP\IRequest;
@@ -122,6 +123,7 @@ class ApiTest extends TestCase {
$serverContainer = $this->createMock(IServerContainer::class);
$userStatusManager = $this->createMock(IUserStatusManager::class);
$previewManager = $this->createMock(IPreview::class);
+ $dateTimeZone = $this->createMock(IDateTimeZone::class);
return new ShareAPIController(
self::APP_NAME,
@@ -137,7 +139,8 @@ class ApiTest extends TestCase {
$appManager,
$serverContainer,
$userStatusManager,
- $previewManager
+ $previewManager,
+ $dateTimeZone,
);
}