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-16 02:44:40 +0400
committerFlorin Peter <github@florin-peter.de>2013-05-16 02:44:40 +0400
commit67a80e1870a47c0f060c58f65b3a6fc838c52b70 (patch)
treed81f7b3cc5772ab7104c909a194ffc36eefdaf0c /apps/files_encryption/tests/crypt.php
parent0fca2f8f319d77b056516216ade0a931d21a2a69 (diff)
improved tests for touch
Diffstat (limited to 'apps/files_encryption/tests/crypt.php')
-rwxr-xr-xapps/files_encryption/tests/crypt.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/apps/files_encryption/tests/crypt.php b/apps/files_encryption/tests/crypt.php
index 3916b0e15e0..1caa9ea7da7 100755
--- a/apps/files_encryption/tests/crypt.php
+++ b/apps/files_encryption/tests/crypt.php
@@ -788,7 +788,7 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase {
$view->unlink( $filename );
}
- function testTouchFile() {
+ function testTouchExistingFile() {
$filename = '/tmp-'.time();
$view = new \OC\Files\View('/' . $this->userId . '/files');
@@ -809,6 +809,27 @@ class Test_Crypt extends \PHPUnit_Framework_TestCase {
$view->unlink( $filename );
}
+ function testTouchFile() {
+ $filename = '/tmp-'.time();
+ $view = new \OC\Files\View('/' . $this->userId . '/files');
+
+ $view->touch($filename);
+
+ // Save short data as encrypted file using stream wrapper
+ $cryptedFile = $view->file_put_contents( $filename, $this->dataShort );
+
+ // Test that data was successfully written
+ $this->assertTrue( is_int( $cryptedFile ) );
+
+ // Get file decrypted contents
+ $decrypt = $view->file_get_contents( $filename );
+
+ $this->assertEquals( $this->dataShort, $decrypt );
+
+ // tear down
+ $view->unlink( $filename );
+ }
+
function testFopenFile() {
$filename = '/tmp-'.time();
$view = new \OC\Files\View('/' . $this->userId . '/files');