Horde_Vfs_TestBase::_listFolder PHP Method

_listFolder() protected method

Structure after test: test/ dir1/ file1: content1_1 file2: __FILE__ dir2/ .file2: content2 file1: content1 file2: 1
protected _listFolder ( )
    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$')));
    }