From: Andreas Fischer Date: Mon, 23 Sep 2013 10:44:11 +0000 (+0200) Subject: Merge remote-tracking branch 'owncloud/master' into fixing-4866-master X-Git-Tag: v6.0.0alpha2~146^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4a9f1cc74d7323b43983023c2b5b28e550e8c85d;p=nextcloud-server.git Merge remote-tracking branch 'owncloud/master' into fixing-4866-master * owncloud/master: (98 commits) [tx-robot] updated from transifex files: when filtering search results, ensure results are children of the fakeroot not just path starting the same setting a default on filecache column unencrypted_size [tx-robot] updated from transifex remove unneccessary lib in namespace namespaces use upcasefirst parts when _ is left in namespace and files are named after their classes the autoloader will also find classes in the lib folder of an app its magic! initialize variable calculate correct permissions while toggle the password protection make sure that both $permissions and $oldPermissions have the same type Add copyright, remove starting blank line update inherit docs comment Fix insert/update/delete helper functions for oracle Add missing return true statements to legacy preferences functions Add missing static Convert OC_Preference to object interface fix race condition in lazy preview loading use {count} instead of 'One' for more versatile translation fix double translation of error message use n to translate title fixing typos and l10n ... Conflicts: tests/lib/files/cache/scanner.php --- 4a9f1cc74d7323b43983023c2b5b28e550e8c85d diff --cc tests/lib/files/cache/scanner.php index b137799bbcf,4c90119814a..6956e7aa948 --- a/tests/lib/files/cache/scanner.php +++ b/tests/lib/files/cache/scanner.php @@@ -184,32 -184,16 +184,41 @@@ class Scanner extends \PHPUnit_Framewor $this->assertFalse($this->cache->inCache('folder/bar.txt')); } + public function testScanRemovedFile(){ + $this->fillTestFolders(); + + $this->scanner->scan(''); + $this->assertTrue($this->cache->inCache('folder/bar.txt')); + $this->storage->unlink('folder/bar.txt'); + $this->scanner->scanFile('folder/bar.txt'); + $this->assertFalse($this->cache->inCache('folder/bar.txt')); + } + + public function testETagRecreation() { + $this->fillTestFolders(); + + $this->scanner->scan('folder/bar.txt'); + + // manipulate etag to simulate an empty etag + $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_ETAG); + $data0 = $this->cache->get('folder/bar.txt'); + $data1 = $this->cache->get('folder'); + $data2 = $this->cache->get(''); + $data0['etag'] = ''; + $this->cache->put('folder/bar.txt', $data0); + + // rescan + $this->scanner->scan('folder/bar.txt', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_ETAG); + + // verify cache content + $newData0 = $this->cache->get('folder/bar.txt'); + $newData1 = $this->cache->get('folder'); + $newData2 = $this->cache->get(''); + $this->assertNotEmpty($newData0['etag']); + $this->assertNotEquals($data1['etag'], $newData1['etag']); + $this->assertNotEquals($data2['etag'], $newData2['etag']); - + } + function setUp() { $this->storage = new \OC\Files\Storage\Temporary(array()); $this->scanner = new \OC\Files\Cache\Scanner($this->storage);