/** * Tears down the fixture * This method is called after a test is executed. * * @access protected */ protected function tearDown() { if (isset($this->_objects['paths'])) { foreach ($this->_objects['paths'] as $path) { try { $this->_fsController->rmdir($path, TRUE); } catch (Tinebase_Exception_NotFound $tenf) { // already deleted } } } parent::tearDown(); Crm_Controller_Lead::getInstance()->duplicateCheckFields(array('lead_name')); }
public function testRmdir() { $testPath = $this->testMkdir(); $result = $this->_controller->rmdir($testPath); $this->assertTrue($result, 'wrong result for rmdir command'); $this->assertFalse($this->_controller->fileExists($testPath), 'failed to delete directory'); }
/** * 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; }
/** * Tears down the fixture * This method is called after a test is executed. * * @access protected */ protected function tearDown() { if (isset($this->_objects['paths'])) { foreach ($this->_objects['paths'] as $path) { try { $this->_fsController->rmdir($path, TRUE); } catch (Tinebase_Exception_NotFound $tenf) { // already deleted } } } if (isset($this->_objects['containerids'])) { foreach ($this->_objects['containerids'] as $containerId) { Tinebase_Container::getInstance()->delete($containerId); } } Tinebase_TransactionManager::getInstance()->rollBack(); }