Skip to content

Commit

Permalink
fixup! fixup! Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlSchwan committed May 5, 2022
1 parent b8a8de4 commit 0f3f112
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
6 changes: 1 addition & 5 deletions apps/user_ldap/lib/GroupPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@ public function countUsersInGroup(string $gid, string $search = ''): int {
$plugin = $this->which[GroupInterface::COUNT_USERS];

if ($plugin) {
$count = $plugin->countUsersInGroup($gid,$search);
if ($count === false) {
return 0; // no entry found
}
return $count;
return (int)$plugin->countUsersInGroup($gid, $search);
}
throw new \Exception('No plugin implements countUsersInGroup in this LDAP Backend.');
}
Expand Down
9 changes: 1 addition & 8 deletions apps/user_ldap/lib/Group_Proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,6 @@ public function getBackendName(): string {
}

public function searchInGroup(string $gid, string $search = '', int $limit = -1, int $offset = 0): array {
$users = [];

foreach ($this->backends as $backend) {
$backendUsers = $backend->searchInGroup($gid, $search, $limit, $offset);
$users = array_merge($users, $backendUsers);
}

return $users;
return $this->handleRequest($gid, 'searchInGroup', [$gid, $search, $limit, $offset]);
}
}
1 change: 0 additions & 1 deletion tests/lib/Util/Group/Dummy.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
use OCP\Group\Backend\IRemoveFromGroupBackend;
use OCP\Group\Backend\ICreateGroupBackend;
use OCP\Group\Backend\ICountUsersBackend;
use OCP\IUser;

/**
* Dummy group backend, does not keep state, only for testing use
Expand Down

0 comments on commit 0f3f112

Please sign in to comment.