public function testReuseExistingRoot() {
$storage = new Temporary(array());
$mount = new Mount($storage, '');
+ Filesystem::getMountManager()->addMount($mount);
$cache = $storage->getCache();
$storage->mkdir('folder');
public function testReuseExistingFile() {
$storage = new Temporary(array());
$mount = new Mount($storage, '');
+ Filesystem::getMountManager()->addMount($mount);
$cache = $storage->getCache();
$storage->mkdir('folder');
$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']);
$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');