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


PHP testcase::get_basic_info方法代码示例

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


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

示例1: importTestPlanLinksFromXML


//.........这里部分代码省略.........
                            $dummy_msg = sprintf($labels['link_without_platform_element'], $idx + 1);
                        } else {
                            if (!$linkWithPlatform) {
                                $dummy_msg = sprintf($labels['link_without_required_platform'], $idx + 1);
                            } else {
                                $dummy_msg = sprintf($labels['platform_not_linked'], $idx + 1, $targetName, $contextObj->tplan_name);
                            }
                        }
                    }
                } else {
                    if ($linkWithPlatform) {
                        $import_status = $labels['not_imported'];
                        $dummy_msg = sprintf($labels['link_with_platform_not_needed'], $idx + 1);
                    } else {
                        $platformID = 0;
                        $status_ok = true;
                    }
                }
                if (!is_null($dummy_msg)) {
                    $msg[] = array($dummy_msg, $import_status);
                }
                // echo '$status_ok' . $status_ok . ' ' . __LINE__ . '<br>' ;
                if ($status_ok) {
                    $createLink = false;
                    $updateLink = false;
                    // Link passed ok check on platform
                    // Now we need to understand if requested Test case is present on Test Project
                    $externalID = (int) $xmlLinks[$idx]->testcase->externalid;
                    $tcaseName = (string) $xmlLinks[$idx]->testcase->name;
                    $execOrder = (int) $xmlLinks[$idx]->testcase->execution_order;
                    $version = (int) $xmlLinks[$idx]->testcase->version;
                    if (isset($tcaseSet[$externalID])) {
                        // now need to check if requested version exists
                        $dummy = $tcaseMgr->get_basic_info($tcaseSet[$externalID], array('number' => $version));
                        if (count($dummy) > 0) {
                            // Check :
                            // for same test plan there is a different version already linked ?
                            // if YES => error.
                            //
                            $lvFilters = array('tplan_id' => $contextObj->tplan_id);
                            $linkedVersions = $tcaseMgr->get_linked_versions($dummy[0]['id'], $lvFilters);
                            $updateLink = false;
                            $doUpdateFeedBack = true;
                            // TICKET 5189: Import a test plan does not import test cases execution order
                            // new dBug($linkedVersions);
                            if (!($createLink = is_null($linkedVersions))) {
                                // Now need to understand if is already linked with this signature.
                                if (!isset($linkedVersions[$dummy[0]['tcversion_id']])) {
                                    //echo 'CREATE';
                                    $createLink = true;
                                } else {
                                    // linked platforms
                                    $createLink = false;
                                    $updateLink = false;
                                    $plat_keys = array_keys($linkedVersions[$dummy[0]['tcversion_id']][$contextObj->tplan_id]);
                                    $plat_keys = array_flip($plat_keys);
                                    if (isset($plat_keys[$platformID])) {
                                        $updateLink = true;
                                    } else {
                                        if ($platformID == 0) {
                                            // User request to add without platform, but platforms exist => SKIP
                                            $msg[] = array('platform 0 missing messages', $labels['not_imported']);
                                        } else {
                                            $createLink = true;
                                        }
                                    }
开发者ID:mokal,项目名称:DCN_TestLink,代码行数:67,代码来源:planImport.php

示例2: systemWideTestCaseSearch

/**
 *
 *
 */
function systemWideTestCaseSearch(&$dbHandler, &$argsObj, $glue)
{
    // Attention:
    // this algorithm has potential flaw (IMHO) because we can find the glue character
    // in situation where it's role is not this.
    // Anyway i will work on this in the future (if I've time)
    //
    if (strpos($argsObj->targetTestCase, $glue) === false) {
        // We suppose user was lazy enough to do not provide prefix,
        // then we will try to help him/her
        $argsObj->targetTestCase = $argsObj->tcasePrefix . $argsObj->targetTestCase;
    }
    if (!is_null($argsObj->targetTestCase)) {
        // parse to get JUST prefix, find the last glue char.
        // This useful because from navBar, user can request search of test cases that belongs
        // to test project DIFFERENT to test project setted in environment
        if (($gluePos = strrpos($argsObj->targetTestCase, $glue)) !== false) {
            $tcasePrefix = substr($argsObj->targetTestCase, 0, $gluePos);
        }
        $tprojectMgr = new testproject($dbHandler);
        $argsObj->tcaseTestProject = $tprojectMgr->get_by_prefix($tcasePrefix);
        $tcaseMgr = new testcase($dbHandler);
        $argsObj->tcase_id = $tcaseMgr->getInternalID($argsObj->targetTestCase);
        $dummy = $tcaseMgr->get_basic_info($argsObj->tcase_id, array('number' => $argsObj->tcaseVersionNumber));
        if (!is_null($dummy)) {
            $argsObj->tcversion_id = $dummy[0]['tcversion_id'];
        }
    }
}
开发者ID:mweyamutsvene,项目名称:testlink,代码行数:33,代码来源:archiveData.php

示例3: init_args

/**
 * 
 *
 */
function init_args(&$dbHandler)
{
    $_REQUEST = strings_stripSlashes($_REQUEST);
    $iParams = array("edit" => array(tlInputParameter::STRING_N, 0, 50), "id" => array(tlInputParameter::INT_N), "show_path" => array(tlInputParameter::INT_N), "show_mode" => array(tlInputParameter::STRING_N, 0, 50), "tcase_id" => array(tlInputParameter::INT_N), "tcversion_id" => array(tlInputParameter::INT_N), "tproject_id" => array(tlInputParameter::INT_N), "targetTestCase" => array(tlInputParameter::STRING_N, 0, 24), "tcasePrefix" => array(tlInputParameter::STRING_N, 0, 16), "tcaseExternalID" => array(tlInputParameter::STRING_N, 0, 16), "tcaseVersionNumber" => array(tlInputParameter::INT_N));
    $args = new stdClass();
    R_PARAMS($iParams, $args);
    // For more information about the data accessed in session here, see the comment
    // in the file header of lib/functions/tlTestCaseFilterControl.class.php.
    $form_token = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0;
    $mode = 'edit_mode';
    $cfg = config_get('testcase_cfg');
    $session_data = isset($_SESSION[$mode]) && isset($_SESSION[$mode][$form_token]) ? $_SESSION[$mode][$form_token] : null;
    $args->refreshTree = isset($session_data['setting_refresh_tree_on_action']) ? $session_data['setting_refresh_tree_on_action'] : 0;
    $args->user_id = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0;
    $args->feature = $args->edit;
    $args->opt_requirements = null;
    $args->automationEnabled = 0;
    $args->requirementsEnabled = 0;
    $args->testPriorityEnabled = 0;
    $args->tcasePrefix = trim($args->tcasePrefix);
    $tprojectMgr = new testproject($dbHandler);
    if ($args->tproject_id <= 0 && strlen($args->tcaseExternalID) > 0) {
        // parse to get JUST prefix
        $gluePos = strrpos($args->tcaseExternalID, $cfg->glue_character);
        // Find the last glue char
        $status_ok = $gluePos !== false;
        if ($status_ok) {
            $tcasePrefix = substr($args->tcaseExternalID, 0, $gluePos);
        }
        $dummy = $tprojectMgr->get_by_prefix($tcasePrefix);
        $tcaseMgr = new testcase($dbHandler);
        $args->tcase_id = $tcaseMgr->getInternalID($args->tcaseExternalID);
        $tcinfo = $tcaseMgr->get_basic_info($args->tcase_id, array('number' => $args->tcaseVersionNumber));
        if (!is_null($tcinfo)) {
            $args->tcversion_id = $tcinfo[0]['tcversion_id'];
        }
        unset($tcaseMgr);
    } else {
        $dummy = $tprojectMgr->get_by_id($args->tproject_id);
    }
    if (!is_null($dummy)) {
        $args->tproject_id = $dummy['id'];
    }
    $args->opt_requirements = $dummy['opt']->requirementsEnabled;
    $args->requirementsEnabled = $dummy['opt']->requirementsEnabled;
    $args->automationEnabled = $dummy['opt']->automationEnabled;
    $args->testPriorityEnabled = $dummy['opt']->testPriorityEnabled;
    if (!$args->tcversion_id) {
        $args->tcversion_id = testcase::ALL_VERSIONS;
    }
    // used to manage goback
    if (intval($args->tcase_id) > 0) {
        $args->feature = 'testcase';
        $args->id = intval($args->tcase_id);
    }
    $args->id = is_null($args->id) ? 0 : $args->id;
    switch ($args->feature) {
        case 'testsuite':
            $_SESSION['setting_refresh_tree_on_action'] = $args->refreshTree ? 1 : 0;
            break;
        case 'testproject':
            $args->id = $args->tproject_id;
            break;
    }
    if (strpos($args->targetTestCase, $cfg->glue_character) === false) {
        $args->targetTestCase = $args->tcasePrefix . $args->targetTestCase;
    }
    return $args;
}
开发者ID:moraesmv,项目名称:testlink-code,代码行数:73,代码来源:archiveData.php


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