summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/ajax/wizard.php3
-rw-r--r--apps/user_ldap/appinfo/app.php7
-rw-r--r--apps/user_ldap/lib/jobs.php8
-rw-r--r--apps/user_ldap/lib/proxy.php8
-rw-r--r--apps/user_ldap/lib/user/manager.php56
-rw-r--r--apps/user_ldap/tests/access.php3
-rw-r--r--apps/user_ldap/tests/group_ldap.php3
-rw-r--r--apps/user_ldap/tests/user/manager.php27
-rw-r--r--apps/user_ldap/tests/user/user.php63
-rw-r--r--apps/user_ldap/tests/user_ldap.php3
10 files changed, 94 insertions, 87 deletions
diff --git a/apps/user_ldap/ajax/wizard.php b/apps/user_ldap/ajax/wizard.php
index 6d7d70c8c5a..48bfb56311c 100644
--- a/apps/user_ldap/ajax/wizard.php
+++ b/apps/user_ldap/ajax/wizard.php
@@ -52,7 +52,8 @@ $userManager = new \OCA\user_ldap\lib\user\Manager(
new \OCA\user_ldap\lib\FilesystemHelper(),
new \OCA\user_ldap\lib\LogWrapper(),
\OC::$server->getAvatarManager(),
- new \OCP\Image());
+ new \OCP\Image(),
+ \OC::$server->getDatabaseConnection());
$access = new \OCA\user_ldap\lib\Access($con, $ldapWrapper, $userManager);
diff --git a/apps/user_ldap/appinfo/app.php b/apps/user_ldap/appinfo/app.php
index 980477bb273..911688a5c20 100644
--- a/apps/user_ldap/appinfo/app.php
+++ b/apps/user_ldap/appinfo/app.php
@@ -29,14 +29,17 @@ $configPrefixes = $helper->getServerConfigurationPrefixes(true);
$ldapWrapper = new OCA\user_ldap\lib\LDAP();
$ocConfig = \OC::$server->getConfig();
if(count($configPrefixes) === 1) {
+ $dbc = \OC::$server->getDatabaseConnection();
$userManager = new OCA\user_ldap\lib\user\Manager($ocConfig,
new OCA\user_ldap\lib\FilesystemHelper(),
new OCA\user_ldap\lib\LogWrapper(),
\OC::$server->getAvatarManager(),
- new \OCP\Image());
+ new \OCP\Image(),
+ $dbc
+ );
$connector = new OCA\user_ldap\lib\Connection($ldapWrapper, $configPrefixes[0]);
$ldapAccess = new OCA\user_ldap\lib\Access($connector, $ldapWrapper, $userManager);
- $dbc = \OC::$server->getDatabaseConnection();
+
$ldapAccess->setUserMapper(new OCA\User_LDAP\Mapping\UserMapping($dbc));
$ldapAccess->setGroupMapper(new OCA\User_LDAP\Mapping\GroupMapping($dbc));
$userBackend = new OCA\user_ldap\USER_LDAP($ldapAccess, $ocConfig);
diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/jobs.php
index e8e6df0b9d0..a887b65251c 100644
--- a/apps/user_ldap/lib/jobs.php
+++ b/apps/user_ldap/lib/jobs.php
@@ -164,16 +164,18 @@ class Jobs extends \OC\BackgroundJob\TimedJob {
$ldapWrapper = new LDAP();
if(count($configPrefixes) === 1) {
//avoid the proxy when there is only one LDAP server configured
+ $dbc = \OC::$server->getDatabaseConnection();
$userManager = new user\Manager(
\OC::$server->getConfig(),
new FilesystemHelper(),
new LogWrapper(),
\OC::$server->getAvatarManager(),
- new \OCP\Image());
+ new \OCP\Image(),
+ $dbc);
$connector = new Connection($ldapWrapper, $configPrefixes[0]);
$ldapAccess = new Access($connector, $ldapWrapper, $userManager);
- $groupMapper = new GroupMapping(\OC::$server->getDatabaseConnection());
- $userMapper = new UserMapping(\OC::$server->getDatabaseConnection());
+ $groupMapper = new GroupMapping($dbc);
+ $userMapper = new UserMapping($dbc);
$ldapAccess->setGroupMapper($groupMapper);
$ldapAccess->setUserMapper($userMapper);
self::$groupBE = new \OCA\user_ldap\GROUP_LDAP($ldapAccess);
diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/proxy.php
index 39d4b36c8bb..b4e6e33c1f4 100644
--- a/apps/user_ldap/lib/proxy.php
+++ b/apps/user_ldap/lib/proxy.php
@@ -49,16 +49,18 @@ abstract class Proxy {
static $avatarM;
static $userMap;
static $groupMap;
+ static $db;
if(is_null($fs)) {
$ocConfig = \OC::$server->getConfig();
$fs = new FilesystemHelper();
$log = new LogWrapper();
$avatarM = \OC::$server->getAvatarManager();
- $userMap = new UserMapping(\OC::$server->getDatabaseConnection());
- $groupMap = new GroupMapping(\OC::$server->getDatabaseConnection());
+ $db = \OC::$server->getDatabaseConnection();
+ $userMap = new UserMapping($db);
+ $groupMap = new GroupMapping($db);
}
$userManager =
- new user\Manager($ocConfig, $fs, $log, $avatarM, new \OCP\Image());
+ new user\Manager($ocConfig, $fs, $log, $avatarM, new \OCP\Image(), $db);
$connector = new Connection($this->ldap, $configPrefix);
$access = new Access($connector, $this->ldap, $userManager);
$access->setUserMapper($userMap);
diff --git a/apps/user_ldap/lib/user/manager.php b/apps/user_ldap/lib/user/manager.php
index 955a2923a64..ec50e031281 100644
--- a/apps/user_ldap/lib/user/manager.php
+++ b/apps/user_ldap/lib/user/manager.php
@@ -36,30 +36,27 @@ use OCA\user_ldap\lib\user\OfflineUser;
* cache
*/
class Manager {
- /**
- * @var IUserTools
- */
+ /** @var IUserTools */
protected $access;
- /**
- * @var \OCP\IConfig
- */
+
+ /** @var \OCP\IConfig */
protected $ocConfig;
- /**
- * @var FilesystemHelper
- */
+
+ /** @var \OCP\IDBConnection */
+ protected $db;
+
+ /** @var FilesystemHelper */
protected $ocFilesystem;
- /**
- * @var LogWrapper
- */
+
+ /** @var LogWrapper */
protected $ocLog;
- /**
- * @var \OCP\Image
- */
+
+ /** @var \OCP\Image */
protected $image;
- /**
- * @param \OCP\IAvatarManager
- */
+
+ /** @param \OCP\IAvatarManager */
protected $avatarManager;
+
/**
* array['byDN'] \OCA\user_ldap\lib\User[]
* ['byUid'] \OCA\user_ldap\lib\User[]
@@ -71,28 +68,25 @@ class Manager {
);
/**
- * @brief Constructor
- * @param \OCP\IConfig
- * @param \OCA\user_ldap\lib\FilesystemHelper object that gives access to
- * necessary functions from the OC filesystem
- * @param \OCA\user_ldap\lib\LogWrapper
- * @param \OCP\IAvatarManager
- * @param \OCP\Image an empty image instance
+ * @param \OCP\IConfig $ocConfig
+ * @param \OCA\user_ldap\lib\FilesystemHelper $ocFilesystem object that
+ * gives access to necessary functions from the OC filesystem
+ * @param \OCA\user_ldap\lib\LogWrapper $ocLog
+ * @param \OCP\IAvatarManager $avatarManager
+ * @param \OCP\Image $image an empty image instance
+ * @param \OCP\IDBConnection $db
* @throws Exception when the methods mentioned above do not exist
*/
public function __construct(\OCP\IConfig $ocConfig,
FilesystemHelper $ocFilesystem, LogWrapper $ocLog,
- \OCP\IAvatarManager $avatarManager, \OCP\Image $image) {
+ \OCP\IAvatarManager $avatarManager, \OCP\Image $image, \OCP\IDBConnection $db) {
- if(!method_exists($ocConfig, 'setUserValue')
- || !method_exists($ocConfig, 'getUserValue')) {
- throw new \Exception('Invalid ownCloud User Config object');
- }
$this->ocConfig = $ocConfig;
$this->ocFilesystem = $ocFilesystem;
$this->ocLog = $ocLog;
$this->avatarManager = $avatarManager;
$this->image = $image;
+ $this->db = $db;
}
/**
@@ -152,7 +146,7 @@ class Manager {
return new OfflineUser(
$id,
$this->ocConfig,
- \OC::$server->getDatabaseConnection(),
+ $this->db,
$this->access->getUserMapper());
}
diff --git a/apps/user_ldap/tests/access.php b/apps/user_ldap/tests/access.php
index 85849229152..5c502f288eb 100644
--- a/apps/user_ldap/tests/access.php
+++ b/apps/user_ldap/tests/access.php
@@ -47,7 +47,8 @@ class Test_Access extends \Test\TestCase {
$this->getMock('\OCA\user_ldap\lib\FilesystemHelper'),
$this->getMock('\OCA\user_ldap\lib\LogWrapper'),
$this->getMock('\OCP\IAvatarManager'),
- $this->getMock('\OCP\Image')));
+ $this->getMock('\OCP\Image'),
+ $this->getMock('\OCP\IDBConnection')));
return array($lw, $connector, $um);
}
diff --git a/apps/user_ldap/tests/group_ldap.php b/apps/user_ldap/tests/group_ldap.php
index 0e01eb3ba6f..efd7f803f3b 100644
--- a/apps/user_ldap/tests/group_ldap.php
+++ b/apps/user_ldap/tests/group_ldap.php
@@ -45,7 +45,8 @@ class Test_Group_Ldap extends \Test\TestCase {
$this->getMock('\OCA\user_ldap\lib\FilesystemHelper'),
$this->getMock('\OCA\user_ldap\lib\LogWrapper'),
$this->getMock('\OCP\IAvatarManager'),
- $this->getMock('\OCP\Image')
+ $this->getMock('\OCP\Image'),
+ $this->getMock('\OCP\IDBConnection')
);
$access = $this->getMock('\OCA\user_ldap\lib\Access',
$accMethods,
diff --git a/apps/user_ldap/tests/user/manager.php b/apps/user_ldap/tests/user/manager.php
index fb47f60539f..4ce504365b8 100644
--- a/apps/user_ldap/tests/user/manager.php
+++ b/apps/user_ldap/tests/user/manager.php
@@ -33,12 +33,13 @@ class Test_User_Manager extends \Test\TestCase {
$log = $this->getMock('\OCA\user_ldap\lib\LogWrapper');
$avaMgr = $this->getMock('\OCP\IAvatarManager');
$image = $this->getMock('\OCP\Image');
+ $dbc = $this->getMock('\OCP\IDBConnection');
- return array($access, $config, $filesys, $image, $log, $avaMgr);
+ return array($access, $config, $filesys, $image, $log, $avaMgr, $dbc);
}
public function testGetByDNExisting() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
$inputDN = 'cn=foo,dc=foobar,dc=bar';
@@ -57,7 +58,7 @@ class Test_User_Manager extends \Test\TestCase {
$access->expects($this->never())
->method('username2dn');
- $manager = new Manager($config, $filesys, $log, $avaMgr, $image);
+ $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc);
$manager->setLdapAccess($access);
$user = $manager->get($inputDN);
@@ -65,7 +66,7 @@ class Test_User_Manager extends \Test\TestCase {
}
public function testGetByEDirectoryDN() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
$inputDN = 'uid=foo,o=foobar,c=bar';
@@ -84,7 +85,7 @@ class Test_User_Manager extends \Test\TestCase {
$access->expects($this->never())
->method('username2dn');
- $manager = new Manager($config, $filesys, $log, $avaMgr, $image);
+ $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc);
$manager->setLdapAccess($access);
$user = $manager->get($inputDN);
@@ -92,7 +93,7 @@ class Test_User_Manager extends \Test\TestCase {
}
public function testGetByExoticDN() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
$inputDN = 'ab=cde,f=ghei,mno=pq';
@@ -111,7 +112,7 @@ class Test_User_Manager extends \Test\TestCase {
$access->expects($this->never())
->method('username2dn');
- $manager = new Manager($config, $filesys, $log, $avaMgr, $image);
+ $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc);
$manager->setLdapAccess($access);
$user = $manager->get($inputDN);
@@ -119,7 +120,7 @@ class Test_User_Manager extends \Test\TestCase {
}
public function testGetByDNNotExisting() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
$inputDN = 'cn=gone,dc=foobar,dc=bar';
@@ -139,7 +140,7 @@ class Test_User_Manager extends \Test\TestCase {
->with($this->equalTo($inputDN))
->will($this->returnValue(false));
- $manager = new Manager($config, $filesys, $log, $avaMgr, $image);
+ $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc);
$manager->setLdapAccess($access);
$user = $manager->get($inputDN);
@@ -147,7 +148,7 @@ class Test_User_Manager extends \Test\TestCase {
}
public function testGetByUidExisting() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
$dn = 'cn=foo,dc=foobar,dc=bar';
@@ -166,7 +167,7 @@ class Test_User_Manager extends \Test\TestCase {
->with($this->equalTo($uid))
->will($this->returnValue(false));
- $manager = new Manager($config, $filesys, $log, $avaMgr, $image);
+ $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc);
$manager->setLdapAccess($access);
$user = $manager->get($uid);
@@ -174,7 +175,7 @@ class Test_User_Manager extends \Test\TestCase {
}
public function testGetByUidNotExisting() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
$dn = 'cn=foo,dc=foobar,dc=bar';
@@ -188,7 +189,7 @@ class Test_User_Manager extends \Test\TestCase {
->with($this->equalTo($uid))
->will($this->returnValue(false));
- $manager = new Manager($config, $filesys, $log, $avaMgr, $image);
+ $manager = new Manager($config, $filesys, $log, $avaMgr, $image, $dbc);
$manager->setLdapAccess($access);
$user = $manager->get($uid);
diff --git a/apps/user_ldap/tests/user/user.php b/apps/user_ldap/tests/user/user.php
index e110921d2d3..5282a9f8b6e 100644
--- a/apps/user_ldap/tests/user/user.php
+++ b/apps/user_ldap/tests/user/user.php
@@ -33,11 +33,12 @@ class Test_User_User extends \Test\TestCase {
$log = $this->getMock('\OCA\user_ldap\lib\LogWrapper');
$avaMgr = $this->getMock('\OCP\IAvatarManager');
$image = $this->getMock('\OCP\Image');
+ $dbc = $this->getMock('\OCP\IDBConnection');
- return array($access, $config, $filesys, $image, $log, $avaMgr);
+ return array($access, $config, $filesys, $image, $log, $avaMgr, $dbc);
}
- private function getAdvancedMocks($cfMock, $fsMock, $logMock, $avaMgr) {
+ private function getAdvancedMocks($cfMock, $fsMock, $logMock, $avaMgr, $dbc) {
static $conMethods;
static $accMethods;
static $umMethods;
@@ -52,7 +53,7 @@ class Test_User_User extends \Test\TestCase {
$lw = $this->getMock('\OCA\user_ldap\lib\ILDAPWrapper');
$im = $this->getMock('\OCP\Image');
$um = $this->getMock('\OCA\user_ldap\lib\user\Manager',
- $umMethods, array($cfMock, $fsMock, $logMock, $avaMgr, $im));
+ $umMethods, array($cfMock, $fsMock, $logMock, $avaMgr, $im, $dbc));
$connector = $this->getMock('\OCA\user_ldap\lib\Connection',
$conMethods, array($lw, null, null));
$access = $this->getMock('\OCA\user_ldap\lib\Access',
@@ -76,11 +77,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateEmailProvided() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$connection->expects($this->once())
->method('__get')
@@ -110,11 +111,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateEmailNotProvided() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$connection->expects($this->once())
->method('__get')
@@ -140,11 +141,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateEmailNotConfigured() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$connection->expects($this->once())
->method('__get')
@@ -167,11 +168,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateQuotaAllProvided() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$connection->expects($this->at(0))
->method('__get')
@@ -210,11 +211,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateQuotaDefaultProvided() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$connection->expects($this->at(0))
->method('__get')
@@ -253,11 +254,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateQuotaIndividualProvided() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$connection->expects($this->at(0))
->method('__get')
@@ -296,11 +297,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateQuotaNoneProvided() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$connection->expects($this->at(0))
->method('__get')
@@ -334,11 +335,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateQuotaNoneConfigured() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$connection->expects($this->at(0))
->method('__get')
@@ -370,11 +371,11 @@ class Test_User_User extends \Test\TestCase {
//the testUpdateAvatar series also implicitely tests getAvatarImage
public function testUpdateAvatarJpegPhotoProvided() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$access->expects($this->once())
->method('readAttribute')
@@ -419,11 +420,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateAvatarThumbnailPhotoProvided() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$access->expects($this->at(0))
->method('readAttribute')
@@ -477,11 +478,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateAvatarNotProvided() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$access->expects($this->at(0))
->method('readAttribute')
@@ -523,11 +524,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateBeforeFirstLogin() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$config->expects($this->at(0))
->method('getUserValue')
@@ -559,11 +560,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateAfterFirstLogin() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$config->expects($this->at(0))
->method('getUserValue')
@@ -599,11 +600,11 @@ class Test_User_User extends \Test\TestCase {
}
public function testUpdateNoRefresh() {
- list($access, $config, $filesys, $image, $log, $avaMgr) =
+ list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) =
$this->getTestInstances();
list($access, $connection) =
- $this->getAdvancedMocks($config, $filesys, $log, $avaMgr);
+ $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc);
$config->expects($this->at(0))
->method('getUserValue')
diff --git a/apps/user_ldap/tests/user_ldap.php b/apps/user_ldap/tests/user_ldap.php
index c4ba4f45795..3fa4f2bf0a1 100644
--- a/apps/user_ldap/tests/user_ldap.php
+++ b/apps/user_ldap/tests/user_ldap.php
@@ -62,7 +62,8 @@ class Test_User_Ldap_Direct extends \Test\TestCase {
$this->getMock('\OCA\user_ldap\lib\FilesystemHelper'),
$this->getMock('\OCA\user_ldap\lib\LogWrapper'),
$this->getMock('\OCP\IAvatarManager'),
- $this->getMock('\OCP\Image')
+ $this->getMock('\OCP\Image'),
+ $this->getMock('\OCP\IDBConnection')
);
$access = $this->getMock('\OCA\user_ldap\lib\Access',