diff options
author | Florin Peter <github@florin-peter.de> | 2013-05-20 23:44:10 +0200 |
---|---|---|
committer | Florin Peter <github@florin-peter.de> | 2013-05-20 23:44:10 +0200 |
commit | f2b1158addeb53e2c1155228c4372209786a2133 (patch) | |
tree | 5327f3870660c127b5556447e5b9f08320b04262 /apps/files_encryption/tests/crypt.php | |
parent | 1c8e5d6873b1190d73b4139ca9fd7e710ae5d1a3 (diff) | |
download | nextcloud-server-f2b1158addeb53e2c1155228c4372209786a2133.tar.gz nextcloud-server-f2b1158addeb53e2c1155228c4372209786a2133.zip |
improved tests
Diffstat (limited to 'apps/files_encryption/tests/crypt.php')
-rwxr-xr-x | apps/files_encryption/tests/crypt.php | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php index 6a1f1aef659..049f3fb5d98 100755 --- a/apps/files_encryption/tests/crypt.php +++ b/apps/files_encryption/tests/crypt.php @@ -706,41 +706,9 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase $this->assertEquals($this->dataLong, $decrypt); - $newFolder = '/newfolder' . time(); - - $view->rename($folder, $newFolder); - - // Get file decrypted contents - $newDecrypt = file_get_contents('crypt://' . $newFolder . $filename); - - $this->assertEquals($this->dataLong, $newDecrypt); - - // tear down - $view->unlink($newFolder); - } - - function testRenameFolder() - { - - $filename = '/tmp-' . time(); + $newFolder = '/newfolder/subfolder' . time(); + $view->mkdir('/newfolder'); - $folder = '/folder'; - $newFolder = '/newfolder'; - $view = new \OC\Files\View('/' . $this->userId . '/files'); - $view->mkdir($folder); - - // Save long data as encrypted file using stream wrapper - $cryptedFile = file_put_contents('crypt://' . $folder . $filename, $this->dataLong); - - // Test that data was successfully written - $this->assertTrue(is_int($cryptedFile)); - - // Get file decrypted contents - $decrypt = file_get_contents('crypt://' . $folder . $filename); - - $this->assertEquals($this->dataLong, $decrypt); - - // rename folder $view->rename($folder, $newFolder); // Get file decrypted contents @@ -754,8 +722,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase function testChangePassphrase() { - - $filename = 'tmp-' . time(); + $filename = 'tmp-' . time(); // Save long data as encrypted file using stream wrapper $cryptedFile = file_put_contents('crypt://' . $filename, $this->dataLong); |