summaryrefslogtreecommitdiffstats
path: root/lib/private/files/objectstore
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-06-13 15:05:54 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-06-18 12:53:20 +0200
commit7493ff062410093eca753780b7d226c63427d274 (patch)
treef3a13e1cf447517446cf724fbdb3fd5fa4d2132e /lib/private/files/objectstore
parentc18836c8ae42d5a334baea228b7e792098a02089 (diff)
downloadnextcloud-server-7493ff062410093eca753780b7d226c63427d274.tar.gz
nextcloud-server-7493ff062410093eca753780b7d226c63427d274.zip
fix unit test by always initializing the root of the storage in the constructor
Diffstat (limited to 'lib/private/files/objectstore')
-rw-r--r--lib/private/files/objectstore/abstractobjectstore.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/private/files/objectstore/abstractobjectstore.php b/lib/private/files/objectstore/abstractobjectstore.php
index 3f67ad9a494..db4c398018e 100644
--- a/lib/private/files/objectstore/abstractobjectstore.php
+++ b/lib/private/files/objectstore/abstractobjectstore.php
@@ -57,6 +57,18 @@ abstract class AbstractObjectStore extends \OC\Files\Storage\Common {
*/
private static $tmpFiles = array();
+ public function __construct($params) {
+ if (isset($params['user']) && is_object($params['user'])) {
+ $this->user = $params['user'];
+ } else {
+ $this->user = null;
+ }
+ //initialize cache with root directory in cache
+ if ( ! $this->is_dir('/') ) {
+ $this->mkdir('/');
+ }
+ }
+
/**
* @param string $path
* @return \OC\Files\Cache\Cache
@@ -125,14 +137,6 @@ abstract class AbstractObjectStore extends \OC\Files\Storage\Common {
return 'objstore::root';
}
- public function __construct($params) {
- if (isset($params['user']) && is_object($params['user'])) {
- $this->user = $params['user'];
- } else {
- $this->user = null;
- }
- }
-
public function mkdir($path) {
$path = $this->normalizePath($path);