本文整理汇总了PHP中testproject::importKeywordsFromSimpleXML方法的典型用法代码示例。如果您正苦于以下问题:PHP testproject::importKeywordsFromSimpleXML方法的具体用法?PHP testproject::importKeywordsFromSimpleXML怎么用?PHP testproject::importKeywordsFromSimpleXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testproject
的用法示例。
在下文中一共展示了testproject::importKeywordsFromSimpleXML方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importTestCaseDataFromXML
function importTestCaseDataFromXML(&$db, $fileName, $parentID, $tproject_id, $userID, $options = null)
{
tLog('importTestCaseDataFromXML called for file: ' . $fileName);
$xmlTCs = null;
$resultMap = null;
$my = array();
$my['options'] = array('useRecursion' => false, 'importIntoProject' => 0, 'duplicateLogic' => array('hitCriteria' => 'name', 'actionOnHit' => null));
$my['options'] = array_merge($my['options'], (array) $options);
foreach ($my['options'] as $varname => $value) {
${$varname} = $value;
}
if (file_exists($fileName)) {
$xml = @simplexml_load_file_wrapper($fileName);
if ($xml !== FALSE) {
$xmlKeywords = $xml->xpath('//keywords');
$kwMap = null;
if ($xmlKeywords) {
$tproject = new testproject($db);
$loop2do = sizeof($xmlKeywords);
for ($idx = 0; $idx < $loop2do; $idx++) {
$tproject->importKeywordsFromSimpleXML($tproject_id, $xmlKeywords[$idx]);
}
$kwMap = $tproject->get_keywords_map($tproject_id);
$kwMap = is_null($kwMap) ? null : array_flip($kwMap);
}
if (!$useRecursion && $xml->getName() == 'testcases') {
$resultMap = importTestCasesFromSimpleXML($db, $xml, $parentID, $tproject_id, $userID, $kwMap, $duplicateLogic);
}
if ($useRecursion && $xml->getName() == 'testsuite') {
$resultMap = importTestSuitesFromSimpleXML($db, $xml, intval($parentID), intval($tproject_id), $userID, $kwMap, $importIntoProject, $duplicateLogic);
}
}
}
return $resultMap;
}