summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-03-19 15:53:30 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2018-04-05 12:46:24 +0200
commitf1565336bdaa72b6f4beddeb6fa04956f5da8f21 (patch)
tree67ddec46d0cf790d86f30851adb09a6c650074f0 /apps/user_ldap/tests
parent373a1d53918db011ca36351ad8e5240567ad999c (diff)
downloadnextcloud-server-f1565336bdaa72b6f4beddeb6fa04956f5da8f21.tar.gz
nextcloud-server-f1565336bdaa72b6f4beddeb6fa04956f5da8f21.zip
DI for NC's user manager
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r--apps/user_ldap/tests/AccessTest.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php
index 336b92af04f..43a34959c54 100644
--- a/apps/user_ldap/tests/AccessTest.php
+++ b/apps/user_ldap/tests/AccessTest.php
@@ -72,6 +72,8 @@ class AccessTest extends TestCase {
private $helper;
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject */
private $config;
+ /** @var IUserManager|\PHPUnit_Framework_MockObject_MockObject */
+ private $ncUserManager;
/** @var Access */
private $access;
@@ -82,13 +84,15 @@ class AccessTest extends TestCase {
$this->helper = $this->createMock(Helper::class);
$this->config = $this->createMock(IConfig::class);
$this->userMapper = $this->createMock(UserMapping::class);
+ $this->ncUserManager = $this->createMock(IUserManager::class);
$this->access = new Access(
$this->connection,
$this->ldap,
$this->userManager,
$this->helper,
- $this->config
+ $this->config,
+ $this->ncUserManager
);
$this->access->setUserMapper($this->userMapper);
}
@@ -227,7 +231,7 @@ class AccessTest extends TestCase {
list($lw, $con, $um, $helper) = $this->getConnectorAndLdapMock();
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject $config */
$config = $this->createMock(IConfig::class);
- $access = new Access($con, $lw, $um, $helper, $config);
+ $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager);
$lw->expects($this->exactly(1))
->method('explodeDN')
@@ -250,7 +254,7 @@ class AccessTest extends TestCase {
/** @var IConfig|\PHPUnit_Framework_MockObject_MockObject $config */
$config = $this->createMock(IConfig::class);
$lw = new LDAP();
- $access = new Access($con, $lw, $um, $helper, $config);
+ $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager);
if(!function_exists('ldap_explode_dn')) {
$this->markTestSkipped('LDAP Module not available');
@@ -431,7 +435,7 @@ class AccessTest extends TestCase {
$attribute => array('count' => 1, $dnFromServer)
)));
- $access = new Access($con, $lw, $um, $helper, $config);
+ $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager);
$values = $access->readAttribute('uid=whoever,dc=example,dc=org', $attribute);
$this->assertSame($values[0], strtolower($dnFromServer));
}