aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-11-16 17:15:21 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-01-15 13:29:45 +0100
commite9ed7e7f9efa774a60bf0c1e71eb9878c55444b9 (patch)
treedd19caf5a4c49dc7f43fbe444459eb54c9dba5fa
parent265f6dc1367915a19e195c035ef0e5e87f7308de (diff)
downloadnextcloud-server-e9ed7e7f9efa774a60bf0c1e71eb9878c55444b9.tar.gz
nextcloud-server-e9ed7e7f9efa774a60bf0c1e71eb9878c55444b9.zip
Remove unused properties from CheckSetupControllerTest
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r--apps/settings/lib/Controller/CheckSetupController.php23
-rw-r--r--apps/settings/tests/Controller/CheckSetupControllerTest.php32
2 files changed, 1 insertions, 54 deletions
diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php
index 0cb8c50d387..b251adb0d84 100644
--- a/apps/settings/lib/Controller/CheckSetupController.php
+++ b/apps/settings/lib/Controller/CheckSetupController.php
@@ -47,25 +47,20 @@ namespace OCA\Settings\Controller;
use DirectoryIterator;
use GuzzleHttp\Exception\ClientException;
-use OC;
use OC\AppFramework\Http;
use OC\IntegrityCheck\Checker;
-use OCP\App\IAppManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI;
use OCP\AppFramework\Http\DataDisplayResponse;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\RedirectResponse;
-use OCP\EventDispatcher\IEventDispatcher;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\IDateTimeFormatter;
use OCP\IL10N;
use OCP\IRequest;
-use OCP\IServerContainer;
use OCP\ITempManager;
use OCP\IURLGenerator;
-use OCP\Lock\ILockingProvider;
use OCP\Notification\IManager;
use OCP\SetupCheck\ISetupCheckManager;
use Psr\Log\LoggerInterface;
@@ -84,20 +79,12 @@ class CheckSetupController extends Controller {
private $checker;
/** @var LoggerInterface */
private $logger;
- /** @var IEventDispatcher */
- private $dispatcher;
- /** @var ILockingProvider */
- private $lockingProvider;
/** @var IDateTimeFormatter */
private $dateTimeFormatter;
/** @var ITempManager */
private $tempManager;
/** @var IManager */
private $manager;
- /** @var IAppManager */
- private $appManager;
- /** @var IServerContainer */
- private $serverContainer;
private ISetupCheckManager $setupCheckManager;
public function __construct($AppName,
@@ -108,13 +95,9 @@ class CheckSetupController extends Controller {
IL10N $l10n,
Checker $checker,
LoggerInterface $logger,
- IEventDispatcher $dispatcher,
- ILockingProvider $lockingProvider,
IDateTimeFormatter $dateTimeFormatter,
ITempManager $tempManager,
IManager $manager,
- IAppManager $appManager,
- IServerContainer $serverContainer,
ISetupCheckManager $setupCheckManager,
) {
parent::__construct($AppName, $request);
@@ -124,13 +107,9 @@ class CheckSetupController extends Controller {
$this->l10n = $l10n;
$this->checker = $checker;
$this->logger = $logger;
- $this->dispatcher = $dispatcher;
- $this->lockingProvider = $lockingProvider;
$this->dateTimeFormatter = $dateTimeFormatter;
$this->tempManager = $tempManager;
$this->manager = $manager;
- $this->appManager = $appManager;
- $this->serverContainer = $serverContainer;
$this->setupCheckManager = $setupCheckManager;
}
@@ -374,7 +353,7 @@ Raw output
$currentUser = posix_getuid();
$appDirsWithDifferentOwner = [[]];
- foreach (OC::$APPSROOTS as $appRoot) {
+ foreach (\OC::$APPSROOTS as $appRoot) {
if ($appRoot['writable'] === true) {
$appDirsWithDifferentOwner[] = $this->getAppDirsWithDifferentOwnerForAppRoot($currentUser, $appRoot);
}
diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php
index d732b615a0e..b9c2ddc8282 100644
--- a/apps/settings/tests/Controller/CheckSetupControllerTest.php
+++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php
@@ -37,21 +37,17 @@ namespace OCA\Settings\Tests\Controller;
use OC;
use OC\IntegrityCheck\Checker;
use OCA\Settings\Controller\CheckSetupController;
-use OCP\App\IAppManager;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataDisplayResponse;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\RedirectResponse;
-use OCP\EventDispatcher\IEventDispatcher;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
use OCP\IDateTimeFormatter;
use OCP\IL10N;
use OCP\IRequest;
-use OCP\IServerContainer;
use OCP\ITempManager;
use OCP\IURLGenerator;
-use OCP\Lock\ILockingProvider;
use OCP\Notification\IManager;
use OCP\SetupCheck\ISetupCheckManager;
use PHPUnit\Framework\MockObject\MockObject;
@@ -82,20 +78,12 @@ class CheckSetupControllerTest extends TestCase {
private $logger;
/** @var Checker|\PHPUnit\Framework\MockObject\MockObject */
private $checker;
- /** @var IEventDispatcher|\PHPUnit\Framework\MockObject\MockObject */
- private $dispatcher;
- /** @var ILockingProvider|\PHPUnit\Framework\MockObject\MockObject */
- private $lockingProvider;
/** @var IDateTimeFormatter|\PHPUnit\Framework\MockObject\MockObject */
private $dateTimeFormatter;
/** @var ITempManager|\PHPUnit\Framework\MockObject\MockObject */
private $tempManager;
/** @var IManager|\PHPUnit\Framework\MockObject\MockObject */
private $notificationManager;
- /** @var IAppManager|MockObject */
- private $appManager;
- /** @var IServerContainer|MockObject */
- private $serverContainer;
/** @var ISetupCheckManager|MockObject */
private $setupCheckManager;
@@ -124,16 +112,12 @@ class CheckSetupControllerTest extends TestCase {
->willReturnCallback(function ($message, array $replace) {
return vsprintf($message, $replace);
});
- $this->dispatcher = $this->createMock(IEventDispatcher::class);
$this->checker = $this->getMockBuilder('\OC\IntegrityCheck\Checker')
->disableOriginalConstructor()->getMock();
$this->logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
- $this->lockingProvider = $this->getMockBuilder(ILockingProvider::class)->getMock();
$this->dateTimeFormatter = $this->getMockBuilder(IDateTimeFormatter::class)->getMock();
$this->tempManager = $this->getMockBuilder(ITempManager::class)->getMock();
$this->notificationManager = $this->getMockBuilder(IManager::class)->getMock();
- $this->appManager = $this->createMock(IAppManager::class);
- $this->serverContainer = $this->createMock(IServerContainer::class);
$this->setupCheckManager = $this->createMock(ISetupCheckManager::class);
$this->checkSetupController = $this->getMockBuilder(CheckSetupController::class)
->setConstructorArgs([
@@ -145,13 +129,9 @@ class CheckSetupControllerTest extends TestCase {
$this->l10n,
$this->checker,
$this->logger,
- $this->dispatcher,
- $this->lockingProvider,
$this->dateTimeFormatter,
$this->tempManager,
$this->notificationManager,
- $this->appManager,
- $this->serverContainer,
$this->setupCheckManager,
])
->setMethods([
@@ -316,13 +296,9 @@ class CheckSetupControllerTest extends TestCase {
$this->l10n,
$this->checker,
$this->logger,
- $this->dispatcher,
- $this->lockingProvider,
$this->dateTimeFormatter,
$this->tempManager,
$this->notificationManager,
- $this->appManager,
- $this->serverContainer,
$this->setupCheckManager,
])
->setMethods(null)->getMock();
@@ -1039,13 +1015,9 @@ Array
$this->l10n,
$this->checker,
$this->logger,
- $this->dispatcher,
- $this->lockingProvider,
$this->dateTimeFormatter,
$this->tempManager,
$this->notificationManager,
- $this->appManager,
- $this->serverContainer,
$this->setupCheckManager,
);
@@ -1089,13 +1061,9 @@ Array
$this->l10n,
$this->checker,
$this->logger,
- $this->dispatcher,
- $this->lockingProvider,
$this->dateTimeFormatter,
$this->tempManager,
$this->notificationManager,
- $this->appManager,
- $this->serverContainer,
$this->setupCheckManager,
);