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


PHP testproject::get_all_testcases_id方法代码示例

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


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

示例1: foreach

$gui->has_requirements = false;
$gui->has_tc = false;
if ($gui->has_reqspec) {
    // Check if at least one of these requirement spec are not empty.
    $reqSpecMgr = new requirement_spec_mgr($db);
    foreach ($reqSpec as $reqSpecID => $name) {
        if ($gui->has_requirements = $reqSpecMgr->get_requirements_count($reqSpecID) > 0) {
            break;
        }
    }
    unset($reqSpecMgr);
}
if ($gui->has_requirements) {
    // get all test cases id (active/inactive) in test project
    $tcasesID = null;
    $tproject_mgr->get_all_testcases_id($args->tproject_id, $tcasesID);
    if (!is_null($tcasesID) && count($tcasesID) > 0) {
        $debugMsg = 'File: ' . basename(__FILE__) . ' - Line: ' . __LINE__ . ' - ';
        $sql = " /* {$debugMsg} */ " . " SELECT NHA.id AS tc_id, NHA.name, NHA.parent_id AS testsuite_id," . " NT.description, REQC.req_id " . " FROM {$tables['nodes_hierarchy']} NHA " . " JOIN {$tables['node_types']} NT ON NHA.node_type_id=NT.id " . " LEFT OUTER JOIN {$tables['req_coverage']} REQC on REQC.testcase_id=NHA.id " . " WHERE NT.description='testcase' AND NHA.id IN (" . implode(",", $tcasesID) . ") " . " and REQC.req_id IS NULL ";
        $uncovered = $db->fetchRowsIntoMap($sql, 'tc_id');
    }
}
if ($gui->has_tc = !is_null($uncovered) && count($uncovered) > 0) {
    // Get external  ID
    $testSet = array_keys($uncovered);
    $inClause = implode(',', $testSet);
    $debugMsg = 'File: ' . basename(__FILE__) . ' - Line: ' . __LINE__ . ' - ';
    $sql = "/* {$debugMsg} */ " . " SELECT distinct NHA.id AS tc_id, TCV.tc_external_id " . " FROM {$tables['nodes_hierarchy']} NHA, " . " {$tables['nodes_hierarchy']} NHB, " . " {$tables['tcversions']} TCV, {$tables['node_types']} NT " . " WHERE NHA.node_type_id=NT.id AND NHA.id=NHB.parent_id AND NHB.id=TCV.id " . " AND NHA.id IN ({$inClause})  AND NT.description='testcase' ";
    $external_id = $db->fetchRowsIntoMap($sql, 'tc_id');
    foreach ($external_id as $key => $value) {
        $uncovered[$key]['external_id'] = $value['tc_external_id'];
开发者ID:CristianOspinaOspina,项目名称:testlinkpruebas,代码行数:31,代码来源:uncoveredTestCases.php

示例2: testcase

     $db_date = $db->db->DBdate($args->creation_date_from);
     $filter['by_creation_date_from'] = " AND TCV.creation_ts >= {$db_date} ";
 }
 if (!is_null($args->creation_date_to)) {
     $db_date = $db->db->DBdate($args->creation_date_to);
     $filter['by_creation_date_to'] = " AND TCV.creation_ts <= {$db_date} ";
 }
 if ($args->targetTestCase != "" && strcmp($args->targetTestCase, $gui->tcasePrefix) != 0) {
     if (strpos($args->targetTestCase, $tcase_cfg->glue_character) === false) {
         $args->targetTestCase = $gui->tcasePrefix . $args->targetTestCase;
     }
     $tcase_mgr = new testcase($db);
     $tcaseID = $tcase_mgr->getInternalID($args->targetTestCase, $tcase_cfg->glue_character);
     $filter['by_tc_id'] = " AND NH_TCV.parent_id = {$tcaseID} ";
 } else {
     $tproject_mgr->get_all_testcases_id($args->tprojectID, $a_tcid);
     $filter['by_tc_id'] = " AND NH_TCV.parent_id IN (" . implode(",", $a_tcid) . ") ";
 }
 if ($args->version) {
     $filter['by_version'] = " AND TCV.version = {$args->version} ";
 }
 if ($args->keyword_id) {
     $from['by_keyword_id'] = " JOIN {$tables['testcase_keywords']} KW ON KW.testcase_id = NH_TC.id ";
     $filter['by_keyword_id'] = " AND KW.keyword_id = {$args->keyword_id} ";
 }
 if ($args->name != "") {
     $args->name = $db->prepare_string($args->name);
     $filter['by_name'] = " AND NH_TC.name like '%{$args->name}%' ";
 }
 if ($args->summary != "") {
     $args->summary = $db->prepare_string($args->summary);
开发者ID:viglesiasce,项目名称:tl_RC1,代码行数:31,代码来源:tcSearch.php

示例3: importTestPlanLinksFromXML

/**
 * @internal revisions
 */
function importTestPlanLinksFromXML(&$dbHandler, &$tplanMgr, $targetFile, $contextObj)
{
    //   <testplan>
    //     <name></name>
    //     <platforms>
    //       <platform>
    //         <name> </name>
    //         <internal_id></internal_id>
    //       </platform>
    //       <platform>
    //       ...
    //       </platform>
    //     </platforms>
    //     <executables>
    //       <link>
    //         <platform>
    //           <name> </name>
    //         </platform>
    //         <testcase>
    //           <name> </name>
    //           <externalid> </externalid>
    //           <version> </version>
    //           <execution_order> </execution_order>
    //         </testcase>
    //       </link>
    //       <link>
    //       ...
    //       </link>
    //     </executables>
    //   </testplan>
    // </xml>
    $msg = array();
    $labels = init_labels(array('link_without_required_platform' => null, 'ok' => null, 'link_without_platform_element' => null, 'no_platforms_on_tproject' => null, 'tcase_link_updated' => null, 'link_with_platform_not_needed' => null, 'tproject_has_zero_testcases' => null, 'platform_not_on_tproject' => null, 'platform_linked' => null, 'platform_not_linked' => null, 'tcase_doesnot_exist' => null, 'tcversion_doesnot_exist' => null, 'not_imported' => null, 'link_to_tplan_feedback' => null, 'link_to_platform' => null));
    // Double Check
    // Check if Test Plan Parent (Test Project) has testcases, if not abort
    $tprojectMgr = new testproject($dbHandler);
    $tprojectInfo = $tprojectMgr->get_by_id($contextObj->tproject_id);
    $tcasePrefix = $tprojectInfo['prefix'] . config_get('testcase_cfg')->glue_character;
    $tprojectHasTC = $tprojectMgr->count_testcases($contextObj->tproject_id) > 0;
    if (!$tprojectHasTC) {
        $msg[] = array(sprintf($labels['tproject_has_zero_testcases'], $tprojectInfo['name']), $labels['not_imported']);
        return $msg;
        // >>>-----> Bye
    }
    $xml = @simplexml_load_file_wrapper($targetFile);
    if ($xml !== FALSE) {
        $tcaseMgr = new testcase($dbHandler);
        $tcaseSet = array();
        $tprojectMgr->get_all_testcases_id($contextObj->tproject_id, $tcaseSet, array('output' => 'external_id'));
        $tcaseSet = array_flip($tcaseSet);
        // Test Plan name will not be used
        // <testplan>  <name></name>
        //
        // Platform definition info will not be used
        //
        // I will try to link the platforms if are defined
        $status_ok = true;
        if (property_exists($xml, 'platforms')) {
            $platformMgr = new tlPlatform($dbHandler, $contextObj->tproject_id);
            $platformUniverse = $platformMgr->getAllAsMap();
            if (is_null($platformUniverse)) {
                $status_ok = false;
                $msg[] = array($labels['no_platforms_on_tproject'], $labels['not_imported']);
            } else {
                $platformUniverse = array_flip($platformUniverse);
                $op = processPlatforms($platformMgr, $tplanMgr, $platformUniverse, $xml->platforms, $labels, $contextObj->tplan_id);
                $status_ok = $op['status_ok'];
                $msg = $op['msg'];
            }
        }
        if ($status_ok && $xml->xpath('//executables')) {
            $tables = tlObjectWithDB::getDBTables(array('testplan_tcversions'));
            $platformSet = $tplanMgr->getPlatforms($contextObj->tplan_id, array('outputFormat' => 'mapAccessByName'));
            $targetHasPlatforms = count($platformSet) > 0;
            $xmlLinks = $xml->executables->children();
            $loops2do = count($xmlLinks);
            // new dBug($platformSet);
            for ($idx = 0; $idx < $loops2do; $idx++) {
                // if Target Test Plan has platforms and importing file NO => Fatal Error
                $targetName = null;
                $platformID = -1;
                $linkWithPlatform = false;
                $status_ok = false;
                $dummy_msg = null;
                $import_status = $labels['ok'];
                if ($platformElementExists = property_exists($xmlLinks[$idx], 'platform')) {
                    $targetName = trim((string) $xmlLinks[$idx]->platform->name);
                    $linkWithPlatform = $targetName != '';
                }
                // echo "\$targetHasPlatforms:$targetHasPlatforms<br>";
                // echo "\$linkWithPlatform:$linkWithPlatform<br>";
                if ($targetHasPlatforms) {
                    // each link need to have platform or will not be imported
                    if ($linkWithPlatform && isset($platformSet[$targetName])) {
                        $platformID = $platformSet[$targetName]['id'];
                        $status_ok = true;
                        $dummy_msg = null;
//.........这里部分代码省略.........
开发者ID:mokal,项目名称:DCN_TestLink,代码行数:101,代码来源:planImport.php


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