diff options
Diffstat (limited to 'apps/user_ldap/tests/User/ManagerTest.php')
-rw-r--r-- | apps/user_ldap/tests/User/ManagerTest.php | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/apps/user_ldap/tests/User/ManagerTest.php b/apps/user_ldap/tests/User/ManagerTest.php index 16d6a3d9d6e..823081f1da2 100644 --- a/apps/user_ldap/tests/User/ManagerTest.php +++ b/apps/user_ldap/tests/User/ManagerTest.php @@ -36,6 +36,7 @@ use OCP\IConfig; use OCP\IDBConnection; use OCP\Image; use OCP\IUserManager; +use OCP\Notification\IManager as INotificationManager; /** * Class Test_User_Manager @@ -55,6 +56,7 @@ class ManagerTest extends \Test\TestCase { $image = $this->createMock(Image::class); $dbc = $this->createMock(IDBConnection::class); $userMgr = $this->createMock(IUserManager::class); + $notiMgr = $this->createMock(INotificationManager::class); $connection = new \OCA\User_LDAP\Connection( $lw = $this->createMock(ILDAPWrapper::class), @@ -66,11 +68,11 @@ class ManagerTest extends \Test\TestCase { ->method('getConnection') ->will($this->returnValue($connection)); - return array($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr); + return array($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr, $notiMgr); } public function testGetByDNExisting() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr, $notiMgr) = $this->getTestInstances(); $inputDN = 'cn=foo,dc=foobar,dc=bar'; @@ -89,7 +91,7 @@ class ManagerTest extends \Test\TestCase { $access->expects($this->never()) ->method('username2dn'); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr, $notiMgr); $manager->setLdapAccess($access); $user = $manager->get($inputDN); @@ -101,7 +103,7 @@ class ManagerTest extends \Test\TestCase { } public function testGetByEDirectoryDN() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr, $notiMgr) = $this->getTestInstances(); $inputDN = 'uid=foo,o=foobar,c=bar'; @@ -120,7 +122,7 @@ class ManagerTest extends \Test\TestCase { $access->expects($this->never()) ->method('username2dn'); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr, $notiMgr); $manager->setLdapAccess($access); $user = $manager->get($inputDN); @@ -128,7 +130,7 @@ class ManagerTest extends \Test\TestCase { } public function testGetByExoticDN() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr, $notiMgr) = $this->getTestInstances(); $inputDN = 'ab=cde,f=ghei,mno=pq'; @@ -147,7 +149,7 @@ class ManagerTest extends \Test\TestCase { $access->expects($this->never()) ->method('username2dn'); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr, $notiMgr); $manager->setLdapAccess($access); $user = $manager->get($inputDN); @@ -155,7 +157,7 @@ class ManagerTest extends \Test\TestCase { } public function testGetByDNNotExisting() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr, $notiMgr) = $this->getTestInstances(); $inputDN = 'cn=gone,dc=foobar,dc=bar'; @@ -175,7 +177,7 @@ class ManagerTest extends \Test\TestCase { ->with($this->equalTo($inputDN)) ->will($this->returnValue(false)); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr, $notiMgr); $manager->setLdapAccess($access); $user = $manager->get($inputDN); @@ -183,7 +185,7 @@ class ManagerTest extends \Test\TestCase { } public function testGetByUidExisting() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr, $notiMgr) = $this->getTestInstances(); $dn = 'cn=foo,dc=foobar,dc=bar'; @@ -202,7 +204,7 @@ class ManagerTest extends \Test\TestCase { ->with($this->equalTo($uid)) ->will($this->returnValue(false)); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr, $notiMgr); $manager->setLdapAccess($access); $user = $manager->get($uid); @@ -214,7 +216,7 @@ class ManagerTest extends \Test\TestCase { } public function testGetByUidNotExisting() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr, $notiMgr) = $this->getTestInstances(); $uid = 'gone'; @@ -227,7 +229,7 @@ class ManagerTest extends \Test\TestCase { ->with($this->equalTo($uid)) ->will($this->returnValue(false)); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr, $notiMgr); $manager->setLdapAccess($access); $user = $manager->get($uid); @@ -235,10 +237,10 @@ class ManagerTest extends \Test\TestCase { } public function testGetAttributesAll() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr, $notiMgr) = $this->getTestInstances(); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr, $notiMgr); $manager->setLdapAccess($access); $connection = $access->getConnection(); @@ -253,10 +255,10 @@ class ManagerTest extends \Test\TestCase { } public function testGetAttributesMinimal() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr, $notiMgr) = $this->getTestInstances(); - $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr); + $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc, $userMgr, $notiMgr); $manager->setLdapAccess($access); $attributes = $manager->getAttributes(true); |