本文整理汇总了PHP中testproject::get_keywords_tcases方法的典型用法代码示例。如果您正苦于以下问题:PHP testproject::get_keywords_tcases方法的具体用法?PHP testproject::get_keywords_tcases怎么用?PHP testproject::get_keywords_tcases使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testproject
的用法示例。
在下文中一共展示了testproject::get_keywords_tcases方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: keywordFilteredSpecView
/**
*
* @internal revisions:
* 20100721 - asimon - BUGID 3406 - added $options for new user assignments per build
* 20100218 - asimon - BUGID 3026 - added parameter $testcaseFilter to include functionality
* previously used on tc_exec_assignment.php
* to show only testcases present in filter argument
*
*/
function keywordFilteredSpecView(&$dbHandler, &$argsObj, $keywordsFilter, &$tplanMgr, &$tcaseMgr, $testcaseFilter = null, $options = null)
{
$tsuiteMgr = new testsuite($dbHandler);
$tprojectMgr = new testproject($dbHandler);
$tsuite_data = $tsuiteMgr->get_by_id($argsObj->id);
$filterAssignedTo = property_exists($argsObj, 'filter_assigned_to') ? $argsObj->filter_assigned_to : null;
// 3406
// $ua_build = !is_null($options) && isset($options['user_assignments_per_build']) ?
// $options['user_assignments_per_build'] : null;
// @TODO - 20081019
// Really understand differences between:
// $argsObj->keyword_id and $keywordsFilter
// BUGID 1041
$filters = array('keyword_id' => $argsObj->keyword_id, 'assigned_to' => $filterAssignedTo);
// 20100715 - asimon - why the double writing to $tplan_linked_tcversions?
// will be overwritten again two lines below
// $tplan_linked_tcversions = $tplanMgr->get_linked_tcversions($argsObj->tplan_id, $filters, $options);
// This does filter on keywords ALWAYS in OR mode.
// 3406: added $options
$tplan_linked_tcversions = getFilteredLinkedVersions($argsObj, $tplanMgr, $tcaseMgr, $options);
// With this pieces we implement the AND type of keyword filter.
$testCaseSet = null;
if (!is_null($keywordsFilter) && !is_null($keywordsFilter->items)) {
$keywordsTestCases = $tprojectMgr->get_keywords_tcases($argsObj->tproject_id, $keywordsFilter->items, $keywordsFilter->type);
$testCaseSet = array_keys($keywordsTestCases);
}
// BUGID 3026 - added $testcaseFilter
if (!is_null($testCaseSet) && !is_null($testcaseFilter)) {
$testCaseSet = array_intersect($testCaseSet, array($testcaseFilter));
} else {
if (is_null($testCaseSet) && !is_null($testcaseFilter)) {
$testCaseSet = $testcaseFilter;
}
}
// now get values as keys
// 20100722 - asimon - additional check here because of warning from array_combine when $testCaseSet is null
//$testCaseSet = array_combine($testCaseSet, $testCaseSet);
$testCaseSet = !is_null($testCaseSet) ? array_combine($testCaseSet, $testCaseSet) : null;
// function gen_spec_view(&$db,$spec_view_type='testproject',$tobj_id,$id,$name,&$linked_items,
// $map_node_tccount,$filters=null, $options = null,$tproject_id = null)
//
// 3406
$options = array('write_button_only_if_linked' => 1, 'prune_unlinked_tcversions' => 1) + (array) $options;
$filters = array('keywords' => $argsObj->keyword_id, 'testcases' => $testCaseSet);
$out = gen_spec_view($dbHandler, 'testplan', $argsObj->tplan_id, $argsObj->id, $tsuite_data['name'], $tplan_linked_tcversions, null, $filters, $options);
return $out;
}
示例2: dBug
echo "</pre>";
$info = $tproject_mgr->get_first_level_test_suites($tproject_id, $mode = 'simple');
new dBug($info);
die;
echo "<pre> testproject - get_keywords_map(\$testproject_id)";
echo "</pre>";
$tproject_id = 1;
echo "<pre> get_keywords_map({$tproject_id})";
echo "</pre>";
$keywords_map = $tproject_mgr->get_keywords_map($tproject_id);
new dBug($keywords_map);
echo "<pre> testproject - get_keywords_tcases(\$testproject_id, \$keyword_id=0)";
echo "</pre>";
echo "<pre> get_keywords_tcases({$tproject_id})";
echo "</pre>";
$keywords_tcases = $tproject_mgr->get_keywords_tcases($tproject_id);
new dBug($keywords_tcases);
echo "<pre> testproject - get_linked_custom_fields(\$id,\$node_type=null)";
echo "</pre>";
echo "<pre> get_linked_custom_fields({$tproject_id})";
echo "</pre>";
$linked_custom_fields = $tproject_mgr->get_linked_custom_fields($tproject_id);
new dBug($linked_custom_fields);
echo "<pre> testproject - gen_combo_test_suites(\$id,\$exclude_branches=null,\$mode='dotted')";
echo "</pre>";
echo "<pre> gen_combo_test_suites({$tproject_id},null,'dotted')";
echo "</pre>";
$combo_test_suites = $tproject_mgr->gen_combo_test_suites($tproject_id, null, 'dotted');
new dBug($combo_test_suites);
echo "<pre> gen_combo_test_suites({$tproject_id},null,'dotted')";
echo "</pre>";
示例3: get_testplan_nodes_testcount
/**
* @return array a map:
* key => node_id
* values => node test case count considering test cases presents
* in the nodes of the subtree that starts on node_id
* Means test case can not be sons/daughters of node_id.
*
* node name (useful only for debug purpouses).
*/
function get_testplan_nodes_testcount(&$db, $tproject_id, $tproject_name, $tplan_id, $tplan_name, $keywordsFilter = null)
{
$tplan_mgr = new testplan($db);
$tproject_mgr = new testproject($db);
$tree_manager = $tplan_mgr->tree_manager;
$tcase_node_type = $tree_manager->node_descr_id['testcase'];
$hash_descr_id = $tree_manager->get_available_node_types();
$hash_id_descr = array_flip($hash_descr_id);
$resultsCfg = config_get('results');
$decoding_hash = array('node_id_descr' => $hash_id_descr, 'status_descr_code' => $resultsCfg['status_code'], 'status_code_descr' => $resultsCfg['code_status']);
$test_spec = $tproject_mgr->get_subtree($tproject_id, RECURSIVE_MODE);
$linkedFilters = array('keyword_id' => $keywordsFilter->items);
$tplan_tcases = $tplan_mgr->get_linked_tcversions($tplan_id, $linkedFilters);
if (is_null($tplan_tcases)) {
$tplan_tcases = array();
}
$test_spec['name'] = $tproject_name;
$test_spec['id'] = $tproject_id;
$test_spec['node_type_id'] = $hash_descr_id['testproject'];
$map_node_tccount = array();
if ($test_spec) {
$tck_map = null;
if (!is_null($keywordsFilter)) {
$tck_map = $tproject_mgr->get_keywords_tcases($tproject_id, $keywordsFilter->items, $keywordsFilter->type);
}
//@TODO: schlundus, can we speed up with NO_EXTERNAL?
$filters = null;
$options = array('hideTestCases' => 0, 'viewType' => 'executionTree');
$testcase_counters = prepareNode($db, $test_spec, $decoding_hash, $map_node_tccount, $tck_map, $tplan_tcases, $filters, $options);
$test_spec['testcase_count'] = $testcase_counters['testcase_count'];
}
return $map_node_tccount;
}
示例4: generateExecTree
/**
* initializes linked_tcversions object
*
* Builds a multi-dimentional array which represents the tree structure.
* Specifically an array is returned in the following pattern
* every 3rd index is null if suite does not contain other suites
* or array of same pattern if it does contain suites
*
* KL took this code from menuTree.inc.php.
* Builds both $this->flatArray and $this->suiteStructure
*
* @param resource &$db reference to database handler
*
* @return array structured map
*
* suite[0] = suite id
* suite[1] = suite name
* suite[2] = array() of child suites or null
* suite[3] = suite id
* suite[4] = suite name
* suite[5] = array() of child suites or null
*
*/
private function generateExecTree(&$db, $keyword_id = 0, $owner = null)
{
$RECURSIVE_MODE = true;
$tplan_mgr = $this->tplanMgr;
$tproject_mgr = new testproject($this->db);
$tree_manager = $tplan_mgr->tree_manager;
$hash_descr_id = $tree_manager->get_available_node_types();
$test_spec = $tproject_mgr->get_subtree($this->tprojectID, $RECURSIVE_MODE);
$filters = array('keyword_id' => $keyword_id, 'assigned_to' => $owner);
// $options = array('output' => 'mapOfArray'); // needed to have platform info
$options = array('output' => 'mapOfMap');
// needed to have platform info
$tplan_tcversions = $tplan_mgr->get_linked_tcversions($this->testPlanID, $filters, $options);
// $this->linked_tcversions = &$tp_tcs;
if (is_null($tplan_tcversions)) {
$tplan_tcversions = array();
}
$test_spec['name'] = $this->tplanName;
$test_spec['id'] = $this->tprojectID;
$test_spec['node_type_id'] = $hash_descr_id['testproject'];
$suiteStructure = null;
$tck_map = null;
if ($keyword_id) {
$tck_map = $tproject_mgr->get_keywords_tcases($this->tprojectID, $keyword_id);
}
$hash_id_descr = array_flip($hash_descr_id);
$testcase_count = $this->removeEmptySuites($test_spec, $hash_id_descr, $tck_map, $tplan_tcversions, $owner);
// $mem[]=self::memory_status(__CLASS__,__FILE__,__FUNCTION__,__LINE__);
// $xmem=current($mem);
// echo "<pre>debug 20080928 - \ - " . __FUNCTION__ . " --- "; print_r($xmem['msg']); echo "</pre>";
// ob_flush();flush();
$suiteStructure = $this->processExecTreeNode(1, $test_spec, $hash_id_descr);
return array($suiteStructure, $tplan_tcversions);
}
示例5: getFilteredSpecViewFlat
/**
*
*/
function getFilteredSpecViewFlat(&$dbHandler, &$argsObj, &$tplanMgr, &$tcaseMgr, $filters = null, $options = null)
{
$tprojectMgr = new testproject($dbHandler);
$tsuite_data = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->id);
$my = array();
// some sort of local scope
$my['filters'] = array('keywordsFilter' => null, 'testcaseFilter' => null, 'assignedToFilter' => null, 'executionTypeFilter' => null);
$my['filters'] = array_merge($my['filters'], (array) $filters);
$my['options'] = array('write_button_only_if_linked' => 1, 'prune_unlinked_tcversions' => 1);
$my['options'] = array_merge($my['options'], (array) $options);
// This does filter on keywords ALWAYS in OR mode.
$tplan_linked_tcversions = getFilteredLinkedVersions($dbHandler, $argsObj, $tplanMgr, $tcaseMgr, $options);
// With these pieces we implement the AND type of keyword filter.
$testCaseSet = null;
$tryNextFilter = true;
$filterApplied = false;
if (!is_null($my['filters']['keywordsFilter']) && !is_null($my['filters']['keywordsFilter']->items)) {
$keywordsTestCases = $tprojectMgr->get_keywords_tcases($argsObj->tproject_id, $my['filters']['keywordsFilter']->items, $my['filters']['keywordsFilter']->type);
$testCaseSet = array_keys((array) $keywordsTestCases);
$tryNextFilter = !is_null($testCaseSet);
$filterApplied = true;
}
if ($tryNextFilter && !is_null($my['filters']['testcaseFilter'])) {
$filterApplied = true;
if (is_null($testCaseSet)) {
$testCaseSet = $my['filters']['testcaseFilter'];
} else {
// wrong use of array() instead of (array)
$testCaseSet = array_intersect($testCaseSet, (array) $my['filters']['testcaseFilter']);
}
}
// when $testCaseSet is null because we have applied filters => we do not need to call other
// method because we know we are going to get NOTHING
$testCaseSet = !is_null($testCaseSet) ? array_combine($testCaseSet, $testCaseSet) : null;
if ($filterApplied && is_null($testCaseSet)) {
return null;
}
$genSpecFilters = array('keywords' => $argsObj->keyword_id, 'testcases' => $testCaseSet, 'exec_type' => $my['filters']['executionTypeFilter'], 'cfields' => null);
if (isset($my['filters']['cfieldsFilter'])) {
$genSpecFilters['cfields'] = $my['filters']['cfieldsFilter'];
}
$out = genSpecViewFlat($dbHandler, 'testplan', $argsObj->tplan_id, $argsObj->id, $tsuite_data['name'], $tplan_linked_tcversions, null, $genSpecFilters, $my['options']);
return $out;
}
示例6: getFilteredSpecView
/**
*
* @param obj $dbHandler
* @param obj $argsObj: user input
* @param obj $argsObj: user input
* @param obj $tplanMgr: test plan manager
* @param obj $tcaseMgr: test case manager
* @param map $filters: keys keywordsFilter, testcaseFilter,assignedToFilter,
* executionTypeFilter, cfieldsFilter
*
* IMPORTANT NOTICE: not all filters are here, other arrive via argsObj
* @param map $options: keys ??
* USED TO PASS options to other method called here -> see these method docs.
*
* @internal revisions:
*
* 20101024 - franciscom - name changed because was misleading, this do lot of filters
* interface changed.
*
* 20100721 - asimon - BUGID 3406 - added $options for new user assignments per build
* 20100218 - asimon - BUGID 3026 - added parameter $testcaseFilter to include functionality
* previously used on tc_exec_assignment.php
* to show only testcases present in filter argument
*
*/
function getFilteredSpecView(&$dbHandler, &$argsObj, &$tplanMgr, &$tcaseMgr, $filters = null, $options = null)
{
$tprojectMgr = new testproject($dbHandler);
$tsuite_data = $tcaseMgr->tree_manager->get_node_hierarchy_info($argsObj->id);
$my = array();
// some sort of local scope
$my['filters'] = array('keywordsFilter' => null, 'testcaseFilter' => null, 'assignedToFilter' => null, 'executionTypeFilter' => null);
$my['filters'] = array_merge($my['filters'], (array) $filters);
$my['options'] = array('write_button_only_if_linked' => 1, 'prune_unlinked_tcversions' => 1);
$my['options'] = array_merge($my['options'], (array) $options);
// This does filter on keywords ALWAYS in OR mode.
// BUGID 3406: added $options
$tplan_linked_tcversions = getFilteredLinkedVersions($argsObj, $tplanMgr, $tcaseMgr, $options);
// With these pieces we implement the AND type of keyword filter.
$testCaseSet = null;
if (!is_null($my['filters']['keywordsFilter']) && !is_null($my['filters']['keywordsFilter']->items)) {
$keywordsTestCases = $tprojectMgr->get_keywords_tcases($argsObj->tproject_id, $my['filters']['keywordsFilter']->items, $my['filters']['keywordsFilter']->type);
$testCaseSet = array_keys($keywordsTestCases);
}
// BUGID 3026 - added $testcaseFilter
if (!is_null($my['filters']['testcaseFilter'])) {
if (is_null($testCaseSet)) {
$testCaseSet = $my['filters']['testcaseFilter'];
} else {
$testCaseSet = array_intersect($testCaseSet, array($my['filters']['testcaseFilter']));
}
}
// now get values as keys
// 20100722 - asimon - additional check here because of warning from array_combine when $testCaseSet is null
$testCaseSet = !is_null($testCaseSet) ? array_combine($testCaseSet, $testCaseSet) : null;
// BUGID 3406
// BUGID 3936: Assign Test Case Execution - Right pane does not reflect custom field filter.
$genSpecFilters = array('keywords' => $argsObj->keyword_id, 'testcases' => $testCaseSet, 'exec_type' => $my['filters']['executionTypeFilter'], 'cfields' => $my['filters']['cfieldsFilter']);
$out = gen_spec_view($dbHandler, 'testplan', $argsObj->tplan_id, $argsObj->id, $tsuite_data['name'], $tplan_linked_tcversions, null, $genSpecFilters, $my['options']);
return $out;
}
示例7: getFilteredLinkedVersions
// 12. Tree will display (Folder) Test Suite A with 2 elements
// 13. click on folder, then on RIGHT pane:
// TC2 - Version 1 NOT ASSIGNED TO TEST PLAN is displayed
// TC1 - Version 2 NOT ASSIGNED TO TEST PLAN is displayed ----> THIS IS RIGHT but WRONG
// Only one TC version can be linked to test plan, and TC1 already is LINKED BUT with VERSION 1.
// Version 2 is displayed because it has EXEC TYPE AUTO
//
// How to solve ?
// Filters regarding this kind of attributes WILL BE NOT APPLIEDED to get linked items
// In this way counters on Test Spec Tree and amount of TC displayed on right pane will be coherent.
//
$tplan_linked_tcversions = getFilteredLinkedVersions($args, $tplan_mgr, $tcase_mgr);
$testCaseSet = null;
if (!is_null($keywordsFilter)) {
// With this pieces we implement the AND type of keyword filter.
$keywordsTestCases = $tproject_mgr->get_keywords_tcases($args->tproject_id, $keywordsFilter->items, $keywordsFilter->type);
if (sizeof($keywordsTestCases)) {
$testCaseSet = array_keys($keywordsTestCases);
}
}
// Choose enable/disable display of custom fields, analysing if this kind of custom fields
// exists on this test project.
$cfields = $tsuite_mgr->cfield_mgr->get_linked_cfields_at_testplan_design($args->tproject_id, 1, 'testcase');
$opt = array('write_button_only_if_linked' => 0, 'add_custom_fields' => 0);
$opt['add_custom_fields'] = count($cfields) > 0 ? 1 : 0;
// 20100411 - BUGID 2797 - filter by test case execution type
$filters = array('keywords' => $args->keyword_id, 'testcases' => $testCaseSet, 'exec_type' => $args->executionType, 'importance' => $args->importance);
$out = gen_spec_view($db, 'testPlanLinking', $args->tproject_id, $args->object_id, $tsuite_data['name'], $tplan_linked_tcversions, null, $filters, $opt);
$gui->has_tc = $out['num_tc'] > 0 ? 1 : 0;
$gui->items = $out['spec_view'];
$gui->has_linked_items = $out['has_linked_items'];