aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/tests
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2019-11-04 16:54:22 +0100
committerRobin Appelman <robin@icewind.nl>2019-11-04 16:54:22 +0100
commit964dc0a95520efbf876e0113bfafc294f4f4b322 (patch)
treecbeca4596bf35a81721ee4a9aa83b14a0e5d9051 /apps/files_trashbin/tests
parente225a7bfd33f4ff986c9adf1f237a1c9c6b597a4 (diff)
downloadnextcloud-server-964dc0a95520efbf876e0113bfafc294f4f4b322.tar.gz
nextcloud-server-964dc0a95520efbf876e0113bfafc294f4f4b322.zip
set retention obligation on existing `expiration` in tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_trashbin/tests')
-rw-r--r--apps/files_trashbin/tests/TrashbinTest.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php
index 3263feb4a95..22b6e87317c 100644
--- a/apps/files_trashbin/tests/TrashbinTest.php
+++ b/apps/files_trashbin/tests/TrashbinTest.php
@@ -76,7 +76,9 @@ class TrashbinTest extends \Test\TestCase {
$config = \OC::$server->getConfig();
//configure trashbin
self::$rememberRetentionObligation = $config->getSystemValue('trashbin_retention_obligation', \OCA\Files_Trashbin\Expiration::DEFAULT_RETENTION_OBLIGATION);
- $config->setSystemValue('trashbin_retention_obligation', 'auto, 2');
+ /** @var \OCA\Files_Trashbin\Expiration $expiration */
+ $expiration = \OC::$server->query(\OCA\Files_Trashbin\Expiration::class);
+ $expiration->setRetentionObligation('auto, 2');
// register hooks
\OCA\Files_Trashbin\Trashbin::registerHooks();
@@ -94,7 +96,9 @@ class TrashbinTest extends \Test\TestCase {
$user->delete();
}
- \OC::$server->getConfig()->setSystemValue('trashbin_retention_obligation', self::$rememberRetentionObligation);
+ /** @var \OCA\Files_Trashbin\Expiration $expiration */
+ $expiration = \OC::$server->query(\OCA\Files_Trashbin\Expiration::class);
+ $expiration->setRetentionObligation(self::$rememberRetentionObligation);
\OC_Hook::clear();
@@ -686,9 +690,9 @@ class TrashbinForTesting extends \OCA\Files_Trashbin\Trashbin {
* @param OCP\Files\FileInfo[] $files
* @param integer $limit
*/
- public function dummyDeleteExpiredFiles($files, $limit) {
+ public function dummyDeleteExpiredFiles($files) {
// dummy value for $retention_obligation because it is not needed here
- return parent::deleteExpiredFiles($files, TrashbinTest::TEST_TRASHBIN_USER1, $limit, 0);
+ return parent::deleteExpiredFiles($files, TrashbinTest::TEST_TRASHBIN_USER1);
}
/**