本文整理汇总了PHP中testcase::getExecution方法的典型用法代码示例。如果您正苦于以下问题:PHP testcase::getExecution方法的具体用法?PHP testcase::getExecution怎么用?PHP testcase::getExecution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testcase
的用法示例。
在下文中一共展示了testcase::getExecution方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addIssue
function addIssue($dbHandler, $argsObj, $itsObj)
{
$opOK = false;
$msg = '';
$resultsCfg = config_get('results');
$tcaseMgr = new testcase($dbHandler);
$dummy = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->tcversion_id);
$auditSign = $tcaseMgr->getAuditSignature((object) array('id' => $dummy['parent_id']));
$exec = current($tcaseMgr->getExecution($argsObj->exec_id, $argsObj->tcversion_id));
$dummy = $exec['status'];
if (isset($resultsCfg['code_status'][$exec['status']])) {
$dummy = $resultsCfg['code_status'][$exec['status']];
}
$exec['statusVerbose'] = sprintf(lang_get('issue_exec_result'), $dummy);
unset($tcaseMgr);
$signature = sprintf(lang_get('issue_generated_description'), $argsObj->exec_id, $exec['tester_login'], $exec['testplan_name']);
if ($exec['platform_id'] > 0) {
$signature .= sprintf(lang_get('issue_platform'), $exec['platform_name']);
}
$signature .= sprintf(lang_get('issue_build') . lang_get('execution_ts_iso'), $exec['build_name'], $exec['execution_ts']) . "\n" . $exec['statusVerbose'] . "\n\n" . $exec['execution_notes'];
$rs = $itsObj->addIssue($auditSign . ' - ' . sprintf(lang_get('execution_ts_iso'), $exec['execution_ts']), $signature);
if ($rs['status_ok']) {
$msg = $rs['msg'];
$opOK = true;
if (write_execution_bug($dbHandler, $argsObj->exec_id, $rs['id'])) {
logAuditEvent(TLS("audit_executionbug_added", $rs['id']), "CREATE", $argsObj->exec_id, "executions");
}
} else {
$msg = $rs['msg'];
}
return array($opOK, $msg);
}
示例2: generateIssueText
/**
*
*/
function generateIssueText($dbHandler, $argsObj, $itsObj)
{
$ret = new stdClass();
$opOK = false;
$msg = '';
$resultsCfg = config_get('results');
$tcaseMgr = new testcase($dbHandler);
$exec = current($tcaseMgr->getExecution($argsObj->exec_id, $argsObj->tcversion_id));
$dummy = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->tcversion_id);
$ret->auditSign = $tcaseMgr->getAuditSignature((object) array('id' => $dummy['parent_id']));
$dummy = $exec['status'];
if (isset($resultsCfg['code_status'][$exec['status']])) {
$dummy = $resultsCfg['code_status'][$exec['status']];
}
$exec['statusVerbose'] = sprintf(lang_get('issue_exec_result'), $dummy);
unset($tcaseMgr);
$platform_identity = '';
if ($exec['platform_id'] > 0) {
$platform_identity = sprintf(lang_get('issue_platform'), $exec['platform_name']);
}
if (property_exists($argsObj, 'bug_notes')) {
// parse
$tags = array('%%EXECID%%', '%%TESTER%%', '%%TESTPLAN%%', '%%PLATFORM%%', '%%BUILD%%', '%%EXECTS%%', '%%EXECSTATUS%%', '%%EXECNOTES%%');
$values = array(sprintf(lang_get('issue_exec_id'), $argsObj->exec_id), sprintf(lang_get('issue_tester'), $exec['tester_login']), sprintf(lang_get('issue_tplan'), $exec['testplan_name']), $platform_identity, sprintf(lang_get('issue_build'), $exec['build_name']), sprintf(lang_get('execution_ts_iso'), $exec['execution_ts']), $exec['statusVerbose'], $exec['execution_notes']);
$ret->description = str_replace($tags, $values, $argsObj->bug_notes);
// @since 1.9.14
// %%EXECATT:1%% => lnl.php?type=file&id=1&apikey=gfhdgjfgdsjgfjsg
$target['value'] = '%%EXECATT:';
$target['len'] = strlen($target['value']);
$doIt = true;
$url2use = $argsObj->basehref . 'lnl.php?type=file&id=';
while ($doIt) {
$mx = strpos($ret->description, $target['value']);
if ($doIt = !($mx === FALSE)) {
$offset = $mx + $target['len'];
$cx = strpos($ret->description, '%%', $offset);
if ($cx === FALSE) {
// chaos! => abort
$doIt = false;
break;
}
$old = substr($ret->description, $mx, $cx - $mx + 2);
// 2 is MAGIC!!!
$new = str_replace($target['value'], $url2use, $old);
$new = str_replace('%%', '&apikey=' . $argsObj->tplan_apikey, $new);
$ret->description = str_replace($old, $new, $ret->description);
}
}
} else {
$ret->description = sprintf(lang_get('issue_generated_description'), $argsObj->exec_id, $exec['tester_login'], $exec['testplan_name']);
$ret->description .= $platform_identity != '' ? $platform_identity . "\n" : '';
$ret->description .= sprintf(lang_get('issue_build') . "\n" . lang_get('execution_ts_iso') . "\n", $exec['build_name'], $exec['execution_ts']);
$ret->description .= "\n" . $exec['statusVerbose'] . "\n\n" . $exec['execution_notes'];
}
$ret->timestamp = sprintf(lang_get('execution_ts_iso'), $exec['execution_ts']);
$ret->summary = $ret->auditSign . ' - ' . $ret->timestamp;
if (property_exists($argsObj, 'bug_summary') && strlen(trim($argsObj->bug_summary)) != 0) {
$ret->summary = $argsObj->bug_summary;
}
return $ret;
}
示例3: generateIssueText
/**
*
*/
function generateIssueText($dbHandler, $argsObj, $itsObj)
{
$ret = new stdClass();
$opOK = false;
$msg = '';
$resultsCfg = config_get('results');
$tcaseMgr = new testcase($dbHandler);
$exec = current($tcaseMgr->getExecution($argsObj->exec_id, $argsObj->tcversion_id));
$dummy = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->tcversion_id);
$ret->auditSign = $tcaseMgr->getAuditSignature((object) array('id' => $dummy['parent_id']));
$dummy = $exec['status'];
if (isset($resultsCfg['code_status'][$exec['status']])) {
$dummy = $resultsCfg['code_status'][$exec['status']];
}
$exec['statusVerbose'] = sprintf(lang_get('issue_exec_result'), $dummy);
unset($tcaseMgr);
$platform_identity = '';
if ($exec['platform_id'] > 0) {
$platform_identity = sprintf(lang_get('issue_platform'), $exec['platform_name']);
}
if (property_exists($argsObj, 'bug_notes')) {
// parse
$tags = array('%%EXECID%%', '%%TESTER%%', '%%TESTPLAN%%', '%%PLATFORM%%', '%%BUILD%%', '%%EXECTS%%', '%%EXECSTATUS%%', '%%EXECNOTES%%');
$values = array(sprintf(lang_get('issue_exec_id'), $argsObj->exec_id), sprintf(lang_get('issue_tester'), $exec['tester_login']), sprintf(lang_get('issue_tplan'), $exec['testplan_name']), $platform_identity, sprintf(lang_get('issue_build'), $exec['build_name']), sprintf(lang_get('execution_ts_iso'), $exec['execution_ts']), $exec['statusVerbose'], $exec['execution_notes']);
$ret->description = str_replace($tags, $values, $argsObj->bug_notes);
} else {
$ret->description = sprintf(lang_get('issue_generated_description'), $argsObj->exec_id, $exec['tester_login'], $exec['testplan_name']);
$ret->description .= $platform_identity != '' ? $platform_identity . "\n" : '';
$ret->description .= sprintf(lang_get('issue_build') . "\n" . lang_get('execution_ts_iso') . "\n", $exec['build_name'], $exec['execution_ts']);
$ret->description .= "\n" . $exec['statusVerbose'] . "\n\n" . $exec['execution_notes'];
}
$ret->timestamp = sprintf(lang_get('execution_ts_iso'), $exec['execution_ts']);
$ret->summary = $ret->auditSign . ' - ' . $ret->timestamp;
if (property_exists($argsObj, 'bug_summary') && strlen(trim($argsObj->bug_summary)) != 0) {
$ret->summary = $argsObj->bug_summary;
}
return $ret;
}