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


PHP testproject::get_by_name方法代码示例

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


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

示例1: getByDocIDInProject

 /**
  * This function retrieves a requirement by doc_id with a specifed project 
  * @param string $doc_id
  * @param string $req_project name of req's project 
  * @param string $tproject_id  used only if  $req_project is null
  * @param string $parent_id
  * @param array $options (same as original $options getByDocID method)
  *
  * @internal revisions
  * 20110314 - kinow - Created function.
  */
 function getByDocIDInProject($doc_id, $req_project = null, $tproject_id = null, $parent_id = null, $options = null)
 {
     $reqs = null;
     if (!is_null($req_project)) {
         $tproject_mgr = new testproject($this->db);
         $info = $tproject_mgr->get_by_name($req_project);
         if (!is_null($info)) {
             $tproject_id = $info[0]['id'];
             $reqs = $this->getByDocID($doc_id, $tproject_id, $parent_id, $options);
         }
         //else  $req =  null; // project not found => no req
     } else {
         $reqs = $this->getByDocID($doc_id, $tproject_id, $parent_id, $options);
     }
     return $reqs;
 }
开发者ID:mokal,项目名称:DCN_TestLink,代码行数:27,代码来源:requirement_mgr.class.php

示例2: saveImportedResultData

function saveImportedResultData(&$db, $resultData, $context)
{
    if (!$resultData) {
        return;
    }
    $debugMsg = ' FUNCTION: ' . __FUNCTION__;
    $tables = tlObjectWithDB::getDBTables(array('executions', 'execution_bugs'));
    $l18n = array('import_results_tc_not_found' => '', 'import_results_invalid_result' => '', 'tproject_id_not_found' => '', 'import_results_ok' => '');
    foreach ($l18n as $key => $value) {
        $l18n[$key] = lang_get($key);
    }
    // Get Column definitions to get size dinamically instead of create constants
    $columnDef = array();
    $adodbObj = $db->get_dbmgr_object();
    $columnDef['execution_bugs'] = $adodbObj->MetaColumns($tables['execution_bugs']);
    $keySet = array_keys($columnDef['execution_bugs']);
    foreach ($keySet as $keyName) {
        if (($keylow = strtolower($keyName)) != $keyName) {
            $columnDef['execution_bugs'][$keylow] = $columnDef['execution_bugs'][$keyName];
            unset($columnDef['execution_bugs'][$keyName]);
        }
    }
    $user = new tlUser($context->userID);
    $user->readFromDB($db);
    $tcase_mgr = new testcase($db);
    $resulstCfg = config_get('results');
    $tcaseCfg = config_get('testcase_cfg');
    $resultMap = array();
    $tplan_mgr = null;
    $tc_qty = sizeof($resultData);
    if ($tc_qty) {
        $tplan_mgr = new testplan($db);
        $tproject_mgr = new testproject($db);
        $build_mgr = new build_mgr($db);
    }
    // Need to do checks on common settings
    //
    // test project exists
    //
    // test plan id:
    //              belongs to target test project
    //              is active
    // build id:
    //          belongs to target test plan
    //          is open
    //
    // platform id:
    //          is linked  to target test plan
    //
    // execution type if not present -> set to MANUAL
    //          if presente is valid i.e. inside the TL domain
    //
    $checks = array();
    $checks['status_ok'] = true;
    $checks['msg'] = null;
    $dummy = null;
    if (!is_null($context->tprojectID) && intval($context->tprojectID) > 0) {
        $dummy = array($tproject_mgr->get_by_id($context->tprojectID, array('output' => 'existsByID')));
    } else {
        if (!is_null($context->tprojectName)) {
            $dummy = $tproject_mgr->get_by_name($context->tprojectName, null, array('output' => 'existsByName'));
        }
    }
    $checks['status_ok'] = !is_null($dummy);
    if (!$checks['status_ok']) {
        $checks['msg'][] = sprintf($l18n['tproject_id_not_found'], $context->tprojectID);
    }
    if (!$checks['status_ok']) {
        foreach ($checks['msg'] as $warning) {
            $resultMap[] = array($warning);
        }
    }
    if ($doIt = $checks['status_ok']) {
        $context->tprojectID = $dummy[0]['id'];
    }
    // --------------------------------------------------------------------
    $dummy = null;
    if (!is_null($context->tplanID) && intval($context->tplanID) > 0) {
        $dummy = $tplan_mgr->get_by_id($context->tplanID, array('output' => 'minimun'));
        if (!is_null($dummy)) {
            $dummy['id'] = $context->tplanID;
        }
    } else {
        if (!is_null($context->tplanName)) {
            $dummy = $tplan_mgr->get_by_name($context->tplanName, $context->tprojectID, array('output' => 'minimun'));
            if (!is_null($dummy)) {
                $dummy = $dummy[0];
            }
        }
    }
    if (!is_null($dummy)) {
        $context->tplanID = $dummy['id'];
    }
    if (intval($context->tprojectID) <= 0 && intval($context->tplanID) > 0) {
        $dummy = $tplan_mgr->tree_manager->get_node_hierarchy_info($context->tplanID);
        $context->tprojectID = $dummy['parent_id'];
    }
    // --------------------------------------------------------------------
    // --------------------------------------------------------------------
    $dummy = null;
//.........这里部分代码省略.........
开发者ID:mokal,项目名称:DCN_TestLink,代码行数:101,代码来源:resultsImport.php

示例3: dBug

$linked_tcversions = $obj_mgr->get_linked_tcversions($tplan_id, null, $options);
new dBug($linked_tcversions);
die;
$target_testproject = new stdClass();
$target_testproject->name = 'Testplan Class Unit Test';
$target_testproject->color = '';
$target_testproject->options = new stdClass();
$target_testproject->options->requirement_mgmt = 1;
$target_testproject->options->priority_mgmt = 1;
$target_testproject->options->automated_execution = 1;
$target_testproject->notes = 'Created to run testplan unit tests on ';
$target_testproject->active = 1;
$target_testproject->tcasePrefix = 'TPlanUnitTest';
// Create a test project that will be Test plan parent
$tproject_mgr = new testproject($db);
$info = $tproject_mgr->get_by_name($target_testproject->name);
if (!is_null($info)) {
    $name = $info[0]['name'];
    echo "TestProject with name <b><i>{$name}</i></b> exists!<br>Will be deleted and re-created";
    $tproject_mgr->delete($info[0]['id']);
}
$testproject_id = $tproject_mgr->create($target_testproject->name, $target_testproject->color, $target_testproject->options, $target_testproject->notes, $target_testproject->active, $target_testproject->tcasePrefix);
$testplan = new stdClass();
$testplan->name = 'Test Plan Code Testing';
$testplan->notes = 'Test Plan created running Code Testing code by TestLink Development Team';
echo "<pre> {$object_class} - create(\$name,\$notes,\$testproject_id)";
echo "</pre>";
echo "<pre> {$object_class} - create('{$testplan->name}','{$testplan->notes}',{$testproject_id})";
echo "</pre>";
$testplan->id = $obj_mgr->create($testplan->name, $testplan->notes, $testproject_id);
$info = $obj_mgr->get_by_id($testplan->id);
开发者ID:CristianOspinaOspina,项目名称:testlinkpruebas,代码行数:31,代码来源:testplan.class.test.php


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