protected function _listFolder()
{
try {
self::$vfs->listFolder('nonexistant_foobar');
$this->fail('Listing non-existant folders should throw an exception');
} catch (Horde_Vfs_Exception $e) {
}
self::$vfs->writeData('', 'file2', '1');
$this->assertEquals(array('file2', 'test'), array_keys($this->_sort(self::$vfs->listFolder('/'))));
$this->assertEquals(array('file2' => null, 'test' => array()), $this->_sort(self::$vfs->listFolder('')));
$this->assertEquals(array('test' => array()), $this->_sort(self::$vfs->listFolder('', null, true, true)));
self::$vfs->writeData('test', '.file2', 'content2');
$this->assertEquals(array('file2' => null, 'test' => array('.file2' => null, 'dir1' => array('file1' => null, 'file2' => null), 'dir2' => array(), 'file1' => null)), $this->_sort(self::$vfs->listFolder('', null, true, false, true)));
$this->assertEquals(array('dir1' => array('file1' => null, 'file2' => null), 'dir2' => array(), 'file1' => null), $this->_sort(self::$vfs->listFolder('test', null, false, false, true)));
$this->assertEquals(array('.file2' => null, 'dir2' => array()), $this->_sort(self::$vfs->listFolder('test', '^.*1$')));
}