summaryrefslogtreecommitdiffstats
path: root/tests/Core/Command/Encryption
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-02-22 23:02:31 -0600
committerMorris Jobke <hey@morrisjobke.de>2017-02-22 23:02:31 -0600
commit9533f4e5edfded577b67d08f7778a8a1704132f2 (patch)
treedc3e1741b8e69b0f8be6abf3cf678f499e68bff7 /tests/Core/Command/Encryption
parent54317e80c0837cb5efe43086685fc09d6796e1ef (diff)
downloadnextcloud-server-9533f4e5edfded577b67d08f7778a8a1704132f2.tar.gz
nextcloud-server-9533f4e5edfded577b67d08f7778a8a1704132f2.zip
Clean up single user mode
Single user mode basically disables WebDAV, OCS and cron execution. Since we heavily rely on WebDAV and OCS also in the web UI it's basically useless. An admin only sees a broken interface and can't even change any settings nor sees any files. Also sharing is not possible. As this is at least the case since Nextcloud 9 and we haven't received any reports for this it seems that this feature is not used at all so I removed it. The encryption commands now rely on the well tested maintenance mode. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'tests/Core/Command/Encryption')
-rw-r--r--tests/Core/Command/Encryption/DecryptAllTest.php14
-rw-r--r--tests/Core/Command/Encryption/EncryptAllTest.php10
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/Core/Command/Encryption/DecryptAllTest.php b/tests/Core/Command/Encryption/DecryptAllTest.php
index 8f674aa5b44..1b01231ac57 100644
--- a/tests/Core/Command/Encryption/DecryptAllTest.php
+++ b/tests/Core/Command/Encryption/DecryptAllTest.php
@@ -77,7 +77,7 @@ class DecryptAllTest extends TestCase {
$this->config->expects($this->any())
->method('getSystemValue')
- ->with('singleuser', false)
+ ->with('maintenance', false)
->willReturn(false);
$this->appManager->expects($this->any())
->method('isEnabledForUser')
@@ -85,12 +85,12 @@ class DecryptAllTest extends TestCase {
}
- public function testSingleUserAndTrashbin() {
+ public function testMaintenanceAndTrashbin() {
// on construct we enable single-user-mode and disable the trash bin
$this->config->expects($this->at(1))
->method('setSystemValue')
- ->with('singleuser', true);
+ ->with('maintenance', true);
$this->appManager->expects($this->once())
->method('disableApp')
->with('files_trashbin');
@@ -98,7 +98,7 @@ class DecryptAllTest extends TestCase {
// on destruct wi disable single-user-mode again and enable the trash bin
$this->config->expects($this->at(2))
->method('setSystemValue')
- ->with('singleuser', false);
+ ->with('maintenance', false);
$this->appManager->expects($this->once())
->method('enableApp')
->with('files_trashbin');
@@ -110,16 +110,16 @@ class DecryptAllTest extends TestCase {
$this->decryptAll,
$this->questionHelper
);
- $this->invokePrivate($instance, 'forceSingleUserAndTrashbin');
+ $this->invokePrivate($instance, 'forceMaintenanceAndTrashbin');
$this->assertTrue(
$this->invokePrivate($instance, 'wasTrashbinEnabled')
);
$this->assertFalse(
- $this->invokePrivate($instance, 'wasSingleUserModeEnabled')
+ $this->invokePrivate($instance, 'wasMaintenanceModeEnabled')
);
- $this->invokePrivate($instance, 'resetSingleUserAndTrashbin');
+ $this->invokePrivate($instance, 'resetMaintenanceAndTrashbin');
}
/**
diff --git a/tests/Core/Command/Encryption/EncryptAllTest.php b/tests/Core/Command/Encryption/EncryptAllTest.php
index 00895541782..554560a35b7 100644
--- a/tests/Core/Command/Encryption/EncryptAllTest.php
+++ b/tests/Core/Command/Encryption/EncryptAllTest.php
@@ -88,13 +88,13 @@ class EncryptAllTest extends TestCase {
$this->appManager->expects($this->once())->method('disableApp')->with('files_trashbin');
// enable single user mode to avoid that other user login during encryption
// destructor should disable the single user mode again
- $this->config->expects($this->once())->method('getSystemValue')->with('singleuser', false)->willReturn(false);
- $this->config->expects($this->at(1))->method('setSystemValue')->with('singleuser', true);
- $this->config->expects($this->at(2))->method('setSystemValue')->with('singleuser', false);
+ $this->config->expects($this->once())->method('getSystemValue')->with('maintenance', false)->willReturn(false);
+ $this->config->expects($this->at(1))->method('setSystemValue')->with('maintenance', true);
+ $this->config->expects($this->at(2))->method('setSystemValue')->with('maintenance', false);
$instance = new EncryptAll($this->encryptionManager, $this->appManager, $this->config, $this->questionHelper);
- $this->invokePrivate($instance, 'forceSingleUserAndTrashbin');
- $this->invokePrivate($instance, 'resetSingleUserAndTrashbin');
+ $this->invokePrivate($instance, 'forceMaintenanceAndTrashbin');
+ $this->invokePrivate($instance, 'resetMaintenanceAndTrashbin');
}
/**