From 48d63a6278078d164774fd182f03ebba5e3c77ad Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 7 Mar 2014 11:25:29 +0100 Subject: Return unencrypted_size of folder when queried This fixes the "used space" to be based on the unencrypted size, not encrypted size, to be consistent with how quota/space is handled when encryption is enabled --- apps/files_encryption/tests/proxy.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'apps/files_encryption/tests') diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php index 51cc0b795e3..647ee955eb1 100644 --- a/apps/files_encryption/tests/proxy.php +++ b/apps/files_encryption/tests/proxy.php @@ -112,4 +112,24 @@ class Test_Encryption_Proxy extends \PHPUnit_Framework_TestCase { } + function testPostFileSizeWithDirectory() { + + $this->view->file_put_contents($this->filename, $this->data); + + \OC_FileProxy::$enabled = false; + + // get root size, must match the file's unencrypted size + $unencryptedSize = $this->view->filesize(''); + + \OC_FileProxy::$enabled = true; + + $encryptedSize = $this->view->filesize(''); + + $this->assertTrue($encryptedSize !== $unencryptedSize); + + // cleanup + $this->view->unlink($this->filename); + + } + } -- cgit v1.2.3