diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-19 15:48:38 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-20 15:21:33 +0100 |
commit | 77069f5582ad42207ee9a9620cba5720390d9e79 (patch) | |
tree | bf1ac115fd972c6d061a2f50df903491c02f97e8 /apps/user_ldap/tests/user/manager.php | |
parent | 51b50bd26049eed0d4335ae5f5282f53df0189a1 (diff) | |
download | nextcloud-server-77069f5582ad42207ee9a9620cba5720390d9e79.tar.gz nextcloud-server-77069f5582ad42207ee9a9620cba5720390d9e79.zip |
Use IUser::setEMailAddress in ldap as well
Diffstat (limited to 'apps/user_ldap/tests/user/manager.php')
-rw-r--r-- | apps/user_ldap/tests/user/manager.php | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/apps/user_ldap/tests/user/manager.php b/apps/user_ldap/tests/user/manager.php index 2ad438fcba4..c4af1009df8 100644 --- a/apps/user_ldap/tests/user/manager.php +++ b/apps/user_ldap/tests/user/manager.php @@ -44,6 +44,7 @@ class Test_User_Manager extends \Test\TestCase { $avaMgr = $this->getMock('\OCP\IAvatarManager'); $image = $this->getMock('\OCP\Image'); $dbc = $this->getMock('\OCP\IDBConnection'); + $userMgr = $this->getMock('\OCP\IUserManager'); $connection = new \OCA\user_ldap\lib\Connection( $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'), @@ -55,11 +56,11 @@ class Test_User_Manager extends \Test\TestCase { ->method('getConnection') ->will($this->returnValue($connection)); - return array($access, $config, $filesys, $image, $log, $avaMgr, $dbc); + return array($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr); } public function testGetByDNExisting() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); $inputDN = 'cn=foo,dc=foobar,dc=bar'; @@ -78,7 +79,7 @@ class Test_User_Manager extends \Test\TestCase { $access->expects($this->never()) ->method('username2dn'); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); $manager->setLdapAccess($access); $user = $manager->get($inputDN); @@ -90,7 +91,7 @@ class Test_User_Manager extends \Test\TestCase { } public function testGetByEDirectoryDN() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); $inputDN = 'uid=foo,o=foobar,c=bar'; @@ -109,7 +110,7 @@ class Test_User_Manager extends \Test\TestCase { $access->expects($this->never()) ->method('username2dn'); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); $manager->setLdapAccess($access); $user = $manager->get($inputDN); @@ -117,7 +118,7 @@ class Test_User_Manager extends \Test\TestCase { } public function testGetByExoticDN() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); $inputDN = 'ab=cde,f=ghei,mno=pq'; @@ -136,7 +137,7 @@ class Test_User_Manager extends \Test\TestCase { $access->expects($this->never()) ->method('username2dn'); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); $manager->setLdapAccess($access); $user = $manager->get($inputDN); @@ -144,7 +145,7 @@ class Test_User_Manager extends \Test\TestCase { } public function testGetByDNNotExisting() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); $inputDN = 'cn=gone,dc=foobar,dc=bar'; @@ -164,7 +165,7 @@ class Test_User_Manager extends \Test\TestCase { ->with($this->equalTo($inputDN)) ->will($this->returnValue(false)); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); $manager->setLdapAccess($access); $user = $manager->get($inputDN); @@ -172,7 +173,7 @@ class Test_User_Manager extends \Test\TestCase { } public function testGetByUidExisting() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); $dn = 'cn=foo,dc=foobar,dc=bar'; @@ -191,7 +192,7 @@ class Test_User_Manager extends \Test\TestCase { ->with($this->equalTo($uid)) ->will($this->returnValue(false)); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); $manager->setLdapAccess($access); $user = $manager->get($uid); @@ -203,7 +204,7 @@ class Test_User_Manager extends \Test\TestCase { } public function testGetByUidNotExisting() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); $dn = 'cn=foo,dc=foobar,dc=bar'; @@ -217,7 +218,7 @@ class Test_User_Manager extends \Test\TestCase { ->with($this->equalTo($uid)) ->will($this->returnValue(false)); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); $manager->setLdapAccess($access); $user = $manager->get($uid); @@ -225,10 +226,10 @@ class Test_User_Manager extends \Test\TestCase { } public function testGetAttributesAll() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); $manager->setLdapAccess($access); $connection = $access->getConnection(); @@ -243,10 +244,10 @@ class Test_User_Manager extends \Test\TestCase { } public function testGetAttributesMinimal() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); $manager->setLdapAccess($access); $attributes = $manager->getAttributes(true); |