From ff7e903f82607fdbc73e17dd7bb6bcc2caeb3de7 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 20 Jun 2013 00:42:34 +0200 Subject: remove deleted files when re-scanning a folder --- tests/lib/files/cache/scanner.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/lib/files/cache') diff --git a/tests/lib/files/cache/scanner.php b/tests/lib/files/cache/scanner.php index 3dacefa2b80..3ee7f099f38 100644 --- a/tests/lib/files/cache/scanner.php +++ b/tests/lib/files/cache/scanner.php @@ -144,6 +144,16 @@ class Scanner extends \PHPUnit_Framework_TestCase { $this->assertEquals(-1, $newData['size']); } + public function testRemovedFile() { + $this->fillTestFolders(); + + $this->scanner->scan(''); + $this->assertTrue($this->cache->inCache('foo.txt')); + $this->storage->unlink('foo.txt'); + $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW); + $this->assertFalse($this->cache->inCache('foo.txt')); + } + function setUp() { $this->storage = new \OC\Files\Storage\Temporary(array()); $this->scanner = new \OC\Files\Cache\Scanner($this->storage); -- cgit v1.2.3