Merge pull request #6805 from nextcloud/can-not-change-encryption-directory

Can not change encryption directory
This commit is contained in:
Björn Schießle 2018-03-02 16:10:49 +01:00 committed by GitHub
commit 1953a11dfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -143,11 +143,11 @@ class ChangeKeyStorageRoot extends Command {
$result = $this->rootView->file_put_contents(
$newRoot . '/' . Storage::KEY_STORAGE_MARKER,
'ownCloud will detect this folder as key storage root only if this file exists'
'Nextcloud will detect this folder as key storage root only if this file exists'
);
if ($result === false) {
throw new \Exception("Can't write to new root folder. Please check the permissions and try again");
if (!$result) {
throw new \Exception("Can't access the new root folder. Please check the permissions and make sure that the folder is in your data folder");
}
}

View File

@ -175,7 +175,7 @@ class ChangeKeyStorageRootTest extends TestCase {
$this->view->expects($this->once())->method('file_put_contents')
->with('newRoot/' . \OC\Encryption\Keys\Storage::KEY_STORAGE_MARKER,
'ownCloud will detect this folder as key storage root only if this file exists');
'Nextcloud will detect this folder as key storage root only if this file exists')->willReturn(true);
$this->invokePrivate($this->changeKeyStorageRoot, 'prepareNewRoot', ['newRoot']);
}
@ -198,6 +198,7 @@ class ChangeKeyStorageRootTest extends TestCase {
public function dataTestPrepareNewRootException() {
return [
[true, false],
[true, null],
[false, true]
];
}