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:
authorBjoern Schiessle <schiessle@owncloud.com>2014-04-09 19:52:24 +0400
committerBjoern Schiessle <schiessle@owncloud.com>2014-04-23 14:54:25 +0400
commita86d97295e4e0e1560bcd4cce4bde21aa60a2486 (patch)
treec1a73dd7a985e8e09beeaa10cbf7631ff866b1d6 /apps/files_encryption/tests/hooks.php
parent4c840cb61d560ae567e3e9aaa7bd411cac917e48 (diff)
fix encryption tests after the removal of the shared folder
Diffstat (limited to 'apps/files_encryption/tests/hooks.php')
-rw-r--r--apps/files_encryption/tests/hooks.php26
1 files changed, 7 insertions, 19 deletions
diff --git a/apps/files_encryption/tests/hooks.php b/apps/files_encryption/tests/hooks.php
index d0e4b5f732e..047084ca2c1 100644
--- a/apps/files_encryption/tests/hooks.php
+++ b/apps/files_encryption/tests/hooks.php
@@ -219,18 +219,20 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
\Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2);
\OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2);
- // user2 has a local file with the same name
+ // user2 update the shared file
$this->user2View->file_put_contents($this->filename, $this->data);
- // check if all keys are generated
- $this->assertTrue($this->rootView->file_exists(
+ // keys should be stored at user1s dir, not in user2s
+ $this->assertFalse($this->rootView->file_exists(
self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/share-keys/'
. $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
- $this->assertTrue($this->rootView->file_exists(
+ $this->assertFalse($this->rootView->file_exists(
self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
// delete the Shared file from user1 in data/user2/files/Shared
- $this->user2View->unlink('/Shared/' . $this->filename);
+ $result = $this->user2View->unlink($this->filename);
+
+ $this->assertTrue($result);
// now keys from user1s home should be gone
$this->assertFalse($this->rootView->file_exists(
@@ -242,26 +244,12 @@ class Test_Encryption_Hooks extends \PHPUnit_Framework_TestCase {
$this->assertFalse($this->rootView->file_exists(
self::TEST_ENCRYPTION_HOOKS_USER1 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
- // but user2 keys should still exist
- $this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/share-keys/'
- . $this->filename . '.' . \Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER2 . '.shareKey'));
- $this->assertTrue($this->rootView->file_exists(
- self::TEST_ENCRYPTION_HOOKS_USER2 . '/files_encryption/keyfiles/' . $this->filename . '.key'));
-
// cleanup
- $this->user2View->unlink($this->filename);
-
\Test_Encryption_Util::logoutHelper();
\Test_Encryption_Util::loginHelper(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
\OC_User::setUserId(\Test_Encryption_Hooks::TEST_ENCRYPTION_HOOKS_USER1);
- // unshare the file
- \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_ENCRYPTION_HOOKS_USER2);
-
- $this->user1View->unlink($this->filename);
-
if ($stateFilesTrashbin) {
OC_App::enable('files_trashbin');
}