/** * */ function getTargetTestCases(&$dbHandler, &$argsObj) { if (is_null($items = $argsObj->tcaseSet)) { $mgr = new testsuite($dbHandler); $items = $mgr->get_testcases_deep($argsObj->id, 'only_id'); } return $items; }
$keyword_assignment_subtitle = null; $can_do = 0; $itemID = null; $opt_cfg->global_lbl = ''; $opt_cfg->additional_global_lbl = null; $opt_cfg->from->lbl = lang_get('available_kword'); $opt_cfg->to->lbl = lang_get('assigned_kword'); $opt_cfg->from->map = $tproject_mgr->get_keywords_map($args->testproject_id); $opt_cfg->to->map = $tcase_mgr->get_keywords_map($args->id, " ORDER BY keyword ASC "); if ($args->edit == 'testsuite') { // We are going to walk all test suites contained // in the selected container, and assign/remove keywords on each test case. $tsuite_mgr = new testsuite($db); $testsuite = $tsuite_mgr->get_by_id($args->id); $keyword_assignment_subtitle = lang_get('test_suite') . TITLE_SEP . $testsuite['name']; $tcs = $tsuite_mgr->get_testcases_deep($args->id, 'only_id'); if (sizeof($tcs)) { $can_do = 1; if ($args->bAssignTestSuite) { $result = 'ok'; for ($i = 0; $i < sizeof($tcs); $i++) { $tcID = $tcs[$i]; $tcase_mgr->setKeywords($tcID, $args->keywordArray); } } $itemID = $tcs; } } else { if ($args->edit == 'testcase') { $can_do = 1; $tcData = $tcase_mgr->get_by_id($args->id);
/** * * */ function doBulkAssignment(&$dbHandler, &$argsObj, $targetTestCaseSet = null) { $req_mgr = new requirement_mgr($dbHandler); $assignmentCounter = 0; $requirements = array_keys($argsObj->reqIdSet); if (!is_null($requirements) && count($requirements) > 0) { $tcase_set = $targetTestCaseSet; if (is_null($tcase_set)) { $tsuite_mgr = new testsuite($dbHandler); echo 'DEBUG BEFORE'; $tcase_set = $tsuite_mgr->get_testcases_deep($argsObj->id, 'only_id'); } if (!is_null($tcase_set) && count($tcase_set)) { $assignmentCounter = $req_mgr->bulk_assignment($requirements, $tcase_set); } } return $assignmentCounter; }
echo "</pre>"; echo "<pre> get_all()"; echo "</pre>"; $all_tsuites_in_my_tl = $tsuite_mgr->get_all(); new dBug($all_tsuites_in_my_tl); echo "<pre> testsuite - get_by_name(\$name)"; echo "</pre>"; echo "<pre> get_by_name({$tsuite_name})"; echo "</pre>"; $tsuite_info = $tsuite_mgr->get_by_name($tsuite_name); new dBug($tsuite_info); echo "<pre> testsuite - get_testcases_deep(\$id,\$details='simple')"; echo "</pre>"; echo "<pre> get_testcases_deep({$tsuite_id},'simple')"; echo "</pre>"; $testcases_deep = $tsuite_mgr->get_testcases_deep($tsuite_id); new dBug($testcases_deep); define("GET_ONLY_TESTCASE_ID", 1); echo "<pre> get_testcases_deep(\$tsuite_id,\$details='full')"; echo "</pre>"; $testcases_deep = $tsuite_mgr->get_testcases_deep($tsuite_id, 'full'); new dBug($testcases_deep); echo "<pre> testsuite - getKeywords(\$tcID,\$kwID = null)"; echo "</pre>"; echo "<pre> getKeywords({$tsuite_id})"; echo "</pre>"; $keywords = $tsuite_mgr->getKeywords($tsuite_id); new dBug($keywords); echo "<pre> testsuite - get_keywords_map(\$id,\$order_by_clause='')"; echo "</pre>"; $tsuite_id = 4;
/** * */ function getTargetTestCases(&$dbHandler, &$argsObj) { $mgr = new testsuite($dbHandler); $items = $mgr->get_testcases_deep($argsObj->id, 'only_id'); if (!is_null($argsObj->tcaseSet)) { $rr = array_intersect($items, $argsObj->tcaseSet); $items = $rr; } return $items; }