* Get related cases test.
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/testcase.class.php';
|
||||
su('admin');
|
||||
|
||||
function initData()
|
||||
{
|
||||
$casedata = zdTable('case');
|
||||
$casedata->id->range('1-10');
|
||||
$casedata->case->range('2,3{1}0{9}');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testcaseModel->getRelatedCases();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
- 测试获取关联的用例
|
||||
- 属性2 @这个是测试用例2
|
||||
- 属性3 @这个是测试用例3
|
||||
|
||||
*/
|
||||
|
||||
$linkCases = array('2,3');
|
||||
|
||||
$testcase = new testcaseTest();
|
||||
r($testcase->getRelatedCasesTest($linkCases)) && p('2;3') && e('这个是测试用例2;这个是测试用例3'); // 测试获取关联的用例
|
||||
@@ -332,6 +332,14 @@ class testcaseTest
|
||||
return $this->objectModel->getBugs2Link($caseID, $browseType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取关联需求的测试。
|
||||
* Get related stories test.
|
||||
*
|
||||
* @param array $storyIdList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getRelatedStoriesTest(array $storyIdList): array
|
||||
{
|
||||
$cases = array();
|
||||
@@ -346,6 +354,28 @@ class testcaseTest
|
||||
return $this->objectModel->getRelatedStories($cases);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取关联用例的测试。
|
||||
* Get related cases test.
|
||||
*
|
||||
* @param array $linkCases
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getRelatedCasesTest(array $linkCases): array
|
||||
{
|
||||
$cases = array();
|
||||
foreach($linkCases as $linkCase)
|
||||
{
|
||||
$case = new stdclass();
|
||||
$case->linkCase = $linkCase;
|
||||
|
||||
$cases[] = $case;
|
||||
}
|
||||
|
||||
return $this->objectModel->getRelatedCases($cases);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新的测试用例。
|
||||
* Test update a case.
|
||||
|
||||
Reference in New Issue
Block a user