diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-05-29 13:15:12 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-05-29 13:15:12 +0200 |
commit | 9a6d253af39dba49a1397416fb448e922df8a7a1 (patch) | |
tree | 18b6c00c1cb6a4d7eebe0c48998381956f1268b7 /apps/files_versions/tests/versions.php | |
parent | 173b14730556d1b32d06e6b362c65b4a6dabb178 (diff) | |
download | nextcloud-server-9a6d253af39dba49a1397416fb448e922df8a7a1.tar.gz nextcloud-server-9a6d253af39dba49a1397416fb448e922df8a7a1.zip |
Abort expiration when file is gone
Sometimes a background job for versions expiration was scheduled for a
file that has been moved or deleted since.
This prevents showing useless warnings in the log and simply bail out.
Diffstat (limited to 'apps/files_versions/tests/versions.php')
-rw-r--r-- | apps/files_versions/tests/versions.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_versions/tests/versions.php b/apps/files_versions/tests/versions.php index 685bf48d652..0b6bfc698d7 100644 --- a/apps/files_versions/tests/versions.php +++ b/apps/files_versions/tests/versions.php @@ -552,10 +552,20 @@ class Test_Files_Versioning extends \Test\TestCase { public function testGetVersionsEmptyFile() { // execute copy hook of versions app $versions = \OCA\Files_Versions\Storage::getVersions(self::TEST_VERSIONS_USER, ''); + $this->assertCount(0, $versions); + $versions = \OCA\Files_Versions\Storage::getVersions(self::TEST_VERSIONS_USER, null); $this->assertCount(0, $versions); } + public function testExpireNonexistingFile() { + $this->logout(); + // needed to have a FS setup (the background job does this) + \OC_Util::setupFS(self::TEST_VERSIONS_USER); + + $this->assertFalse(\OCA\Files_Versions\Storage::expire('/void/unexist.txt')); + } + public function testRestoreSameStorage() { \OC\Files\Filesystem::mkdir('sub'); $this->doTestRestore(); |