Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-17 03:07:26 +0400
committerFlorin Peter <github@florin-peter.de>2013-05-17 03:07:26 +0400
commita4c0eb17569457784faa06ed0b65a319f7ec2f78 (patch)
tree4f1df6edd3b0f3e8405638c087d2b2bf09a076f5 /apps/files_encryption/tests/crypt.php
parent42b4963dd010830d1a99666052ee2bfc7295249a (diff)
improved tests
Diffstat (limited to 'apps/files_encryption/tests/crypt.php')
-rwxr-xr-xapps/files_encryption/tests/crypt.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php
index 1caa9ea7da7..bfb5ca0ec8b 100755
--- a/apps/files_encryption/tests/crypt.php
+++ b/apps/files_encryption/tests/crypt.php
@@ -62,8 +62,17 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase {
// Filesystem related hooks
\OCA\Encryption\Helper::registerFilesystemHooks();
+ // Filesystem related hooks
+ \OCA\Encryption\Helper::registerUserHooks();
+
\OC_FileProxy::register(new OCA\Encryption\Proxy());
+ // remember files_trashbin state
+ $this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');
+
+ // we don't want to tests with app files_trashbin enabled
+ \OC_App::disable('files_trashbin');
+
\OC_Util::tearDownFS();
\OC_User::setUserId('');
\OC\Files\Filesystem::tearDown();
@@ -78,6 +87,13 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase {
function tearDown() {
\OC_FileProxy::clearProxies();
+
+ // reset app files_trashbin
+ if ($this->stateFilesTrashbin) {
+ OC_App::enable('files_trashbin');
+ } else {
+ OC_App::disable('files_trashbin');
+ }
}
function testGenerateKey() {
@@ -686,7 +702,6 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase {
$this->assertEquals( $this->dataLong, $newDecrypt );
// tear down
- $view->unlink( $newFolder . '/' . $newFilename );
$view->unlink( $newFolder );
}