本文整理汇总了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);
}