summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-03-25 20:33:24 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-03-25 20:33:24 +0200
commit6c8caa1641732c57fe59483fc2cdd5bcd7bd0163 (patch)
tree57c69a5be00c4ae2c43bf2ce4094c3f700e1f285 /apps/user_ldap
parent89ebb8a6631eaa273d34864224986e4efb2c365d (diff)
downloadnextcloud-server-6c8caa1641732c57fe59483fc2cdd5bcd7bd0163.tar.gz
nextcloud-server-6c8caa1641732c57fe59483fc2cdd5bcd7bd0163.zip
Remove deprecated \OCP\User::getUsers
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/tests/User_LDAPTest.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index 9911aa37e37..270e3eedbfd 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -489,13 +489,22 @@ class User_LDAPTest extends TestCase {
$this->assertEquals(0, count($result));
}
+ private function getUsers($search = '', $limit = null, $offset = null) {
+ $users = \OC::$server->getUserManager()->search($search, $limit, $offset);
+ $uids = [];
+ foreach ($users as $user) {
+ $uids[] = $user->getUID();
+ }
+ return $uids;
+ }
+
public function testGetUsersViaAPINoParam() {
$access = $this->getAccessMock();
$this->prepareAccessForGetUsers($access);
$backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock());
\OC_User::useBackend($backend);
- $result = \OCP\User::getUsers();
+ $result = $this->getUsers();
$this->assertEquals(3, count($result));
}
@@ -505,7 +514,7 @@ class User_LDAPTest extends TestCase {
$backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock());
\OC_User::useBackend($backend);
- $result = \OCP\User::getUsers('', 1, 2);
+ $result = $this->getUsers('', 1, 2);
$this->assertEquals(1, count($result));
}
@@ -515,7 +524,7 @@ class User_LDAPTest extends TestCase {
$backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock());
\OC_User::useBackend($backend);
- $result = \OCP\User::getUsers('', 2, 1);
+ $result = $this->getUsers('', 2, 1);
$this->assertEquals(2, count($result));
}
@@ -525,7 +534,7 @@ class User_LDAPTest extends TestCase {
$backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock());
\OC_User::useBackend($backend);
- $result = \OCP\User::getUsers('yo');
+ $result = $this->getUsers('yo');
$this->assertEquals(2, count($result));
}
@@ -535,7 +544,7 @@ class User_LDAPTest extends TestCase {
$backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock());
\OC_User::useBackend($backend);
- $result = \OCP\User::getUsers('nix');
+ $result = $this->getUsers('nix');
$this->assertEquals(0, count($result));
}