当前位置: 首页>>代码示例>>PHP>>正文


PHP testplan::getSkeleton方法代码示例

本文整理汇总了PHP中testplan::getSkeleton方法的典型用法代码示例。如果您正苦于以下问题:PHP testplan::getSkeleton方法的具体用法?PHP testplan::getSkeleton怎么用?PHP testplan::getSkeleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在testplan的用法示例。


在下文中一共展示了testplan::getSkeleton方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testPlanTree

function testPlanTree(&$dbHandler, &$menuUrl, $tproject_id, $tproject_name, $tplan_id, $tplan_name, $objFilters, $objOptions)
{
    $debugMsg = ' - Method: ' . __FUNCTION__;
    $chronos[] = $tstart = microtime(true);
    $treeMenu = new stdClass();
    $treeMenu->rootnode = null;
    $treeMenu->menustring = '';
    $resultsCfg = config_get('results');
    $glueChar = config_get('testcase_cfg')->glue_character;
    $menustring = null;
    $tplan_tcases = null;
    $renderTreeNodeOpt = null;
    $renderTreeNodeOpt['showTestCaseID'] = config_get('treemenu_show_testcase_id');
    list($filters, $options, $renderTreeNodeOpt['showTestSuiteContents'], $renderTreeNodeOpt['useCounters'], $renderTreeNodeOpt['useColors'], $colorBySelectedBuild) = initExecTree($objFilters, $objOptions);
    $tplan_mgr = new testplan($dbHandler);
    $tproject_mgr = new testproject($dbHandler);
    $tree_manager = $tplan_mgr->tree_manager;
    $tcase_node_type = $tree_manager->node_descr_id['testcase'];
    $hash_descr_id = $tree_manager->get_available_node_types();
    $hash_id_descr = array_flip($hash_descr_id);
    $tcase_prefix = $tproject_mgr->getTestCasePrefix($tproject_id) . $glueChar;
    $nt2exclude = array('testplan' => 'exclude_me', 'requirement_spec' => 'exclude_me', 'requirement' => 'exclude_me');
    $nt2exclude_children = array('testcase' => 'exclude_my_children', 'requirement_spec' => 'exclude_my_children');
    // remove test spec, test suites (or branches) that have ZERO test cases linked to test plan
    //
    // IMPORTANT:
    // using 'order_cfg' => array("type" =>'exec_order',"tplan_id" => $tplan_id))
    // makes the magic of ignoring test cases not linked to test plan.
    // This unexpected bonus can be useful on export test plan as XML.
    //
    $my['options'] = array('recursive' => true, 'remove_empty_nodes_of_type' => $tree_manager->node_descr_id['testsuite'], 'order_cfg' => array("type" => 'exec_order', "tplan_id" => $tplan_id), 'hideTestCases' => $options['hideTestCases'], 'tc_action_enabled' => $options['tc_action_enabled'], 'showTestCaseExecStatus' => $options['showTestCaseExecStatus']);
    $my['filters'] = array('exclude_node_types' => $nt2exclude, 'exclude_children_of' => $nt2exclude_children);
    if (isset($objFilters->filter_toplevel_testsuite) && is_array($objFilters->filter_toplevel_testsuite)) {
        $my['filters']['exclude_branches'] = $objFilters->filter_toplevel_testsuite;
    }
    if (isset($objFilters->filter_custom_fields) && is_array($objFilters->filter_custom_fields)) {
        $my['filters']['filter_custom_fields'] = $objFilters->filter_custom_fields;
    }
    if (property_exists($objOptions, 'actionJS')) {
        foreach (array('testproject', 'testsuite', 'testcase') as $nk) {
            if (isset($objOptions->actionJS[$nk])) {
                $renderTreeNodeOpt['actionJS'][$nk] = $objOptions->actionJS[$nk];
            }
        }
    }
    if (property_exists($objOptions, 'nodeHelpText')) {
        foreach (array('testproject', 'testsuite', 'testcase') as $nk) {
            if (isset($objOptions->nodeHelpText[$nk])) {
                $renderTreeNodeOpt['nodeHelpText'][$nk] = $objOptions->nodeHelpText[$nk];
            }
        }
    }
    $test_spec = $tplan_mgr->getSkeleton($tplan_id, $tproject_id, $my['filters'], $my['options']);
    $test_spec['name'] = $tproject_name . " / " . $tplan_name;
    // To be discussed
    $test_spec['id'] = $tproject_id;
    $test_spec['node_type_id'] = $hash_descr_id['testproject'];
    $test_spec['node_type'] = 'testproject';
    $map_node_tccount = array();
    $tplan_tcases = array();
    if ($test_spec) {
        if (is_null($filters['tcase_id']) || $filters['tcase_id'] > 0) {
            // Step 1 - get item set with exec status.
            // This has to scopes:
            // 1. tree coloring according exec status on (Test plan, platform, build ) context
            // 2. produce sql that can be used to reduce item set on combination with filters
            //    that can not be used on this step like:
            //    a. test cases belonging to branch with root TEST SUITE
            //    b. keyword filter on AND MODE
            //    c. execution results on other builds, any build etc
            //
            // WE NEED TO ADD FILTERING on CUSTOM FIELD VALUES, WE HAVE NOT REFACTORED
            // THIS YET.
            //
            if (!is_null($sql2do = $tplan_mgr->{$objOptions->getTreeMethod}($tplan_id, $filters, $options))) {
                $doPinBall = false;
                if (is_array($sql2do)) {
                    if ($doPinBall = $filters['keyword_filter_type'] == 'And') {
                        $kmethod = "fetchRowsIntoMapAddRC";
                        $unionClause = " UNION ALL ";
                    } else {
                        $kmethod = "fetchRowsIntoMap";
                        $unionClause = ' UNION ';
                    }
                    $sql2run = $sql2do['exec'] . $unionClause . $sql2do['not_run'];
                } else {
                    $kmethod = "fetchRowsIntoMap";
                    $sql2run = $sql2do;
                }
                $tplan_tcases = $dbHandler->{$kmethod}($sql2run, 'tcase_id');
                if ($doPinBall && !is_null($tplan_tcases)) {
                    $kwc = count($filters['keyword_id']);
                    $ak = array_keys($tplan_tcases);
                    $mx = null;
                    foreach ($ak as $tk) {
                        if ($tplan_tcases[$tk]['recordcount'] == $kwc) {
                            $mx[$tk] = $tplan_tcases[$tk];
                        }
                    }
                    $tplan_tcases = null;
//.........这里部分代码省略.........
开发者ID:mokal,项目名称:DCN_TestLink,代码行数:101,代码来源:execTreeMenu.inc.php


注:本文中的testplan::getSkeleton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。