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