summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-09 23:38:00 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-09 23:38:00 +0100
commit29f6f451a955507a8dff4a5d819e636f14b82ce5 (patch)
tree2f5e3da200fd6687ad0d92b9b7ff65c9749e5a07 /tests
parentfebe5359aaea69e8072fd0e28d01349e27dd6cc4 (diff)
parent49726470abe14b23543dab0d5ba5af939d1f7634 (diff)
downloadnextcloud-server-29f6f451a955507a8dff4a5d819e636f14b82ce5.tar.gz
nextcloud-server-29f6f451a955507a8dff4a5d819e636f14b82ce5.zip
Merge pull request #22192 from owncloud/fix_19685
Only set the default expiration date on share creation
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/share20/managertest.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/lib/share20/managertest.php b/tests/lib/share20/managertest.php
index ea0fb1838d7..73a1b0a6530 100644
--- a/tests/lib/share20/managertest.php
+++ b/tests/lib/share20/managertest.php
@@ -890,6 +890,22 @@ class ManagerTest extends \Test\TestCase {
$this->invokePrivate($this->manager, 'validateExpirationDate', [$share]);
}
+ public function testValidateExpirationDateExistingShareNoDefault() {
+ $share = $this->manager->newShare();
+
+ $share->setId('42')->setProviderId('foo');
+
+ $this->config->method('getAppValue')
+ ->will($this->returnValueMap([
+ ['core', 'shareapi_default_expire_date', 'no', 'yes'],
+ ['core', 'shareapi_expire_after_n_days', '7', '6'],
+ ]));
+
+ $this->invokePrivate($this->manager, 'validateExpirationDate', [$share]);
+
+ $this->assertEquals(null, $share->getExpirationDate());
+ }
+
/**
* @expectedException Exception
* @expectedExceptionMessage Only sharing with group members is allowed