Remove unused dependencies in encryption app setup
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
032de4f333
commit
c832e6180b
|
@ -29,40 +29,15 @@ namespace OCA\Encryption\Users;
|
|||
|
||||
use OCA\Encryption\Crypto\Crypt;
|
||||
use OCA\Encryption\KeyManager;
|
||||
use OCP\ILogger;
|
||||
use OCP\IUserSession;
|
||||
|
||||
class Setup {
|
||||
/**
|
||||
* @var Crypt
|
||||
*/
|
||||
/** @var Crypt */
|
||||
private $crypt;
|
||||
/**
|
||||
* @var KeyManager
|
||||
*/
|
||||
/** @var KeyManager */
|
||||
private $keyManager;
|
||||
/**
|
||||
* @var ILogger
|
||||
*/
|
||||
private $logger;
|
||||
/**
|
||||
* @var bool|string
|
||||
*/
|
||||
private $user;
|
||||
|
||||
|
||||
/**
|
||||
* @param ILogger $logger
|
||||
* @param IUserSession $userSession
|
||||
* @param Crypt $crypt
|
||||
* @param KeyManager $keyManager
|
||||
*/
|
||||
public function __construct(ILogger $logger,
|
||||
IUserSession $userSession,
|
||||
Crypt $crypt,
|
||||
public function __construct(Crypt $crypt,
|
||||
KeyManager $keyManager) {
|
||||
$this->logger = $logger;
|
||||
$this->user = $userSession && $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
|
||||
$this->crypt = $crypt;
|
||||
$this->keyManager = $keyManager;
|
||||
}
|
||||
|
|
|
@ -30,8 +30,6 @@ namespace OCA\Encryption\Tests\Users;
|
|||
use OCA\Encryption\Crypto\Crypt;
|
||||
use OCA\Encryption\KeyManager;
|
||||
use OCA\Encryption\Users\Setup;
|
||||
use OCP\ILogger;
|
||||
use OCP\IUserSession;
|
||||
use Test\TestCase;
|
||||
|
||||
class SetupTest extends TestCase {
|
||||
|
@ -50,10 +48,6 @@ class SetupTest extends TestCase {
|
|||
|
||||
protected function setUp(): void {
|
||||
parent::setUp();
|
||||
$logMock = $this->createMock(ILogger::class);
|
||||
$userSessionMock = $this->getMockBuilder(IUserSession::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$this->cryptMock = $this->getMockBuilder(Crypt::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
@ -62,10 +56,7 @@ class SetupTest extends TestCase {
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
/** @var \OCP\ILogger $logMock */
|
||||
/** @var \OCP\IUserSession $userSessionMock */
|
||||
$this->instance = new Setup($logMock,
|
||||
$userSessionMock,
|
||||
$this->instance = new Setup(
|
||||
$this->cryptMock,
|
||||
$this->keyManagerMock);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue