I love unit tests that mock unnecessary stuff

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-12-04 15:22:02 +01:00
parent dd53fad898
commit 6004f62085
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 9 additions and 0 deletions

View File

@ -95,6 +95,15 @@ class FileCacheTest extends TestCache {
\OC_User::setUserId($this->user);
\OC::$server->getConfig()->setSystemValue('cachedirectory', $this->datadir);
if ($this->instance) {
$this->instance->clear();
$this->instance = null;
}
//tear down the users dir aswell
$user = \OC::$server->getUserManager()->get('test');
$user->delete();
// Restore the original mount point
\OC\Files\Filesystem::clearMounts();
\OC\Files\Filesystem::mount($this->storage, array(), '/');