diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2021-11-23 15:26:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 15:26:25 +0100 |
commit | 20dd46fcaed56b7df151fe1a5273cdadc22a583e (patch) | |
tree | 1d45caccc6279073f71cb99603208639f1bf2c1b /apps/user_ldap/tests | |
parent | 244b7859890adbbcf5d1551f843ade740e398189 (diff) | |
parent | 7ac895e7666250b6878bb1c88d01966c395cdc46 (diff) | |
download | nextcloud-server-20dd46fcaed56b7df151fe1a5273cdadc22a583e.tar.gz nextcloud-server-20dd46fcaed56b7df151fe1a5273cdadc22a583e.zip |
Merge pull request #29610 from nextcloud/fix/user_ldap-logger
Get rid of user_ldap LogWrapper and use LoggerInterface
Diffstat (limited to 'apps/user_ldap/tests')
5 files changed, 16 insertions, 17 deletions
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index 5945bbd2fde..ef58db00f76 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -39,7 +39,6 @@ use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\Helper; use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\LDAP; -use OCA\User_LDAP\LogWrapper; use OCA\User_LDAP\Mapping\GroupMapping; use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\User\Manager; @@ -119,7 +118,7 @@ class AccessTest extends TestCase { ->setConstructorArgs([ $this->createMock(IConfig::class), $this->createMock(FilesystemHelper::class), - $this->createMock(LogWrapper::class), + $this->createMock(LoggerInterface::class), $this->createMock(IAvatarManager::class), $this->createMock(Image::class), $this->createMock(IUserManager::class), diff --git a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php index 97177007332..e22678620c1 100644 --- a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php +++ b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php @@ -33,10 +33,10 @@ use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\GroupPluginManager; use OCA\User_LDAP\Helper; use OCA\User_LDAP\LDAP; -use OCA\User_LDAP\LogWrapper; use OCA\User_LDAP\User\Manager; use OCA\User_LDAP\UserPluginManager; use OCP\Share\IManager; +use Psr\Log\LoggerInterface; abstract class AbstractIntegrationTest { /** @var LDAP */ @@ -123,7 +123,7 @@ abstract class AbstractIntegrationTest { $this->userManager = new Manager( \OC::$server->getConfig(), new FilesystemHelper(), - new LogWrapper(), + \OC::$server->get(LoggerInterface::class), \OC::$server->getAvatarManager(), new \OCP\Image(), \OC::$server->getUserManager(), diff --git a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php index 90334cef08d..ec1cebbe087 100644 --- a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php +++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php @@ -28,7 +28,6 @@ namespace OCA\User_LDAP\Tests\Integration\Lib\User; use OCA\User_LDAP\FilesystemHelper; -use OCA\User_LDAP\LogWrapper; use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\User\Manager; @@ -36,6 +35,7 @@ use OCA\User_LDAP\User\User; use OCA\User_LDAP\User_LDAP; use OCA\User_LDAP\UserPluginManager; use OCP\Image; +use Psr\Log\LoggerInterface; require_once __DIR__ . '/../../Bootstrap.php'; @@ -134,7 +134,7 @@ class IntegrationTestUserAvatar extends AbstractIntegrationTest { $this->userManager = new Manager( \OC::$server->getConfig(), new FilesystemHelper(), - new LogWrapper(), + \OC::$server->get(LoggerInterface::class), \OC::$server->getAvatarManager(), new Image(), \OC::$server->getDatabaseConnection(), diff --git a/apps/user_ldap/tests/User/ManagerTest.php b/apps/user_ldap/tests/User/ManagerTest.php index 01ed5a6ba12..adeabea73e9 100644 --- a/apps/user_ldap/tests/User/ManagerTest.php +++ b/apps/user_ldap/tests/User/ManagerTest.php @@ -32,7 +32,6 @@ use OCA\User_LDAP\Access; use OCA\User_LDAP\Connection; use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\ILDAPWrapper; -use OCA\User_LDAP\LogWrapper; use OCA\User_LDAP\User\Manager; use OCA\User_LDAP\User\User; use OCP\IAvatarManager; @@ -42,6 +41,7 @@ use OCP\Image; use OCP\IUserManager; use OCP\Notification\IManager as INotificationManager; use OCP\Share\IManager; +use Psr\Log\LoggerInterface; /** * Class Test_User_Manager @@ -60,8 +60,8 @@ class ManagerTest extends \Test\TestCase { /** @var FilesystemHelper|\PHPUnit\Framework\MockObject\MockObject */ protected $fileSystemHelper; - /** @var LogWrapper|\PHPUnit\Framework\MockObject\MockObject */ - protected $log; + /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ + protected $logger; /** @var IAvatarManager|\PHPUnit\Framework\MockObject\MockObject */ protected $avatarManager; @@ -95,7 +95,7 @@ class ManagerTest extends \Test\TestCase { $this->access = $this->createMock(Access::class); $this->config = $this->createMock(IConfig::class); $this->fileSystemHelper = $this->createMock(FilesystemHelper::class); - $this->log = $this->createMock(LogWrapper::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->avatarManager = $this->createMock(IAvatarManager::class); $this->image = $this->createMock(Image::class); $this->ncUserManager = $this->createMock(IUserManager::class); @@ -113,7 +113,7 @@ class ManagerTest extends \Test\TestCase { $this->manager = new Manager( $this->config, $this->fileSystemHelper, - $this->log, + $this->logger, $this->avatarManager, $this->image, $this->ncUserManager, diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php index b1b2d9ac391..cf3daa9f2c5 100644 --- a/apps/user_ldap/tests/User/UserTest.php +++ b/apps/user_ldap/tests/User/UserTest.php @@ -31,7 +31,6 @@ namespace OCA\User_LDAP\Tests\User; use OCA\User_LDAP\Access; use OCA\User_LDAP\Connection; use OCA\User_LDAP\FilesystemHelper; -use OCA\User_LDAP\LogWrapper; use OCA\User_LDAP\User\User; use OCP\IAvatar; use OCP\IAvatarManager; @@ -41,6 +40,7 @@ use OCP\IUser; use OCP\IUserManager; use OCP\Notification\IManager as INotificationManager; use OCP\Notification\INotification; +use Psr\Log\LoggerInterface; /** * Class UserTest @@ -66,8 +66,8 @@ class UserTest extends \Test\TestCase { protected $image; /** @var IAvatarManager|\PHPUnit\Framework\MockObject\MockObject */ protected $avatarManager; - /** @var LogWrapper|\PHPUnit\Framework\MockObject\MockObject */ - protected $log; + /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ + protected $logger; /** @var string */ protected $uid = 'alice'; /** @var string */ @@ -88,7 +88,7 @@ class UserTest extends \Test\TestCase { $this->config = $this->createMock(IConfig::class); $this->filesystemhelper = $this->createMock(FilesystemHelper::class); - $this->log = $this->createMock(LogWrapper::class); + $this->logger = $this->createMock(LoggerInterface::class); $this->avatarManager = $this->createMock(IAvatarManager::class); $this->image = $this->createMock(Image::class); $this->userManager = $this->createMock(IUserManager::class); @@ -101,7 +101,7 @@ class UserTest extends \Test\TestCase { $this->config, $this->filesystemhelper, $this->image, - $this->log, + $this->logger, $this->avatarManager, $this->userManager, $this->notificationManager @@ -935,7 +935,7 @@ class UserTest extends \Test\TestCase { $this->config, $this->filesystemhelper, $this->image, - $this->log, + $this->logger, $this->avatarManager, $this->userManager, $this->notificationManager |