diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2022-12-20 16:48:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-20 16:48:07 +0100 |
commit | f6ff717b56ac9fa69e60991e982dfdd4c26a95f3 (patch) | |
tree | e2095fcda4ff53d33a91bfd983d8f9d78a83a89e /apps/user_ldap/tests | |
parent | 1db0ddee3beb1c41016388cd3d11cf0232f6030d (diff) | |
parent | 341dda1de618ee76a1e617cc4c15267c120d32c3 (diff) | |
download | nextcloud-server-f6ff717b56ac9fa69e60991e982dfdd4c26a95f3.tar.gz nextcloud-server-f6ff717b56ac9fa69e60991e982dfdd4c26a95f3.zip |
Merge pull request #34772 from nextcloud/fix/clean-ldap-access-factory-usage
Make sure to use AccessFactory to create Access instances and use DI
Diffstat (limited to 'apps/user_ldap/tests')
-rw-r--r-- | apps/user_ldap/tests/User_ProxyTest.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/apps/user_ldap/tests/User_ProxyTest.php b/apps/user_ldap/tests/User_ProxyTest.php index ed95344f115..edeefeb4b0e 100644 --- a/apps/user_ldap/tests/User_ProxyTest.php +++ b/apps/user_ldap/tests/User_ProxyTest.php @@ -28,6 +28,7 @@ */ namespace OCA\User_LDAP\Tests; +use OCA\User_LDAP\AccessFactory; use OCA\User_LDAP\Helper; use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\User_Proxy; @@ -35,22 +36,25 @@ use OCA\User_LDAP\UserPluginManager; use OCP\IConfig; use OCP\IUserSession; use OCP\Notification\IManager as INotificationManager; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class User_ProxyTest extends TestCase { - /** @var Helper|\PHPUnit\Framework\MockObject\MockObject */ + /** @var Helper|MockObject */ protected $helper; - /** @var ILDAPWrapper|\PHPUnit\Framework\MockObject\MockObject */ + /** @var ILDAPWrapper|MockObject */ private $ldapWrapper; - /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ + /** @var AccessFactory|MockObject */ + private $accessFactory; + /** @var IConfig|MockObject */ private $config; - /** @var INotificationManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var INotificationManager|MockObject */ private $notificationManager; - /** @var IUserSession|\PHPUnit\Framework\MockObject\MockObject */ + /** @var IUserSession|MockObject */ private $userSession; - /** @var User_Proxy|\PHPUnit\Framework\MockObject\MockObject */ + /** @var User_Proxy|MockObject */ private $proxy; - /** @var UserPluginManager|\PHPUnit\Framework\MockObject\MockObject */ + /** @var UserPluginManager|MockObject */ private $userPluginManager; protected function setUp(): void { @@ -58,6 +62,7 @@ class User_ProxyTest extends TestCase { $this->helper = $this->createMock(Helper::class); $this->ldapWrapper = $this->createMock(ILDAPWrapper::class); + $this->accessFactory = $this->createMock(AccessFactory::class); $this->config = $this->createMock(IConfig::class); $this->notificationManager = $this->createMock(INotificationManager::class); $this->userSession = $this->createMock(IUserSession::class); @@ -66,6 +71,7 @@ class User_ProxyTest extends TestCase { ->setConstructorArgs([ $this->helper, $this->ldapWrapper, + $this->accessFactory, $this->config, $this->notificationManager, $this->userSession, |