aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-03-19 17:06:04 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-03-19 17:06:04 +0100
commit857b22c61be8f78581f41ac155efeff34ed335cd (patch)
tree381c0564f571ecfcf11b9153735976912261b4c8 /apps
parent3765af4edf6662b29881f0b430e4080301c1b2fc (diff)
parentdd3307dd19bb2b61b194ba7962035a6ceae64249 (diff)
downloadnextcloud-server-857b22c61be8f78581f41ac155efeff34ed335cd.tar.gz
nextcloud-server-857b22c61be8f78581f41ac155efeff34ed335cd.zip
Merge pull request #15025 from rullzer/ocs_respect_enforced_date
Ocs respect enforced date
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/tests/api.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php
index 9256f9bcc85..371c94a8c88 100644
--- a/apps/files_sharing/tests/api.php
+++ b/apps/files_sharing/tests/api.php
@@ -1079,6 +1079,24 @@ class Test_Files_Sharing_Api extends TestCase {
$this->assertTrue(is_array($updatedLinkShare));
$this->assertEquals($dateWithinRange->format('Y-m-d') . ' 00:00:00', $updatedLinkShare['expiration']);
+
+ // Try to remove expire date
+ $params = array();
+ $params['id'] = $linkShare['id'];
+ $params['_put'] = ['expireDate' => ''];
+
+ $result = \OCA\Files_Sharing\API\Local::updateShare($params);
+
+ $this->assertFalse($result->succeeded());
+
+ $items = \OCP\Share::getItemShared('file', $linkShare['file_source']);
+
+ $updatedLinkShare = reset($items);
+
+ // date shouldn't be changed
+ $this->assertTrue(is_array($updatedLinkShare));
+ $this->assertEquals($dateWithinRange->format('Y-m-d') . ' 00:00:00', $updatedLinkShare['expiration']);
+
// cleanup
$config->setAppValue('core', 'shareapi_default_expire_date', 'no');
$config->setAppValue('core', 'shareapi_enforce_expire_date', 'no');