From 6004f6208531f9ff7e39799db39209d5a445555d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 4 Dec 2019 15:22:02 +0100 Subject: [PATCH] I love unit tests that mock unnecessary stuff Signed-off-by: Joas Schilling --- tests/lib/Cache/FileCacheTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/lib/Cache/FileCacheTest.php b/tests/lib/Cache/FileCacheTest.php index 26306458d8..450bdf607b 100644 --- a/tests/lib/Cache/FileCacheTest.php +++ b/tests/lib/Cache/FileCacheTest.php @@ -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(), '/');