adding unit test for folder remove: testRemovedFolder()

This commit is contained in:
Thomas Mueller 2013-06-20 10:47:37 +02:00
parent c1a3f015c9
commit 5d0a3f981c
1 changed files with 11 additions and 0 deletions

View 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);