Example #1
0
    $opt_cfg->to->map = null;
    // 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 ($loop2do = sizeof($tcs)) {
        $can_do = 1;
        if ($args->bAssignTestSuite) {
            $result = 'ok';
            for ($idx = 0; $idx < $loop2do; $idx++) {
                if (is_null($args->keywordArray)) {
                    $tcase_mgr->deleteKeywords($tcs[$idx]);
                } else {
                    $tcase_mgr->addKeywords($tcs[$idx], $args->keywordArray);
                }
            }
        }
    }
} else {
    if ($args->edit == 'testcase') {
        $doRecall = true;
        $can_do = 1;
        $tcData = $tcase_mgr->get_by_id($args->id);
        if (sizeof($tcData)) {
            $keyword_assignment_subtitle = lang_get('test_case') . TITLE_SEP . $tcData[0]['name'];
        }
        if ($args->bAssignTestCase) {
            $result = 'ok';
            $tcase_mgr->setKeywords($args->id, $args->keywordArray);