aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/files
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-02-12 00:32:38 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2013-02-12 00:32:38 +0100
commit76b31f870cf78aa8882761d954554fecb92e6211 (patch)
tree9c89430fe00983e94cc8864a12cd05242741d4c3 /tests/lib/files
parent0c31c3cc3a928e8ca9272d32d68163c0700697ea (diff)
parentfb23ac3ce2e0b3f002f036e55e516b672f088dc0 (diff)
downloadnextcloud-server-76b31f870cf78aa8882761d954554fecb92e6211.tar.gz
nextcloud-server-76b31f870cf78aa8882761d954554fecb92e6211.zip
Merge branch 'master' into master-sqlserver
Diffstat (limited to 'tests/lib/files')
-rw-r--r--tests/lib/files/cache/updater.php2
-rw-r--r--tests/lib/files/filesystem.php2
-rw-r--r--tests/lib/files/storage/storage.php17
3 files changed, 15 insertions, 6 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/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/storage.php b/tests/lib/files/storage/storage.php
index 781c0f92c92..c74a16f509f 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -146,10 +146,19 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$localFolder = $this->instance->getLocalFolder('/folder');
$this->assertTrue(is_dir($localFolder));
- $this->assertTrue(file_exists($localFolder . '/lorem.txt'));
- $this->assertEquals(file_get_contents($localFolder . '/lorem.txt'), file_get_contents($textFile));
- $this->assertEquals(file_get_contents($localFolder . '/bar.txt'), 'asd');
- $this->assertEquals(file_get_contents($localFolder . '/recursive/file.txt'), 'foo');
+
+ // test below require to use instance->getLocalFile because the physical storage might be different
+ $localFile = $this->instance->getLocalFile('/folder/lorem.txt');
+ $this->assertTrue(file_exists($localFile));
+ $this->assertEquals(file_get_contents($localFile), file_get_contents($textFile));
+
+ $localFile = $this->instance->getLocalFile('/folder/bar.txt');
+ $this->assertTrue(file_exists($localFile));
+ $this->assertEquals(file_get_contents($localFile), 'asd');
+
+ $localFile = $this->instance->getLocalFile('/folder/recursive/file.txt');
+ $this->assertTrue(file_exists($localFile));
+ $this->assertEquals(file_get_contents($localFile), 'foo');
}
public function testStat() {