mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
add test for updating etag with unchanged mtime
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
e14bceb63f
commit
2cf9ed7ca5
1 changed files with 19 additions and 0 deletions
|
|
@ -404,4 +404,23 @@ class ScannerTest extends TestCase {
|
|||
['/sub/folder/foo.txt', false],
|
||||
];
|
||||
}
|
||||
|
||||
public function testNoETagUnscannedFolder() {
|
||||
$this->fillTestFolders();
|
||||
|
||||
$this->scanner->scan('');
|
||||
|
||||
$oldFolderEntry = $this->cache->get('folder');
|
||||
// create a new file in a folder by keeping the mtime unchanged, but mark the folder as unscanned
|
||||
$this->storage->file_put_contents('folder/new.txt', 'foo');
|
||||
$this->storage->touch('folder', $oldFolderEntry->getMTime());
|
||||
$this->cache->update($oldFolderEntry->getId(), ['size' => -1]);
|
||||
|
||||
$this->scanner->scan('');
|
||||
|
||||
$this->cache->inCache('folder/new.txt');
|
||||
|
||||
$newFolderEntry = $this->cache->get('folder');
|
||||
$this->assertNotEquals($newFolderEntry->getEtag(), $oldFolderEntry->getEtag());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue