/** * test for isDir with existing directory */ public function testIsFile() { $this->testCreateFile(); $result = $this->_controller->isFile($this->_basePath . '/PHPUNIT/phpunit.txt'); $this->assertTrue($result); $result = $this->_controller->isDir($this->_basePath . '/PHPUNIT/phpunit.txt'); $this->assertFalse($result); }
/** * get file node * * @param Tinebase_Model_Tree_Node_Path $_path * @return Tinebase_Model_Tree_Node */ public function getFileNode(Tinebase_Model_Tree_Node_Path $_path) { $this->_checkPathACL($_path, 'get'); if (!$this->_backend->fileExists($_path->statpath)) { throw new Filemanager_Exception('File does not exist,'); } if (!$this->_backend->isFile($_path->statpath)) { throw new Filemanager_Exception('Is a directory'); } return $this->_backend->stat($_path->statpath); }