adding unit test for folder remove: testRemovedFolder()
This commit is contained in:
parent
c1a3f015c9
commit
5d0a3f981c
|
@ -154,6 +154,17 @@ class Scanner extends \PHPUnit_Framework_TestCase {
|
||||||
$this->assertFalse($this->cache->inCache('foo.txt'));
|
$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() {
|
function setUp() {
|
||||||
$this->storage = new \OC\Files\Storage\Temporary(array());
|
$this->storage = new \OC\Files\Storage\Temporary(array());
|
||||||
$this->scanner = new \OC\Files\Cache\Scanner($this->storage);
|
$this->scanner = new \OC\Files\Cache\Scanner($this->storage);
|
||||||
|
|
Loading…
Reference in New Issue