]> source.dussan.org Git - nextcloud-server.git/commitdiff
adding unit test for folder remove: testRemovedFolder()
authorThomas Mueller <thomas.mueller@tmit.eu>
Thu, 20 Jun 2013 08:47:37 +0000 (10:47 +0200)
committerThomas Mueller <thomas.mueller@tmit.eu>
Thu, 20 Jun 2013 08:47:37 +0000 (10:47 +0200)
tests/lib/files/cache/scanner.php

index 3ee7f099f388e8f93850216b8d74fa18edc83f58..e93c51441b1348e21e0d95a907aa1de8c678373e 100644 (file)
@@ -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);