summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests/User_LDAPTest.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-16 13:27:45 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-01-16 18:39:11 +0100
commit55532f19d90b40f7f46354b92a5322676729ba7e (patch)
treec29ee88dbb789c7c0aa9c9f1c08fccef27272d7f /apps/user_ldap/tests/User_LDAPTest.php
parenta159d7c28c483a2b77e2f533795f6d6d1ec720fd (diff)
downloadnextcloud-server-55532f19d90b40f7f46354b92a5322676729ba7e.tar.gz
nextcloud-server-55532f19d90b40f7f46354b92a5322676729ba7e.zip
Cleanup OC_User and OCP\User
* mainly removes deprecated methods and old static code Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/user_ldap/tests/User_LDAPTest.php')
-rw-r--r--apps/user_ldap/tests/User_LDAPTest.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index 3262a2360ad..9911aa37e37 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -275,7 +275,11 @@ 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::checkPassword('roland', 'dt19');
+ $user = \OC::$server->getUserManager()->checkPassword('roland', 'dt19');
+ $result = false;
+ if ($user !== false) {
+ $result = $user->getUID();
+ }
$this->assertEquals('gunslinger', $result);
}
@@ -285,7 +289,11 @@ 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::checkPassword('roland', 'wrong');
+ $user = \OC::$server->getUserManager()->checkPassword('roland', 'wrong');
+ $result = false;
+ if ($user !== false) {
+ $result = $user->getUID();
+ }
$this->assertFalse($result);
}
@@ -295,7 +303,11 @@ 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::checkPassword('mallory', 'evil');
+ $user = \OC::$server->getUserManager()->checkPassword('mallory', 'evil');
+ $result = false;
+ if ($user !== false) {
+ $result = $user->getUID();
+ }
$this->assertFalse($result);
}
@@ -629,7 +641,7 @@ class User_LDAPTest extends TestCase {
->willReturn($this->createMock(UserMapping::class));
//test for existing user
- $result = \OCP\User::userExists('gunslinger');
+ $result = \OC::$server->getUserManager()->userExists('gunslinger');
$this->assertTrue($result);
}
@@ -656,7 +668,7 @@ class User_LDAPTest extends TestCase {
->willReturn($this->createMock(User::class));
//test for deleted user
- \OCP\User::userExists('formerUser');
+ \OC::$server->getUserManager()->userExists('formerUser');
}
public function testUserExistsPublicAPIForNeverExisting() {
@@ -675,7 +687,7 @@ class User_LDAPTest extends TestCase {
}));
//test for never-existing user
- $result = \OCP\User::userExists('mallory');
+ $result = \OC::$server->getUserManager()->userExists('mallory');
$this->assertFalse($result);
}