Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-06-03 13:34:48 +0400
committerRobin Appelman <icewind@owncloud.com>2014-06-10 18:24:00 +0400
commit4d7e1c568c9b68194ac36339537a1910c586222a (patch)
treea1d93bf09957d5b5c00770e56a1f596408958e92 /tests
parentf36e354a42b027c586f445efcc1b567a5970a409 (diff)
Fix unit tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/utils/scanner.php2
-rw-r--r--tests/lib/files/view.php14
2 files changed, 11 insertions, 5 deletions
diff --git a/tests/lib/files/utils/scanner.php b/tests/lib/files/utils/scanner.php
index 4610e2b4d46..267fc63302d 100644
--- a/tests/lib/files/utils/scanner.php
+++ b/tests/lib/files/utils/scanner.php
@@ -42,6 +42,7 @@ class Scanner extends \PHPUnit_Framework_TestCase {
public function testReuseExistingRoot() {
$storage = new Temporary(array());
$mount = new Mount($storage, '');
+ Filesystem::getMountManager()->addMount($mount);
$cache = $storage->getCache();
$storage->mkdir('folder');
@@ -63,6 +64,7 @@ class Scanner extends \PHPUnit_Framework_TestCase {
public function testReuseExistingFile() {
$storage = new Temporary(array());
$mount = new Mount($storage, '');
+ Filesystem::getMountManager()->addMount($mount);
$cache = $storage->getCache();
$storage->mkdir('folder');
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index c26c6f29fc0..cdaec855452 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -49,14 +49,18 @@ class View extends \PHPUnit_Framework_TestCase {
$storage1 = $this->getTestStorage();
$storage2 = $this->getTestStorage();
$storage3 = $this->getTestStorage();
- \OC\Files\Filesystem::mount($storage1, array(), '/');
- \OC\Files\Filesystem::mount($storage2, array(), '/substorage');
- \OC\Files\Filesystem::mount($storage3, array(), '/folder/anotherstorage');
+ $root = '/' . uniqid();
+ \OC\Files\Filesystem::mount($storage1, array(), $root . '/');
+ \OC\Files\Filesystem::mount($storage2, array(), $root . '/substorage');
+ \OC\Files\Filesystem::mount($storage3, array(), $root . '/folder/anotherstorage');
$textSize = strlen("dummy file data\n");
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
$storageSize = $textSize * 2 + $imageSize;
- $rootView = new \OC\Files\View('');
+ $storageInfo = $storage3->getCache()->get('');
+ $this->assertEquals($storageSize, $storageInfo['size']);
+
+ $rootView = new \OC\Files\View($root);
$cachedData = $rootView->getFileInfo('/foo.txt');
$this->assertEquals($textSize, $cachedData['size']);
@@ -107,7 +111,7 @@ class View extends \PHPUnit_Framework_TestCase {
$this->assertEquals('foo.png', $folderData[1]['name']);
$this->assertEquals('foo.txt', $folderData[2]['name']);
- $folderView = new \OC\Files\View('/folder');
+ $folderView = new \OC\Files\View($root . '/folder');
$this->assertEquals($rootView->getFileInfo('/folder'), $folderView->getFileInfo('/'));
$cachedData = $rootView->getFileInfo('/foo.txt');