diff --git a/apps/user_ldap/composer/composer/autoload_classmap.php b/apps/user_ldap/composer/composer/autoload_classmap.php index 48fe59a9a51..6cecd7fd6a6 100644 --- a/apps/user_ldap/composer/composer/autoload_classmap.php +++ b/apps/user_ldap/composer/composer/autoload_classmap.php @@ -38,7 +38,6 @@ return array( 'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => $baseDir . '/../lib/Exceptions/ConstraintViolationException.php', 'OCA\\User_LDAP\\Exceptions\\NoMoreResults' => $baseDir . '/../lib/Exceptions/NoMoreResults.php', 'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => $baseDir . '/../lib/Exceptions/NotOnLDAP.php', - 'OCA\\User_LDAP\\FilesystemHelper' => $baseDir . '/../lib/FilesystemHelper.php', 'OCA\\User_LDAP\\GroupPluginManager' => $baseDir . '/../lib/GroupPluginManager.php', 'OCA\\User_LDAP\\Group_LDAP' => $baseDir . '/../lib/Group_LDAP.php', 'OCA\\User_LDAP\\Group_Proxy' => $baseDir . '/../lib/Group_Proxy.php', diff --git a/apps/user_ldap/composer/composer/autoload_static.php b/apps/user_ldap/composer/composer/autoload_static.php index dd5ad0322af..b31ac98834f 100644 --- a/apps/user_ldap/composer/composer/autoload_static.php +++ b/apps/user_ldap/composer/composer/autoload_static.php @@ -53,7 +53,6 @@ class ComposerStaticInitUser_LDAP 'OCA\\User_LDAP\\Exceptions\\ConstraintViolationException' => __DIR__ . '/..' . '/../lib/Exceptions/ConstraintViolationException.php', 'OCA\\User_LDAP\\Exceptions\\NoMoreResults' => __DIR__ . '/..' . '/../lib/Exceptions/NoMoreResults.php', 'OCA\\User_LDAP\\Exceptions\\NotOnLDAP' => __DIR__ . '/..' . '/../lib/Exceptions/NotOnLDAP.php', - 'OCA\\User_LDAP\\FilesystemHelper' => __DIR__ . '/..' . '/../lib/FilesystemHelper.php', 'OCA\\User_LDAP\\GroupPluginManager' => __DIR__ . '/..' . '/../lib/GroupPluginManager.php', 'OCA\\User_LDAP\\Group_LDAP' => __DIR__ . '/..' . '/../lib/Group_LDAP.php', 'OCA\\User_LDAP\\Group_Proxy' => __DIR__ . '/..' . '/../lib/Group_Proxy.php', diff --git a/apps/user_ldap/lib/AppInfo/Application.php b/apps/user_ldap/lib/AppInfo/Application.php index 3c1cb5daa12..59c88e06073 100644 --- a/apps/user_ldap/lib/AppInfo/Application.php +++ b/apps/user_ldap/lib/AppInfo/Application.php @@ -10,7 +10,6 @@ use OCA\Files_External\Service\BackendService; use OCA\User_LDAP\Controller\RenewPasswordController; use OCA\User_LDAP\Events\GroupBackendRegistered; use OCA\User_LDAP\Events\UserBackendRegistered; -use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\Group_Proxy; use OCA\User_LDAP\GroupPluginManager; use OCA\User_LDAP\Handler\ExtStorageConfigHandler; @@ -85,7 +84,6 @@ class Application extends App implements IBootstrap { function (ContainerInterface $c) { return new Manager( $c->get(IConfig::class), - $c->get(FilesystemHelper::class), $c->get(LoggerInterface::class), $c->get(IAvatarManager::class), $c->get(Image::class), diff --git a/apps/user_ldap/lib/FilesystemHelper.php b/apps/user_ldap/lib/FilesystemHelper.php deleted file mode 100644 index eea7ec62ad8..00000000000 --- a/apps/user_ldap/lib/FilesystemHelper.php +++ /dev/null @@ -1,32 +0,0 @@ -checkAccess(); $user = new User($uid, $dn, $this->access, $this->ocConfig, - $this->ocFilesystem, clone $this->image, $this->logger, + clone $this->image, $this->logger, $this->avatarManager, $this->userManager, $this->notificationManager); $this->usersByDN[$dn] = $user; diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php index 1e3f7036955..ec06d1d8636 100644 --- a/apps/user_ldap/lib/User/User.php +++ b/apps/user_ldap/lib/User/User.php @@ -12,7 +12,6 @@ use OC\Accounts\AccountManager; use OCA\User_LDAP\Access; use OCA\User_LDAP\Connection; use OCA\User_LDAP\Exceptions\AttributeNotSet; -use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\Service\BirthdateParserService; use OCP\Accounts\IAccountManager; use OCP\Accounts\PropertyDoesNotExistException; @@ -56,7 +55,6 @@ class User { protected string $dn, protected Access $access, protected IConfig $config, - protected FilesystemHelper $fs, protected Image $image, protected LoggerInterface $logger, protected IAvatarManager $avatarManager, diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index 5bb4a4657cb..1ecc5565bed 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -10,7 +10,6 @@ use OC\ServerNotAvailableException; use OCA\User_LDAP\Access; use OCA\User_LDAP\Connection; use OCA\User_LDAP\Exceptions\ConstraintViolationException; -use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\Helper; use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\LDAP; @@ -111,7 +110,6 @@ class AccessTest extends TestCase { $um = $this->getMockBuilder(Manager::class) ->setConstructorArgs([ $this->createMock(IConfig::class), - $this->createMock(FilesystemHelper::class), $this->createMock(LoggerInterface::class), $this->createMock(IAvatarManager::class), $this->createMock(Image::class), diff --git a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php index 726342a88f7..12f97637618 100644 --- a/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php +++ b/apps/user_ldap/tests/Integration/AbstractIntegrationTest.php @@ -9,7 +9,6 @@ namespace OCA\User_LDAP\Tests\Integration; use OCA\User_LDAP\Access; use OCA\User_LDAP\Connection; -use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\GroupPluginManager; use OCA\User_LDAP\Helper; use OCA\User_LDAP\LDAP; @@ -110,7 +109,6 @@ abstract class AbstractIntegrationTest { protected function initUserManager() { $this->userManager = new Manager( \OC::$server->getConfig(), - new FilesystemHelper(), \OC::$server->get(LoggerInterface::class), \OC::$server->get(IAvatarManager::class), new Image(), diff --git a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php index 082c8ee46d4..75ce42e299c 100644 --- a/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php +++ b/apps/user_ldap/tests/Integration/Lib/User/IntegrationTestUserAvatar.php @@ -7,7 +7,6 @@ */ namespace OCA\User_LDAP\Tests\Integration\Lib\User; -use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\Mapping\UserMapping; use OCA\User_LDAP\Tests\Integration\AbstractIntegrationTest; use OCA\User_LDAP\User\DeletedUsersIndex; @@ -115,7 +114,6 @@ class IntegrationTestUserAvatar extends AbstractIntegrationTest { protected function initUserManager() { $this->userManager = new Manager( \OC::$server->getConfig(), - new FilesystemHelper(), \OC::$server->get(LoggerInterface::class), \OC::$server->get(IAvatarManager::class), new Image(), diff --git a/apps/user_ldap/tests/User/ManagerTest.php b/apps/user_ldap/tests/User/ManagerTest.php index 449f159ec4d..4f504ff5f7a 100644 --- a/apps/user_ldap/tests/User/ManagerTest.php +++ b/apps/user_ldap/tests/User/ManagerTest.php @@ -9,7 +9,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\ILDAPWrapper; use OCA\User_LDAP\User\Manager; use OCA\User_LDAP\User\User; @@ -36,9 +35,6 @@ class ManagerTest extends \Test\TestCase { /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ protected $config; - /** @var FilesystemHelper|\PHPUnit\Framework\MockObject\MockObject */ - protected $fileSystemHelper; - /** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */ protected $logger; @@ -73,7 +69,6 @@ class ManagerTest extends \Test\TestCase { $this->access = $this->createMock(Access::class); $this->config = $this->createMock(IConfig::class); - $this->fileSystemHelper = $this->createMock(FilesystemHelper::class); $this->logger = $this->createMock(LoggerInterface::class); $this->avatarManager = $this->createMock(IAvatarManager::class); $this->image = $this->createMock(Image::class); @@ -91,7 +86,6 @@ class ManagerTest extends \Test\TestCase { /** @noinspection PhpUnhandledExceptionInspection */ $this->manager = new Manager( $this->config, - $this->fileSystemHelper, $this->logger, $this->avatarManager, $this->image, diff --git a/apps/user_ldap/tests/User/UserTest.php b/apps/user_ldap/tests/User/UserTest.php index 7c39aa155dc..badbca7f476 100644 --- a/apps/user_ldap/tests/User/UserTest.php +++ b/apps/user_ldap/tests/User/UserTest.php @@ -9,7 +9,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\User\User; use OCP\IAvatar; use OCP\IAvatarManager; @@ -36,8 +35,6 @@ class UserTest extends \Test\TestCase { protected $connection; /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ protected $config; - /** @var FilesystemHelper|\PHPUnit\Framework\MockObject\MockObject */ - protected $filesystemhelper; /** @var INotificationManager|\PHPUnit\Framework\MockObject\MockObject */ protected $notificationManager; /** @var IUserManager|\PHPUnit\Framework\MockObject\MockObject */ @@ -67,7 +64,6 @@ class UserTest extends \Test\TestCase { ->willReturn($this->connection); $this->config = $this->createMock(IConfig::class); - $this->filesystemhelper = $this->createMock(FilesystemHelper::class); $this->logger = $this->createMock(LoggerInterface::class); $this->avatarManager = $this->createMock(IAvatarManager::class); $this->image = $this->createMock(Image::class); @@ -79,7 +75,6 @@ class UserTest extends \Test\TestCase { $this->dn, $this->access, $this->config, - $this->filesystemhelper, $this->image, $this->logger, $this->avatarManager, @@ -508,10 +503,6 @@ class UserTest extends \Test\TestCase { ->method('setUserValue') ->with($this->uid, 'user_ldap', 'lastAvatarChecksum', md5('this is a photo')); - $this->filesystemhelper->expects($this->once()) - ->method('isLoaded') - ->willReturn(true); - $avatar = $this->createMock(IAvatar::class); $avatar->expects($this->once()) ->method('set') @@ -559,9 +550,6 @@ class UserTest extends \Test\TestCase { $this->config->expects($this->never()) ->method('setUserValue'); - $this->filesystemhelper->expects($this->never()) - ->method('isLoaded'); - $avatar = $this->createMock(IAvatar::class); $avatar->expects($this->never()) ->method('set'); @@ -626,10 +614,6 @@ class UserTest extends \Test\TestCase { ->method('setUserValue') ->with($this->uid, 'user_ldap', 'lastAvatarChecksum', md5('this is a photo')); - $this->filesystemhelper->expects($this->once()) - ->method('isLoaded') - ->willReturn(true); - $avatar = $this->createMock(IAvatar::class); $avatar->expects($this->once()) ->method('set') @@ -681,9 +665,6 @@ class UserTest extends \Test\TestCase { $this->config->expects($this->never()) ->method('setUserValue'); - $this->filesystemhelper->expects($this->never()) - ->method('isLoaded'); - $avatar = $this->createMock(IAvatar::class); $avatar->expects($this->never()) ->method('set'); @@ -739,10 +720,6 @@ class UserTest extends \Test\TestCase { $this->config->expects($this->never()) ->method('setUserValue'); - $this->filesystemhelper->expects($this->once()) - ->method('isLoaded') - ->willReturn(true); - $avatar = $this->createMock(IAvatar::class); $avatar->expects($this->once()) ->method('set') @@ -792,9 +769,6 @@ class UserTest extends \Test\TestCase { $this->config->expects($this->never()) ->method('setUserValue'); - $this->filesystemhelper->expects($this->never()) - ->method('isLoaded'); - $this->avatarManager->expects($this->never()) ->method('getAvatar'); @@ -917,7 +891,6 @@ class UserTest extends \Test\TestCase { $this->dn, $this->access, $this->config, - $this->filesystemhelper, $this->image, $this->logger, $this->avatarManager,