aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/files/cache/updater.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-11-12 15:54:41 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-11-17 10:48:19 +0100
commit6625d5c88f74edade459ec7e2ee0bfb79f21fedd (patch)
treec615a82f5838b8ebded306c4c474751d2f2e782a /tests/lib/files/cache/updater.php
parent289a27778e78bb69830b5b05f4084627a781157b (diff)
downloadnextcloud-server-6625d5c88f74edade459ec7e2ee0bfb79f21fedd.tar.gz
nextcloud-server-6625d5c88f74edade459ec7e2ee0bfb79f21fedd.zip
Correctly restore previous root mount point after testing
Diffstat (limited to 'tests/lib/files/cache/updater.php')
-rw-r--r--tests/lib/files/cache/updater.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php
index 96b4207ad43..9e7330db20c 100644
--- a/tests/lib/files/cache/updater.php
+++ b/tests/lib/files/cache/updater.php
@@ -33,7 +33,13 @@ class Updater extends \PHPUnit_Framework_TestCase {
*/
protected $updater;
- public function setUp() {
+ /** @var \OC\Files\Storage\Storage */
+ private $originalStorage;
+
+ protected function setUp() {
+ parent::setUp();
+
+ $this->originalStorage = Filesystem::getStorage('/');
$this->storage = new Temporary(array());
Filesystem::clearMounts();
Filesystem::mount($this->storage, array(), '/');
@@ -42,6 +48,13 @@ class Updater extends \PHPUnit_Framework_TestCase {
$this->cache = $this->storage->getCache();
}
+ protected function tearDown() {
+ Filesystem::clearMounts();
+ Filesystem::mount($this->originalStorage, array(), '/');
+
+ parent::tearDown();
+ }
+
public function testNewFile() {
$this->storage->file_put_contents('foo.txt', 'bar');
$this->assertFalse($this->cache->inCache('foo.txt'));