summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-02-15 21:04:48 +0100
committerRobin Appelman <icewind@owncloud.com>2013-02-15 21:04:48 +0100
commit2ed850e05b46d820528813c2f2415dad60c1c570 (patch)
treea46c29c4fd7c01f71261499c7a33996a23830fc5 /tests
parent9738fae3cf1ad18593d21eb62e138e00c01f5f36 (diff)
parent425d41aaf93e1cd3a44ddc794414683e8e2c4648 (diff)
downloadnextcloud-server-2ed850e05b46d820528813c2f2415dad60c1c570.tar.gz
nextcloud-server-2ed850e05b46d820528813c2f2415dad60c1c570.zip
merge master into filecache_mtime
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/updater.php2
-rw-r--r--tests/lib/files/cache/watcher.php1
-rw-r--r--tests/lib/files/filesystem.php2
-rw-r--r--tests/lib/files/storage/mappedlocal.php40
4 files changed, 42 insertions, 3 deletions
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php
index b83dd0c26e5..7a79f45a203 100644
--- a/tests/lib/files/cache/updater.php
+++ b/tests/lib/files/cache/updater.php
@@ -45,7 +45,7 @@ class Updater extends \PHPUnit_Framework_TestCase {
if (!self::$user) {
if (!\OC\Files\Filesystem::getView()) {
self::$user = uniqid();
- \OC\Files\Filesystem::init('/' . self::$user . '/files');
+ \OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files');
} else {
self::$user = \OC_User::getUser();
}
diff --git a/tests/lib/files/cache/watcher.php b/tests/lib/files/cache/watcher.php
index 1ea0c2eb47a..e43c86ed438 100644
--- a/tests/lib/files/cache/watcher.php
+++ b/tests/lib/files/cache/watcher.php
@@ -76,7 +76,6 @@ class Watcher extends \PHPUnit_Framework_TestCase {
$updater->checkUpdate('');
$entry = $cache->get('foo.txt');
- $this->assertEquals(-1, $entry['size']);
$this->assertEquals('httpd/unix-directory', $entry['mimetype']);
$this->assertFalse($cache->inCache('folder'));
$this->assertFalse($cache->inCache('folder/bar.txt'));
diff --git a/tests/lib/files/filesystem.php b/tests/lib/files/filesystem.php
index fd116af2d2e..6ce45e6178a 100644
--- a/tests/lib/files/filesystem.php
+++ b/tests/lib/files/filesystem.php
@@ -82,7 +82,7 @@ class Filesystem extends \PHPUnit_Framework_TestCase {
$user = \OC_User::getUser();
}else{
$user=uniqid();
- \OC\Files\Filesystem::init('/'.$user.'/files');
+ \OC\Files\Filesystem::init($user, '/'.$user.'/files');
}
\OC_Hook::clear('OC_Filesystem');
\OC_Hook::connect('OC_Filesystem', 'post_write', $this, 'dummyHook');
diff --git a/tests/lib/files/storage/mappedlocal.php b/tests/lib/files/storage/mappedlocal.php
new file mode 100644
index 00000000000..b483f3a1954
--- /dev/null
+++ b/tests/lib/files/storage/mappedlocal.php
@@ -0,0 +1,40 @@
+<?php
+/**
+* ownCloud
+*
+* @author Robin Appelman
+* @copyright 2012 Robin Appelman icewind@owncloud.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Affero General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+namespace Test\Files\Storage;
+
+class MappedLocal extends Storage {
+ /**
+ * @var string tmpDir
+ */
+ private $tmpDir;
+ public function setUp() {
+ $this->tmpDir=\OC_Helper::tmpFolder();
+ $this->instance=new \OC\Files\Storage\MappedLocal(array('datadir'=>$this->tmpDir));
+ }
+
+ public function tearDown() {
+ \OC_Helper::rmdirr($this->tmpDir);
+ unset($this->instance);
+ }
+}
+