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