diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-05-06 21:20:49 +0400 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-06-05 18:54:04 +0400 |
commit | eb29b2984cf81f25df42d59ce1d5c9a9b307763c (patch) | |
tree | 7277d43f58f92aa3fd58bb863bf4bbf344f4a71b /apps/files_encryption/tests/hooks.php | |
parent | 2d83424a29e4dbaeb16856c87378a753b10cdb90 (diff) |
use oc_preferences instead of oc_encryption to store encyption settings
Diffstat (limited to 'apps/files_encryption/tests/hooks.php')
-rw-r--r-- | apps/files_encryption/tests/hooks.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/files_encryption/tests/hooks.php b/apps/files_encryption/tests/hooks.php index 43703472618..95f5996bb8e 100644 --- a/apps/files_encryption/tests/hooks.php +++ b/apps/files_encryption/tests/hooks.php @@ -100,6 +100,29 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase { \OC_User::deleteUser(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2); } + function testDisableHook() { + // encryption is enabled and running so we should have some user specific + // settings in oc_preferences + $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*preferences` WHERE `appid` = ?'); + $result = $query->execute(array('files_encryption')); + $row = $result->fetchRow(); + $this->assertTrue(is_array($row)); + + // disabling the app should delete all user specific settings + \OCA\Encryption\Hooks::preDisable(array('app' => 'files_encryption')); + + // check if user specific settings for the encryption app are really gone + $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*preferences` WHERE `appid` = ?'); + $result = $query->execute(array('files_encryption')); + $row = $result->fetchRow(); + $this->assertFalse($row); + + // relogin user to initialize the encryption again + $user = \OCP\User::getUser(); + \Test_Encryption_Util::loginHelper($user); + + } + function testDeleteHooks() { // remember files_trashbin state |