本文整理匯總了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;
}