aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib')
-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() {