本文整理汇总了PHP中testplan::get_by_name方法的典型用法代码示例。如果您正苦于以下问题:PHP testplan::get_by_name方法的具体用法?PHP testplan::get_by_name怎么用?PHP testplan::get_by_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testplan
的用法示例。
在下文中一共展示了testplan::get_by_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
//.........这里部分代码省略.........
示例2: dBug
$tplan_id = -1;
if (!is_null($all_testplans_on_tl)) {
$tplan_id = $all_testplans_on_tl[0]['id'];
}
echo "<pre> testplan - get_by_id(\$id)";
echo "</pre>";
echo "<pre> get_by_id({$tplan_id})";
echo "</pre>";
$tplan_info = $tplan_mgr->get_by_id($tplan_id);
new dBug($tplan_info);
$tplan_name = "TEST_TESTPLAN";
echo "<pre> testplan - get_by_name(\$name,\$tproject_id = 0)";
echo "</pre>";
echo "<pre> get_by_name({$tplan_name})";
echo "</pre>";
$tplan_info = $tplan_mgr->get_by_name($tplan_name);
new dBug($tplan_info);
echo "<pre> testplan - get_builds(\$tplan_id,\$active=null,\$open=null)";
echo "</pre>";
echo "<pre> get_builds({$tplan_id})";
echo "</pre>";
$all_builds = $tplan_mgr->get_builds($tplan_id);
new dBug($all_builds);
echo "<pre> testplan - count_testcases(\$tplan_id)";
echo "</pre>";
echo "<pre> count_testcases({$tplan_id})";
echo "</pre>";
$count_testcases = $tplan_mgr->count_testcases($tplan_id);
new dBug("Number of testcase linked to test plan=" . $count_testcases);
// echo "<pre> testplan - get_linked_tcversions(\$tplan_id,\$tcase_id=null,\$keyword_id=0,\$executed=null,
// \$assigned_to=null,\$exec_status=null,\$build_id=0,