diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-12 15:54:41 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-17 10:48:19 +0100 |
commit | 6625d5c88f74edade459ec7e2ee0bfb79f21fedd (patch) | |
tree | c615a82f5838b8ebded306c4c474751d2f2e782a /tests/lib/files/cache/watcher.php | |
parent | 289a27778e78bb69830b5b05f4084627a781157b (diff) | |
download | nextcloud-server-6625d5c88f74edade459ec7e2ee0bfb79f21fedd.tar.gz nextcloud-server-6625d5c88f74edade459ec7e2ee0bfb79f21fedd.zip |
Correctly restore previous root mount point after testing
Diffstat (limited to 'tests/lib/files/cache/watcher.php')
-rw-r--r-- | tests/lib/files/cache/watcher.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/lib/files/cache/watcher.php b/tests/lib/files/cache/watcher.php index 22c11b9a4e0..0b04b9e7058 100644 --- a/tests/lib/files/cache/watcher.php +++ b/tests/lib/files/cache/watcher.php @@ -15,16 +15,27 @@ class Watcher extends \PHPUnit_Framework_TestCase { */ private $storages = array(); - public function setUp() { + /** @var \OC\Files\Storage\Storage */ + private $originalStorage; + + protected function setUp() { + parent::setUp(); + + $this->originalStorage = \OC\Files\Filesystem::getStorage('/'); \OC\Files\Filesystem::clearMounts(); } - public function tearDown() { + protected function tearDown() { foreach ($this->storages as $storage) { $cache = $storage->getCache(); $ids = $cache->getAll(); $cache->clear(); } + + \OC\Files\Filesystem::clearMounts(); + \OC\Files\Filesystem::mount($this->originalStorage, array(), '/'); + + parent::tearDown(); } /** |