aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/files/filesystem.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/filesystem.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/filesystem.php')
-rw-r--r--tests/lib/files/filesystem.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/tests/lib/files/filesystem.php b/tests/lib/files/filesystem.php
index 930a252bcb2..88e98fbb8c6 100644
--- a/tests/lib/files/filesystem.php
+++ b/tests/lib/files/filesystem.php
@@ -22,12 +22,15 @@
namespace Test\Files;
-class Filesystem extends \PHPUnit_Framework_TestCase {
+class Filesystem extends \Test\TestCase {
/**
* @var array tmpDirs
*/
private $tmpDirs = array();
+ /** @var \OC\Files\Storage\Storage */
+ private $originalStorage;
+
/**
* @return array
*/
@@ -37,19 +40,23 @@ class Filesystem extends \PHPUnit_Framework_TestCase {
return array('datadir' => $dir);
}
- public function tearDown() {
+ protected function setUp() {
+ parent::setUp();
+
+ $this->originalStorage = \OC\Files\Filesystem::getStorage('/');
+ \OC_User::setUserId('');
+ \OC\Files\Filesystem::clearMounts();
+ }
+
+ protected function tearDown() {
foreach ($this->tmpDirs as $dir) {
\OC_Helper::rmdirr($dir);
}
\OC\Files\Filesystem::clearMounts();
+ \OC\Files\Filesystem::mount($this->originalStorage, array(), '/');
\OC_User::setUserId('');
}
- public function setUp() {
- \OC_User::setUserId('');
- \OC\Files\Filesystem::clearMounts();
- }
-
public function testMount() {
\OC\Files\Filesystem::mount('\OC\Files\Storage\Local', self::getStorageData(), '/');
$this->assertEquals('/', \OC\Files\Filesystem::getMountPoint('/'));