Skip to content

Commit

Permalink
Fix FixEncryptedVersionTest
Browse files Browse the repository at this point in the history
Adjust expected parameters

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
  • Loading branch information
PVince81 committed Jun 24, 2021
1 parent fa282a3 commit d8bb916
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions apps/encryption/tests/Command/FixEncryptedVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ public static function setUpBeforeClass(): void {
\OC::$server->getConfig()->setAppValue('core', 'encryption_enabled', 'yes');
//Enable Masterkey
\OC::$server->getConfig()->setAppValue('encryption', 'useMasterKey', '1');
$crypt = new Crypt(\OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getL10N('encryption'));
$crypt = new Crypt(
\OC::$server->getLogger(),
\OC::$server->getUserSession(),
\OC::$server->getConfig(),
\OC::$server->getL10N('encryption')
);
$encryptionSession = new Session(\OC::$server->getSession());
$view = new View("/");
$encryptionUtil = new Util($view, $crypt, \OC::$server->getLogger(), \OC::$server->getUserSession(), \OC::$server->getConfig(), \OC::$server->getUserManager());
Expand All @@ -75,11 +80,19 @@ public static function setUpBeforeClass(): void {
\OC::$server->getUserSession(),
$encryptionSession,
\OC::$server->getLogger(),
$encryptionUtil
$encryptionUtil,
\OC::$server->getLockingProvider(),
);
$userSetup = new Setup(
$crypt,
$keyManager
);
$userSetup = new Setup(\OC::$server->getLogger(), \OC::$server->getUserSession(), $crypt, $keyManager);
$userSetup->setupSystem();
\OC::$server->getUserManager()->createUser(self::TEST_ENCRYPTION_VERSION_AFFECTED_USER, 'foo');
\OC::$server->getUserManager()->createUser(self::TEST_ENCRYPTION_VERSION_AFFECTED_USER, 'foo12345678');

// login to create home directory
$this->loginsUser(self::TEST_ENCRYPTION_VERSION_AFFECTED_USER);
$this->logout();
}

public static function tearDownAfterClass(): void {
Expand All @@ -100,7 +113,13 @@ public function setUp(): void {
$this->rootFolder = \OC::$server->getRootFolder();
$this->userManager = \OC::$server->getUserManager();
$this->view = new View("/");
$this->fixEncryptedVersion = new FixEncryptedVersion($this->rootFolder, $this->userManager, $this->view);
$this->fixEncryptedVersion = new FixEncryptedVersion(
\OC::$server->getConfig(),
\OC::$server->getLogger(),
$this->rootFolder,
$this->userManager,
$this->view
);
$this->commandTester = new CommandTester($this->fixEncryptedVersion);
}

Expand Down

0 comments on commit d8bb916

Please sign in to comment.