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\Crypto\Crypt;
|
||||||
use OCA\Encryption\KeyManager;
|
use OCA\Encryption\KeyManager;
|
||||||
use OCP\ILogger;
|
|
||||||
use OCP\IUserSession;
|
|
||||||
|
|
||||||
class Setup {
|
class Setup {
|
||||||
/**
|
/** @var Crypt */
|
||||||
* @var Crypt
|
|
||||||
*/
|
|
||||||
private $crypt;
|
private $crypt;
|
||||||
/**
|
/** @var KeyManager */
|
||||||
* @var KeyManager
|
|
||||||
*/
|
|
||||||
private $keyManager;
|
private $keyManager;
|
||||||
/**
|
|
||||||
* @var ILogger
|
|
||||||
*/
|
|
||||||
private $logger;
|
|
||||||
/**
|
|
||||||
* @var bool|string
|
|
||||||
*/
|
|
||||||
private $user;
|
|
||||||
|
|
||||||
|
public function __construct(Crypt $crypt,
|
||||||
/**
|
|
||||||
* @param ILogger $logger
|
|
||||||
* @param IUserSession $userSession
|
|
||||||
* @param Crypt $crypt
|
|
||||||
* @param KeyManager $keyManager
|
|
||||||
*/
|
|
||||||
public function __construct(ILogger $logger,
|
|
||||||
IUserSession $userSession,
|
|
||||||
Crypt $crypt,
|
|
||||||
KeyManager $keyManager) {
|
KeyManager $keyManager) {
|
||||||
$this->logger = $logger;
|
|
||||||
$this->user = $userSession && $userSession->isLoggedIn() ? $userSession->getUser()->getUID() : false;
|
|
||||||
$this->crypt = $crypt;
|
$this->crypt = $crypt;
|
||||||
$this->keyManager = $keyManager;
|
$this->keyManager = $keyManager;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@ namespace OCA\Encryption\Tests\Users;
|
||||||
use OCA\Encryption\Crypto\Crypt;
|
use OCA\Encryption\Crypto\Crypt;
|
||||||
use OCA\Encryption\KeyManager;
|
use OCA\Encryption\KeyManager;
|
||||||
use OCA\Encryption\Users\Setup;
|
use OCA\Encryption\Users\Setup;
|
||||||
use OCP\ILogger;
|
|
||||||
use OCP\IUserSession;
|
|
||||||
use Test\TestCase;
|
use Test\TestCase;
|
||||||
|
|
||||||
class SetupTest extends TestCase {
|
class SetupTest extends TestCase {
|
||||||
|
@ -50,10 +48,6 @@ class SetupTest extends TestCase {
|
||||||
|
|
||||||
protected function setUp(): void {
|
protected function setUp(): void {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$logMock = $this->createMock(ILogger::class);
|
|
||||||
$userSessionMock = $this->getMockBuilder(IUserSession::class)
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
$this->cryptMock = $this->getMockBuilder(Crypt::class)
|
$this->cryptMock = $this->getMockBuilder(Crypt::class)
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
@ -62,10 +56,7 @@ class SetupTest extends TestCase {
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
/** @var \OCP\ILogger $logMock */
|
$this->instance = new Setup(
|
||||||
/** @var \OCP\IUserSession $userSessionMock */
|
|
||||||
$this->instance = new Setup($logMock,
|
|
||||||
$userSessionMock,
|
|
||||||
$this->cryptMock,
|
$this->cryptMock,
|
||||||
$this->keyManagerMock);
|
$this->keyManagerMock);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue