Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix tests and php stan
Signed-off-by: Swikriti Tripathi <[email protected]>
  • Loading branch information
SwikritiT committed Oct 31, 2023
commit e617cc913106d3b94b715690035696bd6b70a6a0
17 changes: 1 addition & 16 deletions lib/Service/OpenProjectAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
*/
Expand All @@ -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;
Expand All @@ -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;
Expand Down
12 changes: 2 additions & 10 deletions tests/lib/Service/OpenProjectAPIServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)
);
}

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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('', '', []);
Expand Down