Skip to content

Commit 0f3f112

Browse files
committed
fixup! fixup! Fix some tests
1 parent b8a8de4 commit 0f3f112

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

apps/user_ldap/lib/GroupPluginManager.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,7 @@ public function countUsersInGroup(string $gid, string $search = ''): int {
163163
$plugin = $this->which[GroupInterface::COUNT_USERS];
164164

165165
if ($plugin) {
166-
$count = $plugin->countUsersInGroup($gid,$search);
167-
if ($count === false) {
168-
return 0; // no entry found
169-
}
170-
return $count;
166+
return (int)$plugin->countUsersInGroup($gid, $search);
171167
}
172168
throw new \Exception('No plugin implements countUsersInGroup in this LDAP Backend.');
173169
}

apps/user_ldap/lib/Group_Proxy.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,6 @@ public function getBackendName(): string {
311311
}
312312

313313
public function searchInGroup(string $gid, string $search = '', int $limit = -1, int $offset = 0): array {
314-
$users = [];
315-
316-
foreach ($this->backends as $backend) {
317-
$backendUsers = $backend->searchInGroup($gid, $search, $limit, $offset);
318-
$users = array_merge($users, $backendUsers);
319-
}
320-
321-
return $users;
314+
return $this->handleRequest($gid, 'searchInGroup', [$gid, $search, $limit, $offset]);
322315
}
323316
}

tests/lib/Util/Group/Dummy.php

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
use OCP\Group\Backend\IRemoveFromGroupBackend;
3636
use OCP\Group\Backend\ICreateGroupBackend;
3737
use OCP\Group\Backend\ICountUsersBackend;
38-
use OCP\IUser;
3938

4039
/**
4140
* Dummy group backend, does not keep state, only for testing use

0 commit comments

Comments
 (0)