From ba7797e6a1ae0bdf571d2e861424e15d1909cf4c Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Thu, 20 Jun 2013 10:47:37 +0200 Subject: [PATCH] adding unit test for folder remove: testRemovedFolder() --- tests/lib/files/cache/scanner.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/lib/files/cache/scanner.php b/tests/lib/files/cache/scanner.php index 3ee7f099f38..e93c51441b1 100644 --- a/tests/lib/files/cache/scanner.php +++ b/tests/lib/files/cache/scanner.php @@ -154,6 +154,17 @@ class Scanner extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->cache->inCache('foo.txt')); } + public function testRemovedFolder() { + $this->fillTestFolders(); + + $this->scanner->scan(''); + $this->assertTrue($this->cache->inCache('folder/bar.txt')); + $this->storage->unlink('/folder'); + $this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW); + $this->assertFalse($this->cache->inCache('folder')); + $this->assertFalse($this->cache->inCache('folder/bar.txt')); + } + function setUp() { $this->storage = new \OC\Files\Storage\Temporary(array()); $this->scanner = new \OC\Files\Cache\Scanner($this->storage); -- 2.39.5