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>2013-12-11 18:38:19 +0400
committerBjoern Schiessle <schiessle@owncloud.com>2013-12-16 20:48:52 +0400
commitbdb4890d04a57f65e6ec962516b875ec4513712a (patch)
tree2e1d08e9a37221769389bd8e6639f67e4c9ef684 /apps/files_encryption/tests
parent9091dd78334a81f45d95ad264a76d7da20aaa73a (diff)
call set password hook because it doesn't get triggered during test execution and fix paths
Diffstat (limited to 'apps/files_encryption/tests')
-rwxr-xr-xapps/files_encryption/tests/share.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/files_encryption/tests/share.php b/apps/files_encryption/tests/share.php
index 1d852d3c8cc..e55427620a6 100755
--- a/apps/files_encryption/tests/share.php
+++ b/apps/files_encryption/tests/share.php
@@ -756,7 +756,9 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// login as admin
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER1);
- \OCA\Encryption\Helper::adminEnableRecovery(null, 'test123');
+ $result = \OCA\Encryption\Helper::adminEnableRecovery(null, 'test123');
+ $this->assertTrue($result);
+
$recoveryKeyId = OC_Appconfig::getValue('files_encryption', 'recoveryKeyId');
// login as user2
@@ -767,6 +769,9 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// enable recovery for admin
$this->assertTrue($util->setRecoveryForUser(1));
+ // add recovery keys for existing files (e.g. the auto-generated welcome.txt)
+ $util->addRecoveryKeys();
+
// create folder structure
$this->view->mkdir('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1);
$this->view->mkdir(
@@ -805,6 +810,10 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
// change password
\OC_User::setPassword(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, 'test', 'test123');
+ $params = array('uid' => \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2,
+ 'password' => 'test',
+ 'recoveryPassword' => 'test123');
+ \OCA\Encryption\Hooks::setPassphrase($params);
// login as user2
\Test_Encryption_Util::loginHelper(\Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2, false, 'test');
@@ -819,8 +828,8 @@ class Test_Encryption_Share extends \PHPUnit_Framework_TestCase {
$this->assertEquals($this->dataShort, $retrievedCryptedFile2);
// cleanup
- $this->view->unlink('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->folder1);
- $this->view->unlink('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files' . $this->filename);
+ $this->view->unlink('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->folder1);
+ $this->view->unlink('/' . \Test_Encryption_Share::TEST_ENCRYPTION_SHARE_USER2 . '/files/' . $this->filename);
// check if share key for user and recovery exists
$this->assertFalse($this->view->file_exists(