adding unit test for folder remove: testRemovedFolder()
This commit is contained in:
parent
c1a3f015c9
commit
5d0a3f981c
1 changed files with 11 additions and 0 deletions
11
tests/lib/files/cache/scanner.php
vendored
11
tests/lib/files/cache/scanner.php
vendored
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue