Skip to content

Commit

Permalink
Remove unused properties from CheckSetupControllerTest
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Nov 16, 2023
1 parent 3cb2d13 commit 7ee93fb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
21 changes: 0 additions & 21 deletions apps/settings/lib/Controller/CheckSetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,20 @@

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;
Expand All @@ -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,
Expand All @@ -108,13 +95,9 @@ public function __construct($AppName,
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);
Expand All @@ -124,13 +107,9 @@ public function __construct($AppName,
$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;
}

Expand Down
32 changes: 0 additions & 32 deletions apps/settings/tests/Controller/CheckSetupControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,17 @@
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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -124,16 +112,12 @@ protected function setUp(): void {
->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([
Expand All @@ -145,13 +129,9 @@ protected function setUp(): void {
$this->l10n,
$this->checker,
$this->logger,
$this->dispatcher,
$this->lockingProvider,
$this->dateTimeFormatter,
$this->tempManager,
$this->notificationManager,
$this->appManager,
$this->serverContainer,
$this->setupCheckManager,
])
->setMethods([
Expand Down Expand Up @@ -322,13 +302,9 @@ public function testGetCurlVersion() {
$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();
Expand Down Expand Up @@ -1045,13 +1021,9 @@ public function testIsMysqlUsedWithoutUTF8MB4(string $db, bool $useUTF8MB4, bool
$this->l10n,
$this->checker,
$this->logger,
$this->dispatcher,
$this->lockingProvider,
$this->dateTimeFormatter,
$this->tempManager,
$this->notificationManager,
$this->appManager,
$this->serverContainer,
$this->setupCheckManager,
);

Expand Down Expand Up @@ -1095,13 +1067,9 @@ public function testIsEnoughTempSpaceAvailableIfS3PrimaryStorageIsUsed(string $m
$this->l10n,
$this->checker,
$this->logger,
$this->dispatcher,
$this->lockingProvider,
$this->dateTimeFormatter,
$this->tempManager,
$this->notificationManager,
$this->appManager,
$this->serverContainer,
$this->setupCheckManager,
);

Expand Down

0 comments on commit 7ee93fb

Please sign in to comment.