diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-06-20 00:42:34 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-06-20 00:42:34 +0200 |
commit | ff7e903f82607fdbc73e17dd7bb6bcc2caeb3de7 (patch) | |
tree | 0e30d10b21397bb01ad3f65cd15a13f2cbba5e16 /tests | |
parent | e3171a701d2c88a12ec11cebb5d96ff2fb6cf677 (diff) | |
download | nextcloud-server-ff7e903f82607fdbc73e17dd7bb6bcc2caeb3de7.tar.gz nextcloud-server-ff7e903f82607fdbc73e17dd7bb6bcc2caeb3de7.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); |