diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-12-17 14:55:00 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2018-12-21 17:24:23 +0100 |
commit | fbd4e9e6513426b0809fcc6fc1faec72e6b52d2d (patch) | |
tree | 8467489a0f67a0b95da30322079d8966a071f48f /apps/user_ldap/lib | |
parent | 58d4b8ee859afa62248bdef5024afd1eb98f68dc (diff) | |
download | nextcloud-server-fbd4e9e6513426b0809fcc6fc1faec72e6b52d2d.tar.gz nextcloud-server-fbd4e9e6513426b0809fcc6fc1faec72e6b52d2d.zip |
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.php | 12 |
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; } } |