diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-11-10 12:40:24 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-11-26 10:57:47 +0100 |
commit | fd86d76f98f58ef232de58cc55401d85de262d0a (patch) | |
tree | e70c5c202d6de38a8bd9c7d43df8e024704ef4da /apps/files_encryption/tests/helper.php | |
parent | c5fa8f1bdc08b07d03fcc9f9c84033960ec4e20f (diff) | |
download | nextcloud-server-fd86d76f98f58ef232de58cc55401d85de262d0a.tar.gz nextcloud-server-fd86d76f98f58ef232de58cc55401d85de262d0a.zip |
new folder structure for keys
all keys are now in files_encryption/key/path_to_file/filename/
share keys are named: user.shareKey
file key is named: fileKey
Diffstat (limited to 'apps/files_encryption/tests/helper.php')
-rw-r--r-- | apps/files_encryption/tests/helper.php | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/apps/files_encryption/tests/helper.php b/apps/files_encryption/tests/helper.php index fcde7dc5df3..f0e3408b2e0 100644 --- a/apps/files_encryption/tests/helper.php +++ b/apps/files_encryption/tests/helper.php @@ -125,56 +125,4 @@ class Test_Encryption_Helper extends \OCA\Files_Encryption\Tests\TestCase { self::cleanUpUsers(); } - function userNamesProvider() { - return array( - array('testuser' . $this->getUniqueID()), - array('user.name.with.dots'), - ); - } - - /** - * Tests whether share keys can be found - * - * @dataProvider userNamesProvider - */ - function testFindShareKeys($userName) { - self::setUpUsers(); - // note: not using dataProvider as we want to make - // sure that the correct keys are match and not any - // other ones that might happen to have similar names - self::setupHooks(); - self::loginHelper($userName, true); - $testDir = 'testFindShareKeys' . $this->getUniqueID() . '/'; - $baseDir = $userName . '/files/' . $testDir; - $fileList = array( - 't est.txt', - 't est_.txt', - 't est.doc.txt', - 't est(.*).txt', // make sure the regexp is escaped - 'multiple.dots.can.happen.too.txt', - 't est.' . $userName . '.txt', - 't est_.' . $userName . '.shareKey.txt', - 'who would upload their.shareKey', - 'user ones file.txt', - 'user ones file.txt.backup', - '.t est.txt' - ); - - $rootView = new \OC\Files\View('/'); - $rootView->mkdir($baseDir); - foreach ($fileList as $fileName) { - $rootView->file_put_contents($baseDir . $fileName, 'dummy'); - } - - $shareKeysDir = $userName . '/files_encryption/share-keys/' . $testDir; - foreach ($fileList as $fileName) { - // make sure that every file only gets its correct respective keys - $result = Encryption\Helper::findShareKeys($baseDir . $fileName, $shareKeysDir . $fileName, $rootView); - $this->assertEquals( - array($shareKeysDir . $fileName . '.' . $userName . '.shareKey'), - $result - ); - } - self::cleanUpUsers(); - } } |