summaryrefslogtreecommitdiffstats
path: root/apps/encryption/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-05-18 14:59:34 +0200
committerVincent Petry <pvince81@owncloud.com>2015-05-18 14:59:34 +0200
commit86cf8e1f689db6e6781c78eae9a057c7d9548c0a (patch)
tree5a7ac649e04e090eb5be27df67ad56a188162554 /apps/encryption/tests
parent85f500f07037cab21757fffcae7a5cd78db43bd1 (diff)
parent7d492fefae25ce11944ac611229eb3a949908e55 (diff)
downloadnextcloud-server-86cf8e1f689db6e6781c78eae9a057c7d9548c0a.tar.gz
nextcloud-server-86cf8e1f689db6e6781c78eae9a057c7d9548c0a.zip
Merge pull request #16404 from owncloud/enc_encrypt_files_in_trash
also encrypt files in trash bin
Diffstat (limited to 'apps/encryption/tests')
-rw-r--r--apps/encryption/tests/lib/crypto/encryptionTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/encryption/tests/lib/crypto/encryptionTest.php b/apps/encryption/tests/lib/crypto/encryptionTest.php
index aa28a8b44a4..960ed112488 100644
--- a/apps/encryption/tests/lib/crypto/encryptionTest.php
+++ b/apps/encryption/tests/lib/crypto/encryptionTest.php
@@ -220,4 +220,29 @@ class EncryptionTest extends TestCase {
);
}
+ /**
+ * by default the encryption module should encrypt regular files, files in
+ * files_versions and files in files_trashbin
+ *
+ * @dataProvider dataTestShouldEncrypt
+ */
+ public function testShouldEncrypt($path, $expected) {
+ $this->assertSame($expected,
+ $this->instance->shouldEncrypt($path)
+ );
+ }
+
+ public function dataTestShouldEncrypt() {
+ return array(
+ array('/user1/files/foo.txt', true),
+ array('/user1/files_versions/foo.txt', true),
+ array('/user1/files_trashbin/foo.txt', true),
+ array('/user1/some_folder/foo.txt', false),
+ array('/user1/foo.txt', false),
+ array('/user1/files', false),
+ array('/user1/files_trashbin', false),
+ array('/user1/files_versions', false),
+ );
+ }
+
}