diff options
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r-- | apps/user_ldap/tests/access.php | 3 | ||||
-rw-r--r-- | apps/user_ldap/tests/integration/lib/user/IntegrationTestUserAvatar.php | 3 | ||||
-rw-r--r-- | apps/user_ldap/tests/user/manager.php | 35 | ||||
-rw-r--r-- | apps/user_ldap/tests/user/user.php | 120 | ||||
-rw-r--r-- | apps/user_ldap/tests/user_ldap.php | 3 |
5 files changed, 88 insertions, 76 deletions
diff --git a/apps/user_ldap/tests/access.php b/apps/user_ldap/tests/access.php index d9a3919dfcd..6d35adf1694 100644 --- a/apps/user_ldap/tests/access.php +++ b/apps/user_ldap/tests/access.php @@ -58,7 +58,8 @@ class Test_Access extends \Test\TestCase { $this->getMock('\OCA\user_ldap\lib\LogWrapper'), $this->getMock('\OCP\IAvatarManager'), $this->getMock('\OCP\Image'), - $this->getMock('\OCP\IDBConnection'))); + $this->getMock('\OCP\IDBConnection'), + $this->getMock('\OCP\IUserManager'))); return array($lw, $connector, $um); } diff --git a/apps/user_ldap/tests/integration/lib/user/IntegrationTestUserAvatar.php b/apps/user_ldap/tests/integration/lib/user/IntegrationTestUserAvatar.php index 9fb0ffc1b7d..4db3ca48768 100644 --- a/apps/user_ldap/tests/integration/lib/user/IntegrationTestUserAvatar.php +++ b/apps/user_ldap/tests/integration/lib/user/IntegrationTestUserAvatar.php @@ -123,7 +123,8 @@ class IntegrationTestUserAvatar extends AbstractIntegrationTest { new \OCA\user_ldap\lib\LogWrapper(), \OC::$server->getAvatarManager(), new \OCP\Image(), - \OC::$server->getDatabaseConnection() + \OC::$server->getDatabaseConnection(), + \OC::$server->getUserManager() ); } 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); diff --git a/apps/user_ldap/tests/user/user.php b/apps/user_ldap/tests/user/user.php index 9b3bb4ace66..6fa7f3b6b27 100644 --- a/apps/user_ldap/tests/user/user.php +++ b/apps/user_ldap/tests/user/user.php @@ -25,6 +25,7 @@ namespace OCA\user_ldap\tests; use OCA\user_ldap\lib\user\User; +use OCP\IUserManager; /** * Class Test_User_User @@ -43,11 +44,12 @@ class Test_User_User extends \Test\TestCase { $avaMgr = $this->getMock('\OCP\IAvatarManager'); $image = $this->getMock('\OCP\Image'); $dbc = $this->getMock('\OCP\IDBConnection'); + $userMgr = $this->getMock('\OCP\IUserManager'); - return array($access, $config, $filesys, $image, $log, $avaMgr, $dbc); + return array($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr); } - private function getAdvancedMocks($cfMock, $fsMock, $logMock, $avaMgr, $dbc) { + private function getAdvancedMocks($cfMock, $fsMock, $logMock, $avaMgr, $dbc, $userMgr = null) { static $conMethods; static $accMethods; static $umMethods; @@ -61,8 +63,11 @@ class Test_User_User extends \Test\TestCase { } $lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper'); $im = $this->getMock('\OCP\Image'); + if (is_null($userMgr)) { + $userMgr = $this->getMock('\OCP\IUserManager'); + } $um = $this->getMock('\OCA\user_ldap\lib\user\Manager', - $umMethods, array($cfMock, $fsMock, $logMock, $avaMgr, $im, $dbc)); + $umMethods, array($cfMock, $fsMock, $logMock, $avaMgr, $im, $dbc, $userMgr)); $connector = $this->getMock('\OCA\user_ldap\lib\Connection', $conMethods, array($lw, null, null)); $access = $this->getMock('\OCA\user_ldap\lib\Access', @@ -72,25 +77,25 @@ class Test_User_User extends \Test\TestCase { } public function testGetDNandUsername() { - list($access, $config, $filesys, $image, $log, $avaMgr) = + 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); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $this->assertSame($dn, $user->getDN()); $this->assertSame($uid, $user->getUsername()); } public function testUpdateEmailProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = - $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc); + $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc, $userMgr); $connection->expects($this->once()) ->method('__get') @@ -103,24 +108,27 @@ class Test_User_User extends \Test\TestCase { $this->equalTo('email')) ->will($this->returnValue(array('alice@foo.bar'))); - $config->expects($this->once()) - ->method('setUserValue') - ->with($this->equalTo('alice'), $this->equalTo('settings'), - $this->equalTo('email'), - $this->equalTo('alice@foo.bar')) - ->will($this->returnValue(true)); - $uid = 'alice'; $dn = 'uid=alice,dc=foo,dc=bar'; + $uuser = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $uuser->expects($this->once()) + ->method('setEMailAddress') + ->with('alice@foo.bar'); + /** @var IUserManager | \PHPUnit_Framework_MockObject_MockObject $userMgr */ + $userMgr->expects($this->any()) + ->method('get') + ->willReturn($uuser); $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateEmail(); } public function testUpdateEmailNotProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -144,13 +152,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateEmail(); } public function testUpdateEmailNotConfigured() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -171,13 +179,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateEmail(); } public function testUpdateQuotaAllProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -214,13 +222,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateQuota(); } public function testUpdateQuotaDefaultProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -257,13 +265,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateQuota(); } public function testUpdateQuotaIndividualProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -300,13 +308,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateQuota(); } public function testUpdateQuotaNoneProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -338,13 +346,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateQuota(); } public function testUpdateQuotaNoneConfigured() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -373,13 +381,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateQuota(); } public function testUpdateQuotaFromValue() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -412,14 +420,14 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateQuota($readQuota); } //the testUpdateAvatar series also implicitely tests getAvatarImage public function testUpdateAvatarJpegPhotoProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -462,13 +470,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateAvatar(); } public function testUpdateAvatarThumbnailPhotoProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -520,13 +528,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateAvatar(); } public function testUpdateAvatarNotProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -566,13 +574,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->updateAvatar(); } public function testUpdateBeforeFirstLogin() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -602,13 +610,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->update(); } public function testUpdateAfterFirstLogin() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -642,13 +650,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->update(); } public function testUpdateNoRefresh() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -678,13 +686,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->update(); } public function testMarkLogin() { - list($access, $config, $filesys, $image, $log, $avaMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $db, $userMgr) = $this->getTestInstances(); $config->expects($this->once()) @@ -699,13 +707,13 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->markLogin(); } public function testGetAvatarImageProvided() { - list($access, $config, $filesys, $image, $log, $avaMgr) = + list($access, $config, $filesys, $image, $log, $avaMgr, $db, $userMgr) = $this->getTestInstances(); $access->expects($this->once()) @@ -718,7 +726,7 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $photo = $user->getAvatarImage(); $this->assertSame('this is a photo', $photo); @@ -728,7 +736,7 @@ class Test_User_User extends \Test\TestCase { } public function testProcessAttributes() { - list(, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list(, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -748,7 +756,7 @@ class Test_User_User extends \Test\TestCase { ); $userMock = $this->getMockBuilder('OCA\user_ldap\lib\user\User') - ->setConstructorArgs(array($uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr)) + ->setConstructorArgs(array($uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr)) ->setMethods($requiredMethods) ->getMock(); @@ -795,7 +803,7 @@ class Test_User_User extends \Test\TestCase { * @dataProvider emptyHomeFolderAttributeValueProvider */ public function testGetHomePathNotConfigured($attributeValue) { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -816,14 +824,14 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $path = $user->getHomePath(); $this->assertSame($path, false); } public function testGetHomePathConfiguredNotAvailableAllowed() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = @@ -847,7 +855,7 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $path = $user->getHomePath(); @@ -858,11 +866,11 @@ class Test_User_User extends \Test\TestCase { * @expectedException \Exception */ public function testGetHomePathConfiguredNotAvailableNotAllowed() { - list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc, $userMgr) = $this->getTestInstances(); list($access, $connection) = - $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc); + $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc, $userMgr); $connection->expects($this->any()) ->method('__get') @@ -882,7 +890,7 @@ class Test_User_User extends \Test\TestCase { $dn = 'uid=alice,dc=foo,dc=bar'; $user = new User( - $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr, $userMgr); $user->getHomePath(); } diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/user_ldap.php index 03ff90c29d1..0ae18a2aa96 100644 --- a/apps/user_ldap/tests/user_ldap.php +++ b/apps/user_ldap/tests/user_ldap.php @@ -84,7 +84,8 @@ class Test_User_Ldap_Direct extends \Test\TestCase { $this->getMock('\OCA\user_ldap\lib\LogWrapper'), $this->getMock('\OCP\IAvatarManager'), $this->getMock('\OCP\Image'), - $this->getMock('\OCP\IDBConnection') + $this->getMock('\OCP\IDBConnection'), + $this->getMock('\OCP\IUserManager') ]) ->getMock(); |