mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
add test for updating etag with unchanged mtime in child folder
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
2cf9ed7ca5
commit
7aed19ac98
1 changed files with 25 additions and 0 deletions
|
|
@ -423,4 +423,29 @@ class ScannerTest extends TestCase {
|
|||
$newFolderEntry = $this->cache->get('folder');
|
||||
$this->assertNotEquals($newFolderEntry->getEtag(), $oldFolderEntry->getEtag());
|
||||
}
|
||||
|
||||
public function testNoETagUnscannedSubFolder() {
|
||||
$this->fillTestFolders();
|
||||
$this->storage->mkdir('folder/sub');
|
||||
|
||||
$this->scanner->scan('');
|
||||
|
||||
$oldFolderEntry1 = $this->cache->get('folder');
|
||||
$oldFolderEntry2 = $this->cache->get('folder/sub');
|
||||
// create a new file in a folder by keeping the mtime unchanged, but mark the folder as unscanned
|
||||
$this->storage->file_put_contents('folder/sub/new.txt', 'foo');
|
||||
$this->storage->touch('folder/sub', $oldFolderEntry1->getMTime());
|
||||
|
||||
// we only mark the direct parent as unscanned, which is the current "notify" behavior
|
||||
$this->cache->update($oldFolderEntry2->getId(), ['size' => -1]);
|
||||
|
||||
$this->scanner->scan('');
|
||||
|
||||
$this->cache->inCache('folder/new.txt');
|
||||
|
||||
$newFolderEntry1 = $this->cache->get('folder');
|
||||
$this->assertNotEquals($newFolderEntry1->getEtag(), $oldFolderEntry1->getEtag());
|
||||
$newFolderEntry2 = $this->cache->get('folder/sub');
|
||||
$this->assertNotEquals($newFolderEntry2->getEtag(), $oldFolderEntry2->getEtag());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue