当前位置: 首页>>代码示例>>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;未经允许,请勿转载。