From e617cc913106d3b94b715690035696bd6b70a6a0 Mon Sep 17 00:00:00 2001 From: Swikriti Tripathi Date: Mon, 30 Oct 2023 16:49:51 +0545 Subject: [PATCH] fix tests and php stan Signed-off-by: Swikriti Tripathi --- lib/Service/OpenProjectAPIService.php | 17 +---------------- tests/lib/Service/OpenProjectAPIServiceTest.php | 12 ++---------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/lib/Service/OpenProjectAPIService.php b/lib/Service/OpenProjectAPIService.php index c6e0b176d..f87c5c0b6 100644 --- a/lib/Service/OpenProjectAPIService.php +++ b/lib/Service/OpenProjectAPIService.php @@ -30,7 +30,6 @@ use OCP\ICache; use OCP\ICacheFactory; use OCP\IGroupManager; -use OCP\IDBConnection; use OCP\IL10N; use OCP\IURLGenerator; use OCP\IUserManager; @@ -44,7 +43,6 @@ use GuzzleHttp\Exception\ServerException; use GuzzleHttp\Exception\ConnectException; use OCP\AppFramework\Http; -use OCP\Files\IMimeTypeLoader; use OC\Authentication\Events\AppPasswordCreatedEvent; use OC\Authentication\Token\IProvider; use OCP\EventDispatcher\IEventDispatcher; @@ -114,15 +112,6 @@ class OpenProjectAPIService { */ private ISubAdmin $subAdminManager; - /** - * @var IDBConnection - */ - private $dbConnection; - - /** - * @var IMimeTypeLoader - */ - private $mimeTypeLoader; /** * Service to make requests to OpenProject v3 (JSON) API */ @@ -144,12 +133,10 @@ public function __construct( IUserManager $userManager, IGroupManager $groupManager, IAppManager $appManager, - IDBConnection $dbConnection, IProvider $tokenProvider, ISecureRandom $random, IEventDispatcher $eventDispatcher, - ISubAdmin $subAdminManager, - IMimeTypeLoader $mimeTypeLoader + ISubAdmin $subAdminManager ) { $this->appName = $appName; $this->avatarManager = $avatarManager; @@ -163,9 +150,7 @@ public function __construct( $this->userManager = $userManager; $this->groupManager = $groupManager; $this->appManager = $appManager; - $this->dbConnection = $dbConnection; $this->subAdminManager = $subAdminManager; - $this->mimeTypeLoader = $mimeTypeLoader; $this->tokenProvider = $tokenProvider; $this->random = $random; $this->eventDispatcher = $eventDispatcher; diff --git a/tests/lib/Service/OpenProjectAPIServiceTest.php b/tests/lib/Service/OpenProjectAPIServiceTest.php index e8b091e95..c8ebc66f3 100644 --- a/tests/lib/Service/OpenProjectAPIServiceTest.php +++ b/tests/lib/Service/OpenProjectAPIServiceTest.php @@ -22,7 +22,6 @@ use OCA\OpenProject\Exception\OpenprojectErrorException; use OCA\OpenProject\Exception\OpenprojectResponseException; use OCP\App\IAppManager; -use OCP\Files\IMimeTypeLoader; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; @@ -32,7 +31,6 @@ use OCP\ICache; use OCP\ICacheFactory; use OCP\IConfig; -use OCP\IDBConnection; use OCP\IGroup; use OCP\IGroupManager; use OCP\IL10N; @@ -462,12 +460,10 @@ private function getOpenProjectAPIService( $this->createMock(IUserManager::class), $this->createMock(IGroupManager::class), $this->createMock(IAppManager::class), - $this->createMock(IDBConnection::class), $this->createMock(IProvider::class), $this->createMock(ISecureRandom::class), $this->createMock(IEventDispatcher::class), - $this->createMock(ISubAdmin::class), - $this->createMock(IMimeTypeLoader::class) + $this->createMock(ISubAdmin::class) ); } @@ -539,12 +535,10 @@ private function getServiceMock( $userManagerMock, $groupManagerMock, $appManagerMock, - $this->createMock(IDBConnection::class), $tokenProviderMock, $iSecureRandomMock, $this->createMock(IEventDispatcher::class), $subAdminManagerMock, - $this->createMock(IMimeTypeLoader::class) ]) ->onlyMethods($onlyMethods) ->getMock(); @@ -1663,12 +1657,10 @@ public function testRequestException( $this->createMock(IUserManager::class), $this->createMock(IGroupManager::class), $this->createMock(IAppManager::class), - $this->createMock(IDBConnection::class), $this->createMock(IProvider::class), $this->createMock(ISecureRandom::class), $this->createMock(IEventDispatcher::class), - $this->createMock(ISubAdmin::class), - $this->createMock(IMimeTypeLoader::class) + $this->createMock(ISubAdmin::class) ); $response = $service->request('', '', []);