echo "<pre>            get_last_version_info({$tcase_id})";
$last_version_info = $tcase_mgr->get_last_version_info($tcase_id);
new dBug($last_version_info);
echo "<pre> testcase - get_versions_status_quo(\$id,\$tcversion_id=null, \$testplan_id=null)";
echo "<pre>            get_versions_status_quo({$tcase_id})";
$status_quo = $tcase_mgr->get_versions_status_quo($tcase_id);
new dBug($status_quo);
echo "<pre> testcase - get_exec_status(\$id)";
echo "<pre>            get_exec_status({$tcase_id})";
$testcase_exec_status = $tcase_mgr->get_exec_status($tcase_id);
new dBug($testcase_exec_status);
echo "<pre> testcase - getKeywords(\$tcID,\$kwID = null)";
echo "</pre>";
echo "<pre>            getKeywords({$tcase_id})";
echo "</pre>";
$keywords = $tcase_mgr->getKeywords($tcase_id);
new dBug($keywords);
echo "<pre> testcase - get_keywords_map(\$id,\$order_by_clause='')";
echo "</pre>";
$tcase_id = 4;
echo "<pre>               get_keywords_map({$tcase_id})";
echo "</pre>";
$keywords_map = $tcase_mgr->get_keywords_map($tcase_id);
new dBug($keywords_map);
$tcase_id = 4;
$version_id = 5;
$tplan_id = 8;
$build_id = 1;
echo "<pre> testcase - get_executions(\$id,\$version_id,\$tplan_id,\$build_id,<br>\n                                      \$exec_id_order='DESC',\$exec_to_exclude=null)";
echo "</pre>";
echo "<pre>            get_executions({$tcase_id},{$version_id},{$tplan_id},{$build_id})";
示例#2
0
 /**
  * get_children_testcases
  * get only test cases with parent=testsuite without doing a deep search
  *
  */
 function get_children_testcases($id, $details = 'simple', $options = null)
 {
     $testcases = null;
     $only_id = $details == 'only_id' ? true : false;
     $subtree = $this->tree_manager->get_children($id, array('testsuite' => 'exclude_me'));
     $doit = !is_null($subtree);
     $opt = array('getKeywords' => false);
     $opt = array_merge($opt, (array) $options);
     if ($doit) {
         $tsuite = $this->get_by_id($id);
         $tsuiteName = $tsuite['name'];
         $testcases = array();
         foreach ($subtree as $the_key => $elem) {
             if ($only_id) {
                 $testcases[] = $elem['id'];
             } else {
                 $testcases[] = $elem;
             }
         }
         $doit = count($testcases) > 0;
     }
     if ($doit && $details == 'full') {
         $rs = array();
         $tcase_mgr = new testcase($this->db);
         foreach ($testcases as $idx => $value) {
             $item = $tcase_mgr->get_last_version_info($value['id'], array('output' => full, 'get_steps' => true));
             $item['tcversion_id'] = $item['id'];
             $parent['tsuite_name'] = $tsuiteName;
             if ($opt['getKeywords']) {
                 $kw = $tcase_mgr->getKeywords($value['id']);
                 if (!is_null($kw)) {
                     $item['keywords'] = $kw;
                 }
             }
             unset($item['id']);
             $rs[] = $value + $item + $tsuite;
         }
         $testcases = $rs;
     }
     return $testcases;
 }