summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/tests/AccessTest.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2021-10-12 17:19:51 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2021-10-12 17:19:51 +0200
commit51398d706af44eaee2ecc5186ea564559c6aa934 (patch)
tree457eb43b715ec0ece18d48c22e0c7d04a8aad36c /apps/user_ldap/tests/AccessTest.php
parent437048e9b6e56dcc8915839d8383edac3819c692 (diff)
downloadnextcloud-server-51398d706af44eaee2ecc5186ea564559c6aa934.tar.gz
nextcloud-server-51398d706af44eaee2ecc5186ea564559c6aa934.zip
Use Psr\Log\LoggerInterface in OCA\User_LDAP\Access
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/tests/AccessTest.php')
-rw-r--r--apps/user_ldap/tests/AccessTest.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php
index 92b337c2cb8..5945bbd2fde 100644
--- a/apps/user_ldap/tests/AccessTest.php
+++ b/apps/user_ldap/tests/AccessTest.php
@@ -51,6 +51,7 @@ use OCP\Image;
use OCP\IUserManager;
use OCP\Notification\IManager as INotificationManager;
use OCP\Share\IManager;
+use Psr\Log\LoggerInterface;
use Test\TestCase;
/**
@@ -79,6 +80,8 @@ class AccessTest extends TestCase {
private $config;
/** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */
private $ncUserManager;
+ /** @var LoggerInterface|MockObject */
+ private $logger;
/** @var Access */
private $access;
@@ -92,6 +95,7 @@ class AccessTest extends TestCase {
$this->groupMapper = $this->createMock(GroupMapping::class);
$this->ncUserManager = $this->createMock(IUserManager::class);
$this->shareManager = $this->createMock(IManager::class);
+ $this->logger = $this->createMock(LoggerInterface::class);
$this->access = new Access(
$this->connection,
@@ -99,7 +103,8 @@ class AccessTest extends TestCase {
$this->userManager,
$this->helper,
$this->config,
- $this->ncUserManager
+ $this->ncUserManager,
+ $this->logger
);
$this->access->setUserMapper($this->userMapper);
$this->access->setGroupMapper($this->groupMapper);
@@ -239,7 +244,7 @@ class AccessTest extends TestCase {
[$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, $this->ncUserManager);
+ $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager, $this->logger);
$lw->expects($this->exactly(1))
->method('explodeDN')
@@ -262,7 +267,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, $this->ncUserManager);
+ $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager, $this->logger);
if (!function_exists('ldap_explode_dn')) {
$this->markTestSkipped('LDAP Module not available');
@@ -443,7 +448,7 @@ class AccessTest extends TestCase {
$attribute => ['count' => 1, $dnFromServer]
]);
- $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager);
+ $access = new Access($con, $lw, $um, $helper, $config, $this->ncUserManager, $this->logger);
$values = $access->readAttribute('uid=whoever,dc=example,dc=org', $attribute);
$this->assertSame($values[0], strtolower($dnFromServer));
}