aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-03-27 16:07:41 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-03-27 16:07:41 +0100
commit4d12c4a38b13e2319b85db27b03ba0eb6b9cff35 (patch)
treefe7934b972d2423c702c92366c17600fecaf3857 /apps/files_sharing
parent722e50a112579d851b958a21cf26c2e85a4ce5c2 (diff)
parent378eef7eb45bd2ec8e6a06e2ba776f55078dcbef (diff)
downloadnextcloud-server-4d12c4a38b13e2319b85db27b03ba0eb6b9cff35.tar.gz
nextcloud-server-4d12c4a38b13e2319b85db27b03ba0eb6b9cff35.zip
Merge pull request #13938 from owncloud/deprecate-iappconfig
Deprecated \OCP\IAppConfig - add missing methods to IConfig
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/tests/api.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php
index d3f0171075e..44c6b1dc4b9 100644
--- a/apps/files_sharing/tests/api.php
+++ b/apps/files_sharing/tests/api.php
@@ -1312,9 +1312,19 @@ class Test_Files_Sharing_Api extends TestCase {
public function testDefaultExpireDate() {
\Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1);
- \OC::$server->getAppConfig()->setValue('core', 'shareapi_default_expire_date', 'yes');
- \OC::$server->getAppConfig()->setValue('core', 'shareapi_enforce_expire_date', 'yes');
- \OC::$server->getAppConfig()->setValue('core', 'shareapi_expire_after_n_days', '2');
+
+ // TODO drop this once all code paths use the DI version - otherwise
+ // the cache inside this config object is out of date because
+ // OC_Appconfig is used and bypasses this cache which lead to integrity
+ // constraint violations
+ $config = \OC::$server->getConfig();
+ $config->deleteAppValue('core', 'shareapi_default_expire_date');
+ $config->deleteAppValue('core', 'shareapi_enforce_expire_date');
+ $config->deleteAppValue('core', 'shareapi_expire_after_n_days');
+
+ $config->setAppValue('core', 'shareapi_default_expire_date', 'yes');
+ $config->setAppValue('core', 'shareapi_enforce_expire_date', 'yes');
+ $config->setAppValue('core', 'shareapi_expire_after_n_days', '2');
// default expire date is set to 2 days
// the time when the share was created is set to 3 days in the past
@@ -1358,8 +1368,8 @@ class Test_Files_Sharing_Api extends TestCase {
//cleanup
$result = \OCP\Share::unshare('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
$this->assertTrue($result);
- \OC::$server->getAppConfig()->setValue('core', 'shareapi_default_expire_date', 'no');
- \OC::$server->getAppConfig()->setValue('core', 'shareapi_enforce_expire_date', 'no');
+ $config->setAppValue('core', 'shareapi_default_expire_date', 'no');
+ $config->setAppValue('core', 'shareapi_enforce_expire_date', 'no');
}
}