summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/tests
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-10-10 15:34:19 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-10-20 11:29:20 +0200
commitcb3a4d22b17ee3dd016faf52530b8f888cef5723 (patch)
tree8d8e3e7bdc95344dc87ab1e36f73d26616843f21 /apps/files_encryption/tests
parentca0e3fdfea51d8db52341c3866102e7058abc9c0 (diff)
downloadnextcloud-server-cb3a4d22b17ee3dd016faf52530b8f888cef5723.tar.gz
nextcloud-server-cb3a4d22b17ee3dd016faf52530b8f888cef5723.zip
make tests compatible with hook based skeleton generation
Diffstat (limited to 'apps/files_encryption/tests')
-rwxr-xr-xapps/files_encryption/tests/crypt.php8
-rw-r--r--apps/files_encryption/tests/helper.php18
-rw-r--r--apps/files_encryption/tests/hooks.php8
-rw-r--r--apps/files_encryption/tests/keymanager.php8
-rw-r--r--apps/files_encryption/tests/proxy.php8
-rwxr-xr-xapps/files_encryption/tests/share.php8
-rw-r--r--apps/files_encryption/tests/stream.php8
-rwxr-xr-xapps/files_encryption/tests/trashbin.php8
-rwxr-xr-xapps/files_encryption/tests/util.php9
-rwxr-xr-xapps/files_encryption/tests/webdav.php8
10 files changed, 84 insertions, 7 deletions
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php
index 1bebb3cd36c..a89754d4a14 100755
--- a/apps/files_encryption/tests/crypt.php
+++ b/apps/files_encryption/tests/crypt.php
@@ -102,6 +102,14 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
public static function tearDownAfterClass() {
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Crypt::TEST_ENCRYPTION_CRYPT_USER1);
+
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
/**
diff --git a/apps/files_encryption/tests/helper.php b/apps/files_encryption/tests/helper.php
index b94fdeb4d6c..df7ff8cdb11 100644
--- a/apps/files_encryption/tests/helper.php
+++ b/apps/files_encryption/tests/helper.php
@@ -20,18 +20,27 @@ class Test_Encryption_Helper extends \PHPUnit_Framework_TestCase {
const TEST_ENCRYPTION_HELPER_USER1 = "test-helper-user1";
const TEST_ENCRYPTION_HELPER_USER2 = "test-helper-user2";
- public static function setUpBeforeClass() {
+ public function setUp() {
// create test user
\Test_Encryption_Util::loginHelper(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER2, true);
\Test_Encryption_Util::loginHelper(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER1, true);
}
- public static function tearDownAfterClass() {
+ public function tearDown() {
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER1);
\OC_User::deleteUser(\Test_Encryption_Helper::TEST_ENCRYPTION_HELPER_USER2);
+ }
+
+ public static function tearDownAfterClass() {
+
\OC_Hook::clear();
\OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
/**
@@ -157,11 +166,6 @@ class Test_Encryption_Helper extends \PHPUnit_Framework_TestCase {
$result
);
}
-
- // clean up
- $rootView->unlink($baseDir);
- \Test_Encryption_Util::logoutHelper();
- \OC_User::deleteUser($userName);
}
}
diff --git a/apps/files_encryption/tests/hooks.php b/apps/files_encryption/tests/hooks.php
index 14d44fe5bb3..c7353deee22 100644
--- a/apps/files_encryption/tests/hooks.php
+++ b/apps/files_encryption/tests/hooks.php
@@ -117,6 +117,14 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
\OC_User::deleteUser(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2);
+
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
function testDisableHook() {
diff --git a/apps/files_encryption/tests/keymanager.php b/apps/files_encryption/tests/keymanager.php
index e8a9d7dda53..ad7d2cfcd45 100644
--- a/apps/files_encryption/tests/keymanager.php
+++ b/apps/files_encryption/tests/keymanager.php
@@ -98,6 +98,14 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
if (self::$stateFilesTrashbin) {
OC_App::enable('files_trashbin');
}
+
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
/**
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
index 42637a52e04..56d6cd2f736 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -89,6 +89,14 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase {
public static function tearDownAfterClass() {
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Proxy::TEST_ENCRYPTION_PROXY_USER1);
+
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
/**
diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php
index 1cd7cfc738b..f4ce94b7ee9 100755
--- a/apps/files_encryption/tests/share.php
+++ b/apps/files_encryption/tests/share.php
@@ -124,6 +124,14 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
\OC_User::deleteUser(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2);
\OC_User::deleteUser(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER3);
\OC_User::deleteUser(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER4);
+
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index 254c5e87ed1..b8c18fbe049 100644
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -96,6 +96,14 @@ class Test_Encryption_Stream extends \PHPUnit_Framework_TestCase {
public static function tearDownAfterClass() {
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Stream::TEST_ENCRYPTION_STREAM_USER1);
+
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
function testStreamOptions() {
diff --git a/apps/files_encryption/tests/trashbin.php b/apps/files_encryption/tests/trashbin.php
index ae0974431be..5890292cd7b 100755
--- a/apps/files_encryption/tests/trashbin.php
+++ b/apps/files_encryption/tests/trashbin.php
@@ -110,6 +110,14 @@ class Test_Encryption_Trashbin extends \PHPUnit_Framework_TestCase {
public static function tearDownAfterClass() {
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Trashbin::TEST_ENCRYPTION_TRASHBIN_USER1);
+
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
/**
diff --git a/apps/files_encryption/tests/util.php b/apps/files_encryption/tests/util.php
index 811530546e8..d5bfb86a2e4 100755
--- a/apps/files_encryption/tests/util.php
+++ b/apps/files_encryption/tests/util.php
@@ -124,9 +124,18 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
\OC_User::deleteUser(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER1);
\OC_User::deleteUser(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_USER2);
\OC_User::deleteUser(\Test_Encryption_Util::TEST_ENCRYPTION_UTIL_LEGACY_USER);
+
//cleanup groups
\OC_Group::deleteGroup(self::TEST_ENCRYPTION_UTIL_GROUP1);
\OC_Group::deleteGroup(self::TEST_ENCRYPTION_UTIL_GROUP2);
+
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
public static function setupHooks() {
diff --git a/apps/files_encryption/tests/webdav.php b/apps/files_encryption/tests/webdav.php
index c46d3bf0899..cc0cff9aa5c 100755
--- a/apps/files_encryption/tests/webdav.php
+++ b/apps/files_encryption/tests/webdav.php
@@ -108,6 +108,14 @@ class Test_Encryption_Webdav extends \PHPUnit_Framework_TestCase {
public static function tearDownAfterClass() {
// cleanup test user
\OC_User::deleteUser(\Test_Encryption_Webdav::TEST_ENCRYPTION_WEBDAV_USER1);
+
+ \OC_Hook::clear();
+ \OC_FileProxy::clearProxies();
+
+ // Delete keys in /data/
+ $view = new \OC\Files\View('/');
+ $view->rmdir('public-keys');
+ $view->rmdir('owncloud_private_key');
}
/**