$options['only_executed'] = false; } // Added platform_id filter $filters = array('tcase_id' => $args->tc_id, 'keyword_id' => $args->keyword_id, 'assigned_to' => $args->filter_assigned_to, 'exec_status' => $args->filter_status, 'build_id' => $args->build_id, 'cf_hash' => $args->cf_selected, 'platform_id' => $args->platform_id); $linked_tcversions = $tplan_mgr->get_linked_tcversions($args->tplan_id, $filters, $options); $tcase_id = 0; $userid_array = null; if (!is_null($linked_tcversions)) { $items_to_exec = array(); $_SESSION['s_lastAttachmentInfos'] = null; if ($args->level == 'testcase') { // Warning!!! - $gui is passed by reference to be updated inside function $tcase = null; list($tcase_id, $tcversion_id) = processTestCase($tcase, $gui, $args, $cfg, $linked_tcversions, $tree_mgr, $tcase_mgr, $attachmentRepository); } else { list($tcase_id, $tcversion_id) = processTestSuite($db, $gui, $args, $linked_tcversions, $tree_mgr, $tcase_mgr, $attachmentRepository); } // 20100927 - asimon - check if value is an array before calling implode // to avoid warnings in event log $gui->tcversionSet = is_array($tcversion_id) ? implode(',', $tcversion_id) : $tcversion_id; // will create a record even if the testcase version has not been executed (GET_NO_EXEC) $gui->map_last_exec = getLastExecution($db, $tcase_id, $tcversion_id, $gui, $args, $tcase_mgr); // -------------------------------------------------------------------------------------------- // Results to DB if ($args->save_results || $args->do_bulk_save || $args->save_and_next) { // this has to be done to do not break logic present on write_execution() $args->save_results = $args->save_and_next ? $args->save_and_next : $args->save_results; $_REQUEST['save_results'] = $args->save_results; $submitResult = write_execution($db, $args, $_REQUEST, $gui->map_last_exec); // Need to re-read to update test case status if ($args->save_and_next) {
} break; case 'switchspec': $args->edit = 'testsuite'; break; } if (!is_null($pfn)) { $gui = doSingleTestCaseOperation($db, $args, $gui, $pfn); } switch ($args->edit) { case 'testproject': show_instructions('assignReqs'); exit; break; case 'testsuite': $gui = processTestSuite($db, $args, $gui); $templateCfg->default_template = 'reqTcBulkAssignment.tpl'; if ($bulkDone) { $gui->user_feedback = sprintf(lang_get('bulk_assigment_done'), $bulkCounter); } break; case 'testcase': $gui = processTestCase($db, $args, $gui); break; default: tlog("Wrong GET/POST arguments.", 'ERROR'); exit; break; } $smarty = new TLSmarty(); $smarty->assign('gui', $gui);
// Checks whether execute cases button was clicked if ($args->doExec == 1 && !is_null($args->tc_versions) && count($args->tc_versions)) { $gui->remoteExecFeedback = launchRemoteExec($db, $args, $gui->tcasePrefix, $tplan_mgr, $tcase_mgr); } list($linked_tcversions, $itemSet) = getLinkedItems($args, $gui->history_on, $cfg, $tcase_mgr, $tplan_mgr); $tcase_id = 0; $userid_array = null; if (!is_null($linked_tcversions)) { $items_to_exec = array(); $_SESSION['s_lastAttachmentInfos'] = null; if ($args->level == 'testcase') { // Warning!!! - $gui is passed by reference to be updated inside function $tcase = null; list($tcase_id, $tcversion_id) = processTestCase($tcase, $gui, $args, $cfg, $linked_tcversions, $tree_mgr, $tcase_mgr, $attachmentRepository); } else { processTestSuite($db, $gui, $args, $itemSet, $tree_mgr, $tcase_mgr, $attachmentRepository); $tcase_id = $itemSet->tcase_id; $tcversion_id = $itemSet->tcversion_id; } // check if value is an array before calling implode to avoid warnings in event log $gui->tcversionSet = is_array($tcversion_id) ? implode(',', $tcversion_id) : $tcversion_id; // will create a record even if the testcase version has not been executed (GET_NO_EXEC) // // Can be DONE JUST ONCE AFTER write results to DB // -------------------------------------------------------------------------------------------- // Results to DB // // 20130917 - this implementation regarding save_results is confusing. // why ? // because in some situations args->save_results is a number (0) an in other is an array // with just one element with key => test case version ID executed.
$gui->remoteExecFeedback = launchRemoteExec($db, $args, $gui->tcasePrefix, $mgr); } list($linked_tcversions, $itemSet) = getLinkedItems($args, $gui->history_on, $gui->cfg, $mgr); $tcase_id = 0; $userid_array = null; if (!is_null($linked_tcversions)) { $items_to_exec = array(); if ($args->doDelete) { $mgr->tcase->deleteExecution($args->exec_to_delete); } if ($args->level == 'testcase') { // Warning!!! - $gui is passed by reference to be updated inside function $tcase = null; list($tcase_id, $tcversion_id) = processTestCase($tcase, $gui, $args, $linked_tcversions, $mgr); } else { list($tcase_id, $tcversion_id) = processTestSuite($db, $gui, $args, $linked_tcversions, $mgr); } $gui->tcversionSet = is_array($tcversion_id) ? implode(',', $tcversion_id) : $tcversion_id; // will create a record even if the testcase version has not been executed (GET_NO_EXEC) // // Can be DONE JUST ONCE AFTER write results to DB // Results to DB if ($args->save_results || $args->do_bulk_save || $args->save_and_next) { // this has to be done to do not break logic present on writeExecToDB() $args->save_results = $args->save_and_next ? $args->save_and_next : $args->save_results; $_REQUEST['save_results'] = $args->save_results; $mgr->tcase->writeExecToDB($args, $_REQUEST); // Need to re-read to update test case status if ($args->save_and_next) { $identity = processSaveAndNext($mgr, $args, $gui, $tcversion_id); if (!is_null($identity)) {
case "doBulkUpdateToLatest": $gui->user_feedback = doUpdate($db, $args); break; default: break; } $out = null; $gui->show_details = 0; $gui->operationType = 'standard'; $gui->hasItems = 0; switch ($args->level) { case 'testcase': $out = processTestCase($db, $args, $keywordsFilter, $tplan_mgr); break; case 'testsuite': $out = processTestSuite($db, $args, $keywordsFilter, $tplan_mgr, $tcase_mgr); break; case 'testplan': $itemSet = processTestPlan($db, $args, $keywordsFilter, $tplan_mgr); $gui->testcases = $itemSet['items']; $gui->user_feedback = $itemSet['msg']; $gui->instructions = lang_get('update2latest'); $gui->buttonAction = "doBulkUpdateToLatest"; $gui->operationType = 'bulk'; if (!is_null($gui->testcases)) { $gui->hasItems = 1; $gui->show_details = 1; } break; default: // show instructions