當前位置: 首頁>>代碼示例>>PHP>>正文


PHP testcase::delete方法代碼示例

本文整理匯總了PHP中testcase::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP testcase::delete方法的具體用法?PHP testcase::delete怎麽用?PHP testcase::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在testcase的用法示例。


在下文中一共展示了testcase::delete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: delete

 /**
  * Delete a Test suite, deleting:
  * - Children Test Cases
  * - Test Suite Attachments
  * - Test Suite Custom fields 
  * - Test Suite Keywords
  *
  * IMPORTANT/CRITIC: 
  * this can used to delete a Test Suite that contains ONLY Test Cases.
  *
  * This function is needed by tree class method: delete_subtree_objects()
  *
  * To delete a Test Suite that contains other Test Suites delete_deep() 
  * must be used.
  *
  * ATTENTION: may be in future this can be refactored, and written better. 
  *
  */
 function delete($id)
 {
     $tcase_mgr = new testcase($this->db);
     $tsuite_info = $this->get_by_id($id);
     $testcases = $this->get_children_testcases($id);
     if (!is_null($testcases)) {
         foreach ($testcases as $the_key => $elem) {
             $tcase_mgr->delete($elem['id']);
         }
     }
     // What about keywords ???
     $this->cfield_mgr->remove_all_design_values_from_node($id);
     $this->deleteAttachments($id);
     //inherited
     $this->deleteKeywords($id);
     $sql = "DELETE FROM {$this->object_table} WHERE id={$id}";
     $result = $this->db->exec_query($sql);
     $sql = "DELETE FROM {$this->tables['nodes_hierarchy']} WHERE id={$id}";
     $result = $this->db->exec_query($sql);
 }
開發者ID:tamtrong,項目名稱:testlink,代碼行數:38,代碼來源:testsuite.class.php


注:本文中的testcase::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。