diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-06-20 00:42:34 +0200 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-06-20 13:05:45 +0200 |
commit | 7992953f1c3bf221c39d885199a884dacc876112 (patch) | |
tree | 7b0fa7779f6d70fb7815919eefcc21cbd69f267b /tests | |
parent | 4f99dcf699924d40431cad8f27f082861088f738 (diff) | |
download | nextcloud-server-7992953f1c3bf221c39d885199a884dacc876112.tar.gz nextcloud-server-7992953f1c3bf221c39d885199a884dacc876112.zip |
remove deleted files when re-scanning a folder
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/files/cache/scanner.php | 10 |
1 files changed, 10 insertions, 0 deletions
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); |