aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-06-09 17:33:57 +0200
committerRobin Appelman <icewind@owncloud.com>2012-06-09 17:34:13 +0200
commit601bac746d62540425f7a9e13ffbbc61e12eaca2 (patch)
tree2a45f95ede3649d4f30a08e53656f077e784441a /apps/files_encryption/tests
parente7f6f7e452131320a73861ad975c3d7961074190 (diff)
downloadnextcloud-server-601bac746d62540425f7a9e13ffbbc61e12eaca2.tar.gz
nextcloud-server-601bac746d62540425f7a9e13ffbbc61e12eaca2.zip
use absolute path for file proxies
Diffstat (limited to 'apps/files_encryption/tests')
-rw-r--r--apps/files_encryption/tests/proxy.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
index 0450de82acb..f36b2193430 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -30,6 +30,9 @@ class Test_CryptProxy extends UnitTestCase {
}
public function testSimple(){
+ $oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true');
+ OCP\Config::setAppValue('files_encryption','enable_encryption','true');
+
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$original=file_get_contents($file);
@@ -42,5 +45,17 @@ class Test_CryptProxy extends UnitTestCase {
$fromFile=OC_Filesystem::file_get_contents('/file');
$this->assertNotEqual($original,$stored);
$this->assertEqual($original,$fromFile);
+
+ $rootView=new OC_FilesystemView('');
+ $view=new OC_FilesystemView('/'.OC_User::getUser());
+ $userDir='/'.OC_User::getUser().'/files';
+
+ $fromFile=$rootView->file_get_contents($userDir.'/file');
+ $this->assertEqual($original,$fromFile);
+
+ $fromFile=$view->file_get_contents('files/file');
+ $this->assertEqual($original,$fromFile);
+
+ OCP\Config::setAppValue('files_encryption','enable_encryption',$oldConfig);
}
}