diff options
Diffstat (limited to 'tests/lib/files/cache/scanner.php')
-rw-r--r-- | tests/lib/files/cache/scanner.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/lib/files/cache/scanner.php b/tests/lib/files/cache/scanner.php index 263ceadccc7..f6deb93a49e 100644 --- a/tests/lib/files/cache/scanner.php +++ b/tests/lib/files/cache/scanner.php @@ -143,6 +143,24 @@ class Scanner extends \PHPUnit_Framework_TestCase { $newData = $this->cache->get(''); $this->assertEquals($oldData['etag'], $newData['etag']); $this->assertEquals(-1, $newData['size']); + + $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE); + $oldData = $this->cache->get(''); + $this->assertNotEquals(-1, $oldData['size']); + $this->scanner->scanFile('', \OC\Files\Cache\Scanner::REUSE_ETAG + \OC\Files\Cache\Scanner::REUSE_SIZE); + $newData = $this->cache->get(''); + $this->assertEquals($oldData['etag'], $newData['etag']); + $this->assertEquals($oldData['size'], $newData['size']); + + $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_RECURSIVE, \OC\Files\Cache\Scanner::REUSE_ETAG + \OC\Files\Cache\Scanner::REUSE_SIZE); + $newData = $this->cache->get(''); + $this->assertEquals($oldData['etag'], $newData['etag']); + $this->assertEquals($oldData['size'], $newData['size']); + + $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_ETAG + \OC\Files\Cache\Scanner::REUSE_SIZE); + $newData = $this->cache->get(''); + $this->assertEquals($oldData['etag'], $newData['etag']); + $this->assertEquals($oldData['size'], $newData['size']); } public function testRemovedFile() { |