diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-08 10:42:15 +0100 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-09 11:05:14 +0100 |
commit | ee65cd0bd80d3c46d1210e9a4e8b55b0252de450 (patch) | |
tree | c73462c80423d24100c16eef2fe4e240b6729fe6 /tests | |
parent | 7e0ddfe0d0dc2f947d1ed45d8fdc44f7badba6bb (diff) | |
download | nextcloud-server-ee65cd0bd80d3c46d1210e9a4e8b55b0252de450.tar.gz nextcloud-server-ee65cd0bd80d3c46d1210e9a4e8b55b0252de450.zip |
Only set the default expiration date on share creation
Fixes #19685
The default expiration date should only be set when we create a new
share. So if a share is created and the expiration date is unset. And
after that the password is updated the expiration date should remain
unset.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/share20/managertest.php | 16 |
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 |