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/updater.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/updater.php')
-rw-r--r-- | tests/lib/files/cache/updater.php | 15 |
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')); |