diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index 8c8e80c1be4bb7ebabcdec847fb11aa9b0953ab1..09732e67ac618d2e2c1dd11bee8e47f2814b9ccf 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -311,6 +311,7 @@ class Filesystem { */ static public function tearDown() { self::clearMounts(); + self::$defaultInstance = null; } /** diff --git a/lib/files/mount.php b/lib/files/mount.php index 59c98e9dcc8e651ca8b874408f6bd338a25bac27..0030d0ee7a637fc3607103d3ca719b58d669450c 100644 --- a/lib/files/mount.php +++ b/lib/files/mount.php @@ -136,6 +136,7 @@ class Mount { * @return Mount */ public static function find($path) { + \OC_Util::setupFS(); $path = self::formatPath($path); if (isset(self::$mounts[$path])) { return self::$mounts[$path]; @@ -163,6 +164,7 @@ class Mount { * @return Mount[] */ public static function findIn($path) { + \OC_Util::setupFS(); $path = self::formatPath($path); $result = array(); $pathLength = strlen($path); @@ -186,6 +188,7 @@ class Mount { * @return Mount[] */ public static function findByStorageId($id) { + \OC_Util::setupFS(); if (strlen($id) > 64) { $id = md5($id); } diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php index aaf932c97feb88a086d4545e7c7b4bd44d348c70..dad3cd7e6503cf671375fd1049bc8b7cc3e3f9fa 100644 --- a/tests/lib/files/cache/updater.php +++ b/tests/lib/files/cache/updater.php @@ -42,14 +42,11 @@ class Updater extends \PHPUnit_Framework_TestCase { $this->scanner->scan(''); $this->cache = $this->storage->getCache(); + \OC\Files\Filesystem::tearDown(); if (!self::$user) { - if (!\OC\Files\Filesystem::getView()) { - self::$user = uniqid(); - \OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files'); - } else { - self::$user = \OC_User::getUser(); - } + self::$user = uniqid(); } + \OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files'); Filesystem::clearMounts(); Filesystem::mount($this->storage, array(), '/' . self::$user . '/files');