summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-21 00:00:55 +0200
committerFlorin Peter <github@florin-peter.de>2013-05-21 00:00:55 +0200
commit4bf840e2cabd6402d2f8f3b67118d6661b0c5833 (patch)
tree98cdf80de41b38bf23dc117858276dbb5f59093f /apps/files_encryption
parentf2b1158addeb53e2c1155228c4372209786a2133 (diff)
downloadnextcloud-server-4bf840e2cabd6402d2f8f3b67118d6661b0c5833.tar.gz
nextcloud-server-4bf840e2cabd6402d2f8f3b67118d6661b0c5833.zip
cleanup unused code optimize tests
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/appinfo/app.php3
-rwxr-xr-xapps/files_encryption/lib/helper.php10
-rwxr-xr-xapps/files_encryption/tests/share.php19
3 files changed, 17 insertions, 15 deletions
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index e56d012fee9..7d01696e08a 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -18,9 +18,6 @@ OCA\Encryption\Helper::registerUserHooks();
// Sharing related hooks
OCA\Encryption\Helper::registerShareHooks();
-// Webdav related hooks
-OCA\Encryption\Helper::registerWebdavHooks();
-
// Filesystem related hooks
OCA\Encryption\Helper::registerFilesystemHooks();
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index c57f0bc0092..e4bf2c1226a 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -59,16 +59,6 @@ class Helper
}
/**
- * @brief register webdav related hooks
- *
- */
- public static function registerWebdavHooks()
- {
-
-
- }
-
- /**
* @brief register filesystem related hooks
*
*/
diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php
index f302aa0a3ef..0b806394eb3 100755
--- a/apps/files_encryption/tests/share.php
+++ b/apps/files_encryption/tests/share.php
@@ -557,8 +557,14 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase
function testRecoveryFile()
{
- // login as admin
- $this->loginHelper('admin');
+ // disable encryption proxy to prevent recursive calls
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
+
+ $this->view->unlink('/owncloud_private_key');
+ $this->view->unlink('/public-keys');
+
+ \OC_FileProxy::$enabled = $proxyStatus;
\OCA\Encryption\Helper::adminEnableRecovery(null, 'test123');
$recoveryKeyId = OC_Appconfig::getValue('files_encryption', 'recoveryKeyId');
@@ -566,6 +572,9 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase
// check if control file created
$this->assertTrue($this->view->file_exists('/control-file/controlfile.enc'));
+ // login as admin
+ $this->loginHelper('admin');
+
$util = new \OCA\Encryption\Util(new \OC_FilesystemView('/'), 'admin');
// check if recovery password match
@@ -620,6 +629,9 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase
// check if share key for recovery not exists
$this->assertFalse($this->view->file_exists('/admin/files_encryption/share-keys/' . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
$this->assertFalse($this->view->file_exists('/admin/files_encryption/share-keys/' . $this->folder1 . $this->subfolder . $this->subsubfolder . '/' . $this->filename . '.' . $recoveryKeyId . '.shareKey'));
+
+ \OCA\Encryption\Helper::adminDisableRecovery('test123');
+ $this->assertEquals(0, \OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled'));
}
function testRecoveryForUser()
@@ -689,6 +701,9 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase
// enable recovery for admin
$this->assertTrue($util->setRecoveryForUser(0));
+
+ \OCA\Encryption\Helper::adminDisableRecovery('test123');
+ $this->assertEquals(0, \OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled'));
}
function testFailShareFile()