summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-09 14:45:40 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-09 14:45:40 +0200
commit1d9bd3d31e26d7a43940e0048199ea86a621cc57 (patch)
treef47b5b7e673344788c939a363a40e098be578483 /tests
parent9246c7e8ee2391f1c23d85dd0db2ca50968e6a4d (diff)
parent45575d0135368169af71379a39c8914e7a1cf524 (diff)
downloadnextcloud-server-1d9bd3d31e26d7a43940e0048199ea86a621cc57.tar.gz
nextcloud-server-1d9bd3d31e26d7a43940e0048199ea86a621cc57.zip
Merge pull request #15496 from owncloud/enc-check-if-key-exists-before-deleting
Check if the key exists, before trying to delete it
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/encryption/keys/storage.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/lib/encryption/keys/storage.php b/tests/lib/encryption/keys/storage.php
index 8ab46987f8c..bcf1c0f7624 100644
--- a/tests/lib/encryption/keys/storage.php
+++ b/tests/lib/encryption/keys/storage.php
@@ -198,6 +198,10 @@ class StorageTest extends TestCase {
public function testDeleteUserKey() {
$this->view->expects($this->once())
+ ->method('file_exists')
+ ->with($this->equalTo('/user1/files_encryption/encModule/user1.publicKey'))
+ ->willReturn(true);
+ $this->view->expects($this->once())
->method('unlink')
->with($this->equalTo('/user1/files_encryption/encModule/user1.publicKey'))
->willReturn(true);
@@ -209,6 +213,10 @@ class StorageTest extends TestCase {
public function testDeleteSystemUserKey() {
$this->view->expects($this->once())
+ ->method('file_exists')
+ ->with($this->equalTo('/files_encryption/encModule/shareKey_56884'))
+ ->willReturn(true);
+ $this->view->expects($this->once())
->method('unlink')
->with($this->equalTo('/files_encryption/encModule/shareKey_56884'))
->willReturn(true);
@@ -229,6 +237,10 @@ class StorageTest extends TestCase {
->method('isSystemWideMountPoint')
->willReturn(true);
$this->view->expects($this->once())
+ ->method('file_exists')
+ ->with($this->equalTo('/files_encryption/keys/files/foo.txt/encModule/fileKey'))
+ ->willReturn(true);
+ $this->view->expects($this->once())
->method('unlink')
->with($this->equalTo('/files_encryption/keys/files/foo.txt/encModule/fileKey'))
->willReturn(true);
@@ -249,6 +261,10 @@ class StorageTest extends TestCase {
->method('isSystemWideMountPoint')
->willReturn(false);
$this->view->expects($this->once())
+ ->method('file_exists')
+ ->with($this->equalTo('/user1/files_encryption/keys/files/foo.txt/encModule/fileKey'))
+ ->willReturn(true);
+ $this->view->expects($this->once())
->method('unlink')
->with($this->equalTo('/user1/files_encryption/keys/files/foo.txt/encModule/fileKey'))
->willReturn(true);