您的位置:軟件測試 > 開源軟件測試 > 開源Bug管理工具 > Mantis
testlink&mantis系列:Testlink提交BUG到mantis方式簡化
作者:網(wǎng)絡轉(zhuǎn)載 發(fā)布時間:[ 2013/12/18 11:11:38 ] 推薦標簽:

1.1.3. 在mantis目錄下面新增bug_add_testlink.php頁面,進行testlink和mantis的BUG關聯(lián)的處理

新增:mantisug_add_testlink.php

<?php

//2013-01-06 luly 增加BUG時,進行testlink關聯(lián)

function write_execution_bug($exec_id, $bug_id,$just_delete=false)

{

$conn = mysql_connect("localhost","root","");

$execution_bugs = 'testlink.ttexecution_bugs';

// Instead of Check if record exists before inserting, do delete + insert

$sql = "DELETE FROM {$execution_bugs} " .

"WHERE execution_id={$exec_id} " .

"AND bug_id='" . $bug_id ."'";

$result = mysql_query($sql,$conn);

if(!$just_delete)

{

$sql = "INSERT INTO {$execution_bugs} " .

"(execution_id,bug_id) " .

"VALUES({$exec_id},'" . $bug_id . "')";

$result = mysql_query($sql,$conn);

}

return $result ? 1 : 0;

}

?>


1.1.4. 修改bug_report.php,如果存在exec_id,則進行testlink和mantis的BUG關聯(lián)

修改mantisug_report.php

(1)在一開始增加一句:

//2013-01-06 luly 增加BUG時,進行testlink關聯(lián)

require_once( 'bug_add_testlink.php' );

//***********************************************************//

(2)修改如下內(nèi)容:

$t_bug_id = $t_bug_data->create();

=》

//2013-01-06 luly 增加BUG時,進行testlink關聯(lián)

//$t_bug_id = $t_bug_data->create();

$testlink_exec_id = $_POST["exec_id"];

if ($testlink_exec_id!= "")

{

$t_bug_id = $t_bug_data->create();

write_execution_bug($testlink_exec_id,$t_bug_id);

}

else

{

$t_bug_id = $t_bug_data->create();

}

上一頁123下一頁
關鍵詞閱讀
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd