summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/tests/proxy.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-06-21 17:37:53 +0200
committerRobin Appelman <icewind@owncloud.com>2012-06-21 17:38:00 +0200
commitd0455c5819099751fb8614a76c272a23c6494b65 (patch)
treec6068672ac891b51e1ae690515a897995ac9039d /apps/files_encryption/tests/proxy.php
parent1338279ca02af2444a7277a041bec18aab615774 (diff)
downloadnextcloud-server-d0455c5819099751fb8614a76c272a23c6494b65.tar.gz
nextcloud-server-d0455c5819099751fb8614a76c272a23c6494b65.zip
truncate decrypted files based on filelength
Diffstat (limited to 'apps/files_encryption/tests/proxy.php')
-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 5616e2091a9..4533289265a 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -50,6 +50,7 @@ class Test_CryptProxy extends UnitTestCase {
$fromFile=OC_Filesystem::file_get_contents('/file');
$this->assertNotEqual($original,$stored);
+ $this->assertEqual(strlen($original),strlen($fromFile));
$this->assertEqual($original,$fromFile);
}
@@ -88,6 +89,20 @@ class Test_CryptProxy extends UnitTestCase {
$fromFile=OC_Filesystem::file_get_contents('/file');
$this->assertNotEqual($original,$stored);
+ $this->assertEqual(strlen($original),strlen($fromFile));
$this->assertEqual($original,$fromFile);
+
+ $file=__DIR__.'/zeros';
+ $original=file_get_contents($file);
+
+ OC_Filesystem::file_put_contents('/file',$original);
+
+ OC_FileProxy::$enabled=false;
+ $stored=OC_Filesystem::file_get_contents('/file');
+ OC_FileProxy::$enabled=true;
+
+ $fromFile=OC_Filesystem::file_get_contents('/file');
+ $this->assertNotEqual($original,$stored);
+ $this->assertEqual(strlen($original),strlen($fromFile));
}
}