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:
authorJoas Schilling <nickvergessen@owncloud.com>2015-09-18 09:53:02 +0300
committerJoas Schilling <nickvergessen@owncloud.com>2015-09-18 09:55:59 +0300
commit2f102c1f0d2fc93d1d9091297b0cb920fc8947de (patch)
treeca9e50faa00a67bf581b354731f64d59a0ec9b89 /tests/core
parent2eeb1b2b793bae0259874af80e6a5bb99dc224d7 (diff)
Do not set single user in constructor
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/command/encryption/decryptalltest.php7
-rw-r--r--tests/core/command/encryption/encryptalltest.php4
2 files changed, 8 insertions, 3 deletions
diff --git a/tests/core/command/encryption/decryptalltest.php b/tests/core/command/encryption/decryptalltest.php
index ef36d6d2827..972ea03150c 100644
--- a/tests/core/command/encryption/decryptalltest.php
+++ b/tests/core/command/encryption/decryptalltest.php
@@ -79,7 +79,8 @@ class DecryptAllTest extends TestCase {
}
- public function testConstructDesctruct() {
+ public function testSingleUserAndTrashbin() {
+
// on construct we enable single-user-mode and disable the trash bin
$this->config->expects($this->at(1))
->method('setSystemValue')
@@ -103,6 +104,7 @@ class DecryptAllTest extends TestCase {
$this->decryptAll,
$this->questionHelper
);
+ $this->invokePrivate($instance, 'forceSingleUserAndTrashbin');
$this->assertTrue(
$this->invokePrivate($instance, 'wasTrashbinEnabled')
@@ -111,6 +113,7 @@ class DecryptAllTest extends TestCase {
$this->assertFalse(
$this->invokePrivate($instance, 'wasSingleUserModeEnabled')
);
+ $this->invokePrivate($instance, 'resetSingleUserAndTrashbin');
}
/**
@@ -187,7 +190,7 @@ class DecryptAllTest extends TestCase {
->with('core', 'encryption_enabled', 'no');
// make sure that we enable encryption again after a exception was thrown
- $this->config->expects($this->at(1))
+ $this->config->expects($this->at(3))
->method('setAppValue')
->with('core', 'encryption_enabled', 'yes');
diff --git a/tests/core/command/encryption/encryptalltest.php b/tests/core/command/encryption/encryptalltest.php
index 9f7f7375044..128b4caa148 100644
--- a/tests/core/command/encryption/encryptalltest.php
+++ b/tests/core/command/encryption/encryptalltest.php
@@ -85,7 +85,9 @@ class EncryptAllTest extends TestCase {
$this->config->expects($this->at(1))->method('setSystemValue')->with('singleuser', true);
$this->config->expects($this->at(2))->method('setSystemValue')->with('singleuser', false);
- new EncryptAll($this->encryptionManager, $this->appManager, $this->config, $this->questionHelper);
+ $instance = new EncryptAll($this->encryptionManager, $this->appManager, $this->config, $this->questionHelper);
+ $this->invokePrivate($instance, 'forceSingleUserAndTrashbin');
+ $this->invokePrivate($instance, 'resetSingleUserAndTrashbin');
}
/**