diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/encryption/keys/storage.php | 16 | ||||
-rw-r--r-- | tests/lib/files/storage/wrapper/encryption.php | 2 | ||||
-rw-r--r-- | tests/lib/files/stream/encryption.php | 2 |
3 files changed, 20 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); diff --git a/tests/lib/files/storage/wrapper/encryption.php b/tests/lib/files/storage/wrapper/encryption.php index bf4464f0eb9..4f7a9e851c1 100644 --- a/tests/lib/files/storage/wrapper/encryption.php +++ b/tests/lib/files/storage/wrapper/encryption.php @@ -44,7 +44,9 @@ class Encryption extends \Test\Files\Storage\Storage { $file = $this->getMockBuilder('\OC\Encryption\File') ->disableOriginalConstructor() + ->setMethods(['getAccessList']) ->getMock(); + $file->expects($this->any())->method('getAccessList')->willReturn([]); $logger = $this->getMock('\OC\Log'); diff --git a/tests/lib/files/stream/encryption.php b/tests/lib/files/stream/encryption.php index 84156337ad7..53727a2213d 100644 --- a/tests/lib/files/stream/encryption.php +++ b/tests/lib/files/stream/encryption.php @@ -29,7 +29,9 @@ class Encryption extends \Test\TestCase { ->getMock(); $file = $this->getMockBuilder('\OC\Encryption\File') ->disableOriginalConstructor() + ->setMethods(['getAccessList']) ->getMock(); + $file->expects($this->any())->method('getAccessList')->willReturn([]); $util = $this->getMock('\OC\Encryption\Util', ['getUidAndFilename'], [new View(), new \OC\User\Manager(), $config]); $util->expects($this->any()) ->method('getUidAndFilename') |