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:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-12-17 16:55:00 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2018-12-21 19:24:23 +0300
commitfbd4e9e6513426b0809fcc6fc1faec72e6b52d2d (patch)
tree8467489a0f67a0b95da30322079d8966a071f48f /apps/user_ldap/lib
parent58d4b8ee859afa62248bdef5024afd1eb98f68dc (diff)
add tests for the DUI
as they are interact with the DB they are more integraiton than unit tests Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/User/DeletedUsersIndex.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/user_ldap/lib/User/DeletedUsersIndex.php b/apps/user_ldap/lib/User/DeletedUsersIndex.php
index 9ec95a01b58..3473398f415 100644
--- a/apps/user_ldap/lib/User/DeletedUsersIndex.php
+++ b/apps/user_ldap/lib/User/DeletedUsersIndex.php
@@ -70,7 +70,7 @@ class DeletedUsersIndex {
$deletedUsers = $this->config->getUsersForUserValue(
'user_ldap', 'isDeleted', '1');
- $userObjects = array();
+ $userObjects = [];
foreach($deletedUsers as $user) {
$userObjects[] = new OfflineUser($user, $this->config, $this->db, $this->mapping);
}
@@ -95,20 +95,20 @@ class DeletedUsersIndex {
* @return bool
*/
public function hasUsers() {
- if($this->deletedUsers === false) {
+ if(!is_array($this->deletedUsers)) {
$this->fetchDeletedUsers();
}
- if(is_array($this->deletedUsers) && count($this->deletedUsers) > 0) {
- return true;
- }
- return false;
+ return is_array($this->deletedUsers) && (count($this->deletedUsers) > 0);
}
/**
* marks a user as deleted
+ *
* @param string $ocName
+ * @throws \OCP\PreConditionNotMetException
*/
public function markUser($ocName) {
$this->config->setUserValue($ocName, 'user_ldap', 'isDeleted', '1');
+ $this->deletedUsers = null;
}
}