* Optimize story getstories2link unit test script.
This commit is contained in:
@@ -2771,10 +2771,11 @@ class storyModel extends model
|
||||
$products = empty($executionID) ? $this->product->getList(0, 'all', 0, 0, 'all') : $this->product->getProducts($executionID);
|
||||
}
|
||||
|
||||
$type = in_array($type, array('requirement', 'epic')) ? $type : 'story';
|
||||
$this->loadModel('search')->setQuery($type, $queryID);
|
||||
|
||||
$allProduct = "`product` = 'all'";
|
||||
$queryVar = in_array($type, array('requirement', 'epic')) ? "{$type}Query" : 'storyQuery';
|
||||
$queryVar = "{$type}Query";
|
||||
$storyQuery = $this->session->{$queryVar};
|
||||
$queryProductID = $productID;
|
||||
if(strpos($storyQuery, $allProduct) !== false)
|
||||
|
||||
@@ -18,8 +18,8 @@ cid=0
|
||||
|
||||
*/
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
zenData('userview')->gen(0);
|
||||
zenData('storyspec')->gen(60);
|
||||
zenData('product')->gen(20);
|
||||
$story = zenData('story');
|
||||
@@ -39,10 +39,12 @@ $relation->gen(24);
|
||||
|
||||
$_SESSION = array();
|
||||
global $tester;
|
||||
|
||||
su('admin');
|
||||
$stories1 = $tester->loadModel('story')->getStories2Link(1, 'bySearch', 0);
|
||||
$stories2 = $tester->loadModel('story')->getStories2Link(2);
|
||||
|
||||
r(count($stories1)) && p() && e('18'); // 获取需求1可关联的需求数量
|
||||
r(count($stories2)) && p() && e('18'); // 获取需求2可关联的需求数量
|
||||
r(count($stories1)) && p() && e('9'); // 获取需求1可关联的需求数量
|
||||
r(count($stories2)) && p() && e('9'); // 获取需求2可关联的需求数量
|
||||
r($stories1) && p('12:type,product') && e('story,1'); // 获取需求12可关联的需求id、product
|
||||
r($stories2) && p('14:type,product') && e('story,1'); // 获取需求3可关联的需求id、product
|
||||
r($stories2) && p('14:type,product') && e('story,1'); // 获取需求3可关联的需求id、product
|
||||
|
||||
Reference in New Issue
Block a user