fix cache behaviour for non existing files
This commit is contained in:
parent
317cd4c70a
commit
8635699db9
|
@ -691,6 +691,7 @@ class View {
|
|||
|
||||
$data = $cache->get($internalPath);
|
||||
|
||||
if ($data) {
|
||||
if ($data['mimetype'] === 'httpd/unix-directory') {
|
||||
//add the sizes of other mountpoints to the folder
|
||||
$mountPoints = Filesystem::getMountPoints($path);
|
||||
|
@ -706,6 +707,7 @@ class View {
|
|||
$permissionsCache = $storage->getPermissionsCache();
|
||||
$data['permissions'] = $permissionsCache->get($data['fileid'], \OC_User::getUser());
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
|
@ -192,6 +192,11 @@ class Cache extends \UnitTestCase {
|
|||
$this->assertEquals($file3, $this->cache->getIncomplete());
|
||||
}
|
||||
|
||||
function testNonExisting() {
|
||||
$this->assertFalse($this->cache->get('foo.txt'));
|
||||
$this->assertEquals(array(), $this->cache->getFolderContents('foo'));
|
||||
}
|
||||
|
||||
public function tearDown() {
|
||||
$this->cache->clear();
|
||||
}
|
||||
|
|
|
@ -92,6 +92,9 @@ class View extends \PHPUnit_Framework_TestCase {
|
|||
$cachedData = $rootView->getFileInfo('/foo.txt');
|
||||
$this->assertTrue($cachedData['encrypted']);
|
||||
$this->assertEquals($cachedData['fileid'], $id);
|
||||
|
||||
$this->assertFalse($rootView->getFileInfo('/non/existing'));
|
||||
$this->assertEquals(array(), $rootView->getDirectoryContent('/non/existing'));
|
||||
}
|
||||
|
||||
public function testAutoScan() {
|
||||
|
|
Loading…
Reference in New Issue