Skip to content

Commit

Permalink
Register encryption storage wrapper in trashbin storage test
Browse files Browse the repository at this point in the history
Because the encryption wrapper does some twisted stuff with methods like
moveFromStorage, we need to apply it here to make sure the behavior is
close to reality.
  • Loading branch information
Vincent Petry committed Feb 21, 2017
1 parent 5d70aa8 commit 641d3dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/files_trashbin/tests/StorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ protected function setUp() {
\OC_Hook::clear();
\OCA\Files_Trashbin\Trashbin::registerHooks();

// the encryption wrapper does some twisted stuff with moveFromStorage...
// we need to register it here so that the tested behavior is closer to reality
\OC::$server->getEncryptionManager()->setupStorage();

$this->user = $this->getUniqueId('user');
\OC::$server->getUserManager()->createUser($this->user, $this->user);


// this will setup the FS
$this->loginAsUser($this->user);

Expand All @@ -82,6 +87,7 @@ protected function tearDown() {
$user = \OC::$server->getUserManager()->get($this->user);
if ($user !== null) { $user->delete(); }
\OC_Hook::clear();
\OC\Files\Filesystem::getLoader()->removeStorageWrapper('oc_encryption');
parent::tearDown();
}

Expand Down

0 comments on commit 641d3dc

Please sign in to comment.