public function testGetDNandUsername() { list($access, $config, $filesys, $image, $log, $avaMgr, $db, $userMgr) = $this->getTestInstances(); $uid = 'alice'; $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User($uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $this->assertSame($dn, $user->getDN()); $this->assertSame($uid, $user->getUsername()); }
/** * check if a user exists on LDAP * @param string|\OCA\User_LDAP\lib\User\User $user either the ownCloud user * name or an instance of that user * @return boolean */ public function userExistsOnLDAP($user) { $id = $user instanceof User ? $user->getUsername() : $user; return $this->handleRequest($id, 'userExistsOnLDAP', array($user)); }