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
path: root/tests
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-09-24 13:21:40 +0300
committerBjoern Schiessle <schiessle@owncloud.com>2015-09-24 13:21:40 +0300
commitd697ea58a42920518d5dbe30d41098cdd3f4b7d7 (patch)
tree5de81d695af9a9692eedf897e3f0a1bda50d5223 /tests
parent330ea18996f4f5bfcbaaebf641d6502757077c4d (diff)
only check if the user exists if a user was added as parameter
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/encryption/decryptalltest.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/lib/encryption/decryptalltest.php b/tests/lib/encryption/decryptalltest.php
index c2a0711c0a0..ce5bcf1e5ae 100644
--- a/tests/lib/encryption/decryptalltest.php
+++ b/tests/lib/encryption/decryptalltest.php
@@ -82,11 +82,13 @@ class DecryptAllTest extends TestCase {
* @dataProvider dataTrueFalse
* @param bool $prepareResult
*/
- public function testDecryptAll($prepareResult) {
+ public function testDecryptAll($prepareResult, $user) {
- $user = 'user1';
-
- $this->userManager->expects($this->once())->method('userExists')->willReturn(true);
+ if (!empty($user)) {
+ $this->userManager->expects($this->once())->method('userExists')->willReturn(true);
+ } else {
+ $this->userManager->expects($this->never())->method('userExists');
+ }
/** @var DecryptAll | \PHPUnit_Framework_MockObject_MockObject | $instance */
$instance = $this->getMockBuilder('OC\Encryption\DecryptAll')
->setConstructorArgs(
@@ -117,8 +119,10 @@ class DecryptAllTest extends TestCase {
public function dataTrueFalse() {
return [
- [true],
- [false]
+ [true, 'user1'],
+ [false, 'user1'],
+ [true, ''],
+ [true, null]
];
}