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


PHP testcase::modifyTplanDeviceCases方法代碼示例

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


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

示例1: tlPlatform

$platform_mgr = new tlPlatform($db, $args->testproject_id);
$tcase_mgr = new testcase($db);
if ($suite == 'testlink') {
    $testlink_cases = $platform_mgr->getTplanDeviceCaseScript($tplan_id, $device_id);
} else {
    $testlink_cases = $platform_mgr->getTplanDeviceCases($tplan_id, $device_id, $suite);
}
$gui = new stdClass();
$gui->needadd = array_diff($var_cases, $testlink_cases[0]);
$needdelete = array_diff($testlink_cases[0], $var_cases);
$gui->candelete = array_diff($testlink_cases[1], $var_cases);
$gui->cannotdelete = array_diff($needdelete, $gui->candelete);
$gui->added = $gui->deleted = array();
if (!is_null($gui->needadd)) {
    foreach ($gui->needadd as $case) {
        $rs = $tcase_mgr->modifyTplanDeviceCases($tplan_id, $device_id, $suite, $case, "add", $user_name);
        if ($rs == 'Success') {
            $gui->added[] = $case;
        }
    }
}
if (!is_null($gui->candelete)) {
    foreach ($gui->candelete as $case) {
        $rs = $tcase_mgr->modifyTplanDeviceCases($tplan_id, $device_id, $suite, $case, "delete", $user_name);
        if ($rs == 'Success') {
            $gui->deleted[] = $case;
        }
    }
}
if (!is_null($gui->cannotdelete)) {
    foreach ($gui->cannotdelete as $case) {
開發者ID:mokal,項目名稱:DCN_TestLink,代碼行數:31,代碼來源:dcnTplanCaseAssign.php


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