aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Encryption
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-06-09 15:01:57 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-06-09 15:01:57 +0200
commitfc3ad7d5f7acb018329b22d5120c03cd07feecd6 (patch)
treeefa1958da450eb72ae93bb54dd3fe23a21aba682 /tests/lib/Encryption
parentb928305bb30ade5635a203408090f4ae376278ba (diff)
parentbb67acff9137a96f8ed002da6c8edf7aae8a7ec8 (diff)
downloadnextcloud-server-fc3ad7d5f7acb018329b22d5120c03cd07feecd6.tar.gz
nextcloud-server-fc3ad7d5f7acb018329b22d5120c03cd07feecd6.zip
Merge pull request #25 from nextcloud/downstream-160608
Downstream 2016-06-08
Diffstat (limited to 'tests/lib/Encryption')
-rw-r--r--tests/lib/Encryption/DecryptAllTest.php35
1 files changed, 23 insertions, 12 deletions
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php
index ffcbbc74a99..d7cf2fb7baf 100644
--- a/tests/lib/Encryption/DecryptAllTest.php
+++ b/tests/lib/Encryption/DecryptAllTest.php
@@ -86,13 +86,25 @@ class DecryptAllTest extends TestCase {
$this->invokePrivate($this->instance, 'output', [$this->outputInterface]);
}
+ public function dataDecryptAll() {
+ return [
+ [true, 'user1', true],
+ [false, 'user1', true],
+ [true, '0', true],
+ [false, '0', true],
+ [true, '', false],
+ ];
+ }
+
/**
- * @dataProvider dataTrueFalse
+ * @dataProvider dataDecryptAll
* @param bool $prepareResult
+ * @param string $user
+ * @param bool $userExistsChecked
*/
- public function testDecryptAll($prepareResult, $user) {
+ public function testDecryptAll($prepareResult, $user, $userExistsChecked) {
- if (!empty($user)) {
+ if ($userExistsChecked) {
$this->userManager->expects($this->once())->method('userExists')->willReturn(true);
} else {
$this->userManager->expects($this->never())->method('userExists');
@@ -125,15 +137,6 @@ class DecryptAllTest extends TestCase {
$instance->decryptAll($this->inputInterface, $this->outputInterface, $user);
}
- public function dataTrueFalse() {
- return [
- [true, 'user1'],
- [false, 'user1'],
- [true, ''],
- [true, null]
- ];
- }
-
/**
* test decrypt all call with a user who doesn't exists
*/
@@ -147,8 +150,16 @@ class DecryptAllTest extends TestCase {
);
}
+ public function dataTrueFalse() {
+ return [
+ [true],
+ [false],
+ ];
+ }
+
/**
* @dataProvider dataTrueFalse
+ * @param bool $success
*/
public function testPrepareEncryptionModules($success) {