function testTreeMove() { mkdir(SABRE_TEMPDIR . '/issue33'); $dir = new Sabre_DAV_FS_Directory(SABRE_TEMPDIR . '/issue33'); $dir->createDirectory('foo'); $tree = new Sabre_DAV_ObjectTree($dir); $tree->move('foo', urldecode('%C3%A0fo%C3%B3')); $node = $tree->getNodeForPath(urldecode('%C3%A0fo%C3%B3')); $this->assertEquals(urldecode('%C3%A0fo%C3%B3'), $node->getName()); }
/** Aguarda configuracao de WEBDAV public function testGetVacationTemplates() { $this->_addVacationTemplateFile(); $result = $this->_json->getVacationMessageTemplates(); $this->assertTrue($result['totalcount'] > 0, 'no templates found'); $found = FALSE; foreach ($result['results'] as $template) { if ($template['name'] === $this->_sieveVacationTemplateFile) { $found = TRUE; break; } } $this->assertTrue($found, 'wrong templates: ' . print_r($result['results'], TRUE)); return $template; } /** * add vacation template file to vfs */ protected function _addVacationTemplateFile() { $webdavRoot = new Sabre_DAV_ObjectTree(new Tinebase_WebDav_Root()); $path = 'webdav/shared/vacation/templates'; $node = $webdavRoot->getNodeForPath($path); $this->_pathsToDelete[] = $path . '/' . $this->_sieveVacationTemplateFile; $node->createFile($this->_sieveVacationTemplateFile, fopen(dirname(__FILE__) . '/files/' . $this->_sieveVacationTemplateFile, 'r')); }