public function testDeleteFile() { $this->testCreateFile(); $this->_controller->unlink($this->_basePath . '/PHPUNIT/phpunit.txt'); $children = $this->_controller->scanDir($this->_basePath . '/PHPUNIT')->name; $this->assertTrue(!in_array('phpunit.txt', $children)); }
/** * delete node in backend * * @param Tinebase_Model_Tree_Node_Path $_path * @return boolean */ protected function _deleteNodeInBackend(Tinebase_Model_Tree_Node_Path $_path) { $success = FALSE; $node = $this->_backend->stat($_path->statpath); if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Removing path ' . $_path->flatpath . ' of type ' . $node->type); } switch ($node->type) { case Tinebase_Model_Tree_Node::TYPE_FILE: $success = $this->_backend->unlink($_path->statpath); break; case Tinebase_Model_Tree_Node::TYPE_FOLDER: $success = $this->_backend->rmdir($_path->statpath, TRUE); break; } return $success; }